protected String getClusterInfoPropertyValue(String name) { StateAccessForProviders accessor = getAmState(); assert accessor.isApplicationLive(); ClusterDescription description = accessor.getClusterStatus(); return description.getInfo(name); }
protected String getClusterOptionPropertyValue(String name) throws BadConfigException { StateAccessForProviders accessor = getAmState(); assert accessor.isApplicationLive(); ClusterDescription description = accessor.getClusterStatus(); return description.getMandatoryOption(name); }
protected String getClusterInfoPropertyValue(String name) { StateAccessForProviders accessor = getAmState(); assert accessor.isApplicationLive(); ClusterDescription description = accessor.getClusterStatus(); return description.getInfo(name); }
protected String getClusterOptionPropertyValue(String name) throws BadConfigException { StateAccessForProviders accessor = getAmState(); assert accessor.isApplicationLive(); ClusterDescription description = accessor.getClusterStatus(); return description.getMandatoryOption(name); }
@VisibleForTesting protected void addGetConfigCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response) throws SliderException { assert getAmState().isApplicationLive(); StatusCommand cmd = new StatusCommand(); String clusterName = getClusterName(); cmd.setCommandType(AgentCommandType.STATUS_COMMAND); cmd.setComponentName(roleName); cmd.setServiceName(clusterName); cmd.setClusterName(clusterName); cmd.setRoleCommand(StatusCommand.GET_CONFIG_COMMAND); Map<String, String> hostLevelParams = new TreeMap<String, String>(); hostLevelParams.put(CONTAINER_ID, containerId); cmd.setHostLevelParams(hostLevelParams); hostLevelParams.put(CONTAINER_ID, containerId); response.addStatusCommand(cmd); }
@VisibleForTesting protected void addGetConfigCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response) throws SliderException { assert getAmState().isApplicationLive(); StatusCommand cmd = new StatusCommand(); String clusterName = getClusterName(); cmd.setCommandType(AgentCommandType.STATUS_COMMAND); cmd.setComponentName(roleName); cmd.setServiceName(clusterName); cmd.setClusterName(clusterName); cmd.setRoleCommand(StatusCommand.GET_CONFIG_COMMAND); Map<String, String> hostLevelParams = new TreeMap<String, String>(); hostLevelParams.put(CONTAINER_ID, containerId); cmd.setHostLevelParams(hostLevelParams); hostLevelParams.put(CONTAINER_ID, containerId); response.addStatusCommand(cmd); }
@VisibleForTesting protected void addGetConfigDockerCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response) throws SliderException { assert getAmState().isApplicationLive();
@VisibleForTesting protected void addGetConfigDockerCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response) throws SliderException { assert getAmState().isApplicationLive();
long timeout) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot();
long timeout) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot();
long timeout) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot();
expect(access.isApplicationLive()).andReturn(true).anyTimes();
long timeout) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot(); if (isDockerContainer(roleGroup) || isYarnDockerContainer(roleGroup)) {
long timeout) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot(); if (isDockerContainer(roleGroup) || isYarnDockerContainer(roleGroup)) {
expect(access.isApplicationLive()).andReturn(true).anyTimes();
@VisibleForTesting protected void addUpgradeCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response, String scriptPath, long timeout) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot(); ConfTreeOperations internalsConf = getAmState().getInternalsSnapshot(); ExecutionCommand cmd = new ExecutionCommand( AgentCommandType.EXECUTION_COMMAND); prepareExecutionCommand(cmd); String clusterName = internalsConf.get(OptionKeys.APPLICATION_NAME); String hostName = getClusterInfoPropertyValue(StatusKeys.INFO_AM_HOSTNAME); cmd.setHostname(hostName); cmd.setClusterName(clusterName); cmd.setRoleCommand(Command.UPGRADE.toString()); cmd.setServiceName(clusterName); cmd.setComponentName(roleName); cmd.setRole(roleName); Map<String, String> hostLevelParams = new TreeMap<String, String>(); hostLevelParams.put(JAVA_HOME, appConf.getGlobalOptions() .getMandatoryOption(JAVA_HOME)); hostLevelParams.put(CONTAINER_ID, containerId); cmd.setHostLevelParams(hostLevelParams); cmd.setCommandParams(commandParametersSet(scriptPath, timeout, true)); Map<String, Map<String, String>> configurations = buildCommandConfigurations( appConf, containerId, roleName, roleGroup); cmd.setConfigurations(configurations); response.addExecutionCommand(cmd); }
@VisibleForTesting protected void addUpgradeCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response, String scriptPath, long timeout) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot(); ConfTreeOperations internalsConf = getAmState().getInternalsSnapshot(); ExecutionCommand cmd = new ExecutionCommand( AgentCommandType.EXECUTION_COMMAND); prepareExecutionCommand(cmd); String clusterName = internalsConf.get(OptionKeys.APPLICATION_NAME); String hostName = getClusterInfoPropertyValue(StatusKeys.INFO_AM_HOSTNAME); cmd.setHostname(hostName); cmd.setClusterName(clusterName); cmd.setRoleCommand(Command.UPGRADE.toString()); cmd.setServiceName(clusterName); cmd.setComponentName(roleName); cmd.setRole(roleName); Map<String, String> hostLevelParams = new TreeMap<String, String>(); hostLevelParams.put(JAVA_HOME, appConf.getGlobalOptions() .getMandatoryOption(JAVA_HOME)); hostLevelParams.put(CONTAINER_ID, containerId); cmd.setHostLevelParams(hostLevelParams); cmd.setCommandParams(commandParametersSet(scriptPath, timeout, true)); Map<String, Map<String, String>> configurations = buildCommandConfigurations( appConf, containerId, roleName, roleGroup); cmd.setConfigurations(configurations); response.addExecutionCommand(cmd); }
String pkg) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot();
protected void addStopCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response, String scriptPath, long timeout, boolean isInUpgradeMode) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot(); ConfTreeOperations internalsConf = getAmState().getInternalsSnapshot();
protected void addStopCommand(String roleName, String roleGroup, String containerId, HeartBeatResponse response, String scriptPath, long timeout, boolean isInUpgradeMode) throws SliderException { assert getAmState().isApplicationLive(); ConfTreeOperations appConf = getAmState().getAppConfSnapshot(); ConfTreeOperations internalsConf = getAmState().getInternalsSnapshot();