Created
October 25, 2011 19:53
-
-
Save ahgittin/1314030 to your computer and use it in GitHub Desktop.
whirr-49 options for cluster controller
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
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(ClusterSpec spec, | |
Predicate<NodeMetadata> condition, Statement statement) throws IOException, RunScriptOnNodesException { | |
return runScriptOnNodesMatching(spec, condition, statement, null); | |
} | |
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(ClusterSpec spec, | |
Predicate<NodeMetadata> condition, Statement statement, RunScriptOptions options) | |
throws IOException, RunScriptOnNodesException { | |
Credentials credentials = new Credentials(spec.getClusterUser(), spec.getPrivateKey()); | |
if (options==null) | |
options = overrideCredentialsWith(credentials).wrapInInitScript(false).runAsRoot(false); | |
else if (options.getOverridingCredentials()==null) | |
options = options.overrideCredentialsWith(credentials); | |
condition = Predicates.and(runningInGroup(spec.getClusterName()), condition); | |
ComputeServiceContext context = getCompute().apply(spec); | |
return context.getComputeService().runScriptOnNodesMatching(condition, statement, options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment