}
String agentImage = instanceDefinition.getInternalOperations().
get(OptionKeys.INTERNAL_APPLICATION_IMAGE_PATH);
if (agentImage != null) {
LocalResource agentImageRes = fileSystem.createAmResource(new Path(agentImage), LocalResourceType.ARCHIVE);
launcher.addLocalResource(AgentKeys.AGENT_INSTALL_DIR, agentImageRes);
}
log.info("Using {} for agent.", scriptPath);
LocalResource appDefRes = fileSystem.createAmResource(
fileSystem.getFileSystem().resolvePath(new Path(appDef)),
LocalResourceType.ARCHIVE);
launcher.addLocalResource(AgentKeys.APP_DEFINITION_DIR, appDefRes);
String agentConf = instanceDefinition.getAppConfOperations().
getGlobalOptions().getMandatoryOption(AgentKeys.AGENT_CONF);
LocalResource agentConfRes = fileSystem.createAmResource(
fileSystem.getFileSystem().resolvePath(new Path(agentConf)),
LocalResourceType.FILE);
launcher.addLocalResource(AgentKeys.AGENT_CONFIG_FILE, agentConfRes);
String agentVer = instanceDefinition.getAppConfOperations().
getGlobalOptions().getOption(AgentKeys.AGENT_VERSION, null);
if (agentVer != null) {
LocalResource agentVerRes = fileSystem.createAmResource(
fileSystem.getFileSystem().resolvePath(new Path(agentVer)),
LocalResourceType.FILE);
launcher.addLocalResource(AgentKeys.AGENT_VERSION_FILE, agentVerRes);
}