//now add the image if it was set
String imageURI = instanceDefinition.getInternalOperations()
.get(OptionKeys.INTERNAL_APPLICATION_IMAGE_PATH);
fileSystem.maybeAddImagePath(launcher.getLocalResources(), imageURI);
CommandLineBuilder commandLine = new CommandLineBuilder();
String heap = "-Xmx" + appComponent.getOption(RoleKeys.JVM_HEAP, DEFAULT_JVM_HEAP);
String opt = "ACCUMULO_OTHER_OPTS";
if (SliderUtils.isSet(heap)) {
switch (role) {
case AccumuloKeys.ROLE_MASTER:
opt = "ACCUMULO_MASTER_OPTS";
break;
case AccumuloKeys.ROLE_TABLET:
opt = "ACCUMULO_TSERVER_OPTS";
break;
case AccumuloKeys.ROLE_MONITOR:
opt = "ACCUMULO_MONITOR_OPTS";
break;
case AccumuloKeys.ROLE_GARBAGE_COLLECTOR:
opt = "ACCUMULO_GC_OPTS";
break;
}
launcher.setEnv(opt, heap);
}
//this must stay relative if it is an image
commandLine.add(providerUtils.buildPathToScript(instanceDefinition,
"bin", "accumulo"));
//role is translated to the accumulo one
commandLine.add(AccumuloRoles.serviceForRole(role));
// Add any role specific arguments to the command line
String additionalArgs = ProviderUtils.getAdditionalArgs(appComponent);
if (!StringUtils.isBlank(additionalArgs)) {
commandLine.add(additionalArgs);
}
commandLine.addOutAndErrFiles(role + "-out.txt", role + "-err.txt");
launcher.addCommand(commandLine.build());
}