-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scylladb/scylladb#12147 implements a feature for `/locanodes` to filter out nodes by rack and/or datacenter. Now we can make dynamodb client to target particular rack and/or datacenter. This PR allows user to target dynamodb client to a particular rack/datacenter or rack+datacenter, via following API: ``` AlternatorRequestHandler handler = new AlternatorRequestHandler(uri, datacenter, rack); ``` Changes in auxiliary `AlternatorLiveNodes` API: 1. Constructor input argument is an single URI now 2. Validation is introduced 3. Start is moved out from the constructor ``` liveNodes = new AlternatorLiveNodes(Collections.singletonList(seedURI), datacenter, rack); try { liveNodes.validate(); liveNodes.checkIfRackAndDatacenterSetCorrectly(); } catch (AlternatorLiveNodes.ValidationError | AlternatorLiveNodes.FailedToCheck e) { throw new RuntimeException(e); } liveNodes.start(); ``` 1. Regular, old code: `AlternatorRequestHandler handler = new AlternatorRequestHandler(uri)` for `6.2.0` and `master` 2. Dc+Rack-aware: `AlternatorRequestHandler handler = new AlternatorRequestHandler(uri, "dc1", "rack1")` for `6.2.0` and `master` 3. Dc-aware: `AlternatorRequestHandler handler = new AlternatorRequestHandler(uri, "dc1", "")` for `6.2.0` and `master` 4. Rack-aware: `AlternatorRequestHandler handler = new AlternatorRequestHandler(uri, "", "rack1")` for `6.2.0` and `master` All tests are done for following deployments: 1. MultiDc 2. MultiRack+MultiDc 3. SingleDc Closes #40
- Loading branch information
1 parent
a2fbd8f
commit e5d967c
Showing
6 changed files
with
301 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.