Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic discovery of seeds for clusters #63

Merged
merged 2 commits into from
Mar 17, 2017

Conversation

adejanovski
Copy link
Contributor

Currently Reaper has the data model to accept multiple seed nodes but doesn't use it, as it only takes a single seed as input.

This PR adds 2 things :

  • the ability to add multiple seed nodes separated by commas
  • the ability for reaper to fill in dynamically the list of nodes by calling JmxProxy.getLiveNodes()

The list of nodes won't get updated afterwards though, and it is necessary to call modifyClusterSeed(PUT /cluster/{clusterName}) in order to have a fresh list of nodes.

The dynamic seed list is enabled by default and can be disabled in the yaml file.

@adejanovski
Copy link
Contributor Author

SonarQube analysis reported 2 issues

  • MINOR 2 minor

Watch the comments in this conversation to review them.

Set<String> seedHostsFinal = seedHosts;
if (context.config.getEnableDynamicSeedList()
&& liveNodes.isPresent()) {
seedHostsFinal = liveNodes.get().size()>0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Use isEmpty() to check whether the collection is empty or not. rule

@@ -253,5 +290,10 @@ public Response deleteCluster(
return Response.serverError().entity("delete failed for schedule with name \""
+ clusterName + "\"").build();
}

private Set<String> parseSeedHosts(String seedHost) {
return Arrays.stream(seedHost.split(",")).map(seed -> seed.trim()).collect(Collectors.toSet());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Replace this lambda with a method reference. rule

@rustyrazorblade
Copy link
Contributor

no objections here.

@adejanovski adejanovski force-pushed the allow-multiple-seeds branch from b15bc66 to 83ed42d Compare March 17, 2017 07:30
@adejanovski adejanovski force-pushed the allow-multiple-seeds branch from 83ed42d to 9128024 Compare March 17, 2017 07:42
@adejanovski adejanovski merged commit 2af9603 into master Mar 17, 2017
@adejanovski adejanovski deleted the allow-multiple-seeds branch March 24, 2017 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants