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