Destination: use striped lock to reduce lock contention

Destination used a single lock to serialize pushes to the same
destination. When many repositories are replicated via one
destination this may cause lock contention and unnecessarily
throttle replication throughput.

Hence use a striped lock with up to 16 stripes to reduce lock
contention but still serialize replication per repository.
Don't use more stripes than the number of projects to be
replicated if the projects are configured explicitly.

Avoid copying the pending and in-flight maps of PushOnes to be
executed for reading them. Instead directly access the maps held
by a destination and use thread-safe ConcurrentHashMaps for both.

Change-Id: I0ad2f51249ffba429fc61b422056fa85d88b1de4
4 files changed
tree: e9a9056cf9625d411d43c98874aac6bc34aaf908
  1. .settings/
  2. src/
  3. .gitignore
  4. .mailmap
  5. BUILD
  6. LICENSE