DESCRIPTION

JVMCBC-397: Avoid concurrent modification/reading of bucketConfigs map.

Motivation:
-----------
When opening a bucket, the `ClusterConfig` will be modified before performing
`RequestHandler.reconfigure`, which reconfigures all buckets by flatMapping
over an `Observable` that iterates through the `HashMap` in `ClusterConfig`.

This is especially a problem when buckets are opened concurrently, as the
`reconfigure` operation can overlap with the modifications due to opening the
other buckets, leading to a `ConcurrentModificationException` being thrown from
RxJava. Since the modifications aren't synchronised at all, there could
theoretically (though this might be unlikely) be additional problems with
corrupting the internal structure of the HashMap if multiple actual
modifications happen at the same time.

Modifications:
--------------
The `Map` field in `DefaultClusterConfig` is changed to hold a
`ConcurrentHashMap` instead of a `HashMap`.

Results:
--------
No more `ConcurrentModificationException` on reconfiguration, not possible to
have multiple threads modifying a particular `HashMap` at the same time.

Change-Id: Ic72150f5830f15e8ee93d1602b1b220f574a91ea


COMMENTS

author: Natasha Sullivan
date: 2017-02-28 17:19:47.946000000

Patch Set 3: Commit message was updated.

-------------------------------------
author: Natasha Sullivan
date: 2017-02-28 17:20:03.485000000

Patch Set 3: Code-Review+2 Verified+1

-------------------------------------
