http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java new file mode 100644 index 0000000..e310f45 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +import com.beust.jcommander.Parameters; + +@Parameters(commandNames = { SliderActions.ACTION_UPDATE}, + commandDescription = SliderActions.DESCRIBE_ACTION_UPDATE) + +public class ActionUpdateArgs extends AbstractClusterBuildingActionArgs { + + @Override + public String getActionName() { + return SliderActions.ACTION_UPDATE; + } +}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java index f7b7349..00151f4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java @@ -20,8 +20,8 @@ package org.apache.hadoop.yarn.service.client.params; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; -import org.apache.slider.core.exceptions.BadCommandArgumentsException; -import org.apache.slider.core.exceptions.ErrorStrings; +import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException; +import org.apache.hadoop.yarn.service.exceptions.ErrorStrings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java index d8d8ab4..204149b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java @@ -26,59 +26,38 @@ package org.apache.hadoop.yarn.service.client.params; * so it is easier to see what arguments are there */ public interface Arguments { - String ARG_ADDON = "--addon"; - String ARG_ALL = "--all"; - String ARG_ALIAS = "--alias"; - String ARG_APPLICATION = "--application"; + String ARG_APPDEF = "--appdef"; - String ARG_APP_HOME = "--apphome"; String ARG_BASE_PATH = "--basepath"; - String ARG_CLIENT = "--client"; - String ARG_CONFDIR = "--appconf"; String ARG_COMPONENT = "--component"; - String ARG_COUNT = "--count"; String ARG_COMPONENT_SHORT = "--comp"; String ARG_COMPONENTS = "--components"; String ARG_COMP_OPT= "--compopt"; String ARG_COMP_OPT_SHORT = "--co"; String ARG_CONFIG = "--config"; String ARG_CONTAINERS = "--containers"; - String ARG_CREDENTIALS = "--credentials"; String ARG_DEBUG = "--debug"; String ARG_DEFINE = "-D"; String ARG_DELETE = "--delete"; String ARG_DEST = "--dest"; String ARG_DESTDIR = "--destdir"; - String ARG_DESTFILE = "--destfile"; - String ARG_EXITCODE = "--exitcode"; - String ARG_FAIL = "--fail"; - /** - filesystem-uri: {@value} - */ String ARG_FILESYSTEM = "--fs"; String ARG_FILESYSTEM_LONG = "--filesystem"; String ARG_FOLDER = "--folder"; String ARG_FORCE = "--force"; String ARG_FORMAT = "--format"; - String ARG_GETCERTSTORE = "--getcertstore"; String ARG_GETCONF = "--getconf"; String ARG_GETEXP = "--getexp"; String ARG_GETFILES = "--getfiles"; - String ARG_HEALTHY= "--healthy"; String ARG_HELP = "--help"; - String ARG_HOSTNAME = "--hostname"; - String ARG_ID = "--id"; String ARG_IMAGE = "--image"; String ARG_INSTALL = "--install"; String ARG_INTERNAL = "--internal"; String ARG_KEYLEN = "--keylen"; String ARG_KEYTAB = "--keytab"; - String ARG_KEYSTORE = "--keystore"; String ARG_KEYTABINSTALL = ARG_INSTALL; String ARG_KEYTABDELETE = ARG_DELETE; String ARG_KEYTABLIST = "--list"; - String ARG_LABEL = "--label"; - String ARG_LEVEL = "--level"; String ARG_LIST = "--list"; String ARG_LISTCONF = "--listconf"; String ARG_LISTEXP = "--listexp"; @@ -87,8 +66,6 @@ public interface Arguments { String ARG_MANAGER = "--manager"; String ARG_MANAGER_SHORT = "--m"; String ARG_MESSAGE = "--message"; - String ARG_METAINFO = "--metainfo"; - String ARG_METAINFO_JSON = "--metainfojson"; String ARG_NAME = "--name"; String ARG_OPTION = "--option"; String ARG_OPTION_SHORT = "-O"; @@ -96,35 +73,23 @@ public interface Arguments { String ARG_OUTPUT_SHORT = "-o"; String ARG_OVERWRITE = "--overwrite"; String ARG_PACKAGE = "--package"; - String ARG_PASSWORD = "--password"; String ARG_PATH = "--path"; - String ARG_PKGDELETE = ARG_DELETE; - String ARG_PKGINSTANCES = "--instances"; - String ARG_PKGLIST = ARG_LIST; String ARG_PRINCIPAL = "--principal"; - String ARG_PROVIDER = "--provider"; String ARG_QUEUE = "--queue"; String ARG_LIFETIME = "--lifetime"; - String ARG_REPLACE_PKG = "--replacepkg"; String ARG_RESOURCE = "--resource"; String ARG_RESOURCE_MANAGER = "--rm"; String ARG_SECURE = "--secure"; String ARG_SERVICETYPE = "--servicetype"; String ARG_SERVICES = "--services"; - String ARG_SLIDER = "--slider"; String ARG_SOURCE = "--source"; String ARG_STATE = "--state"; String ARG_SYSPROP = "-S"; - String ARG_TRUSTSTORE = "--truststore"; String ARG_USER = "--user"; String ARG_UPLOAD = "--upload"; String ARG_VERBOSE = "--verbose"; String ARG_VERSION = "--version"; String ARG_WAIT = "--wait"; - String ARG_YARN = "--yarn"; - String ARG_ZKHOSTS = "--zkhosts"; - String ARG_ZKPATH = "--zkpath"; - String ARG_ZKPORT = "--zkport"; /* STOP: DO NOT ADD YOUR ARGUMENTS HERE. GO BACK AND INSERT THEM IN THE RIGHT PLACE IN THE LIST http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java index e85db58..7b957fa 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java @@ -20,78 +20,36 @@ package org.apache.hadoop.yarn.service.client.params; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.apache.hadoop.yarn.service.conf.SliderXmlConfKeys; -import org.apache.slider.common.params.AbstractClusterBuildingActionArgs; -import org.apache.slider.common.params.ActionAMSuicideArgs; -import org.apache.slider.common.params.ActionClientArgs; -import org.apache.slider.common.params.ActionDiagnosticArgs; -import org.apache.slider.common.params.ActionExistsArgs; -import org.apache.slider.common.params.ActionFreezeArgs; -import org.apache.slider.common.params.ActionHelpArgs; -import org.apache.slider.common.params.ActionKDiagArgs; -import org.apache.slider.common.params.ActionKeytabArgs; -import org.apache.slider.common.params.ActionKillContainerArgs; -import org.apache.slider.common.params.ActionListArgs; -import org.apache.slider.common.params.ActionLookupArgs; -import org.apache.slider.common.params.ActionNodesArgs; -import org.apache.slider.common.params.ActionRegistryArgs; -import org.apache.slider.common.params.ActionResolveArgs; -import org.apache.slider.common.params.ActionResourceArgs; -import org.apache.slider.common.params.ActionStatusArgs; -import org.apache.slider.common.params.ActionThawArgs; -import org.apache.slider.common.params.ActionTokensArgs; -import org.apache.slider.common.params.ActionUpdateArgs; -import org.apache.slider.common.params.ActionUpgradeArgs; -import org.apache.slider.common.params.ActionVersionArgs; -import org.apache.slider.common.tools.SliderUtils; -import org.apache.slider.core.exceptions.BadCommandArgumentsException; -import org.apache.slider.core.exceptions.ErrorStrings; -import org.apache.slider.core.exceptions.SliderException; +import org.apache.hadoop.yarn.service.conf.YarnServiceConf; +import org.apache.hadoop.yarn.service.utils.SliderUtils; +import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException; +import org.apache.hadoop.yarn.service.exceptions.ErrorStrings; +import org.apache.hadoop.yarn.service.exceptions.SliderException; import java.util.Collection; /** - * Slider Client CLI Args + * Client CLI Args */ public class ClientArgs extends CommonArgs { - /* - - All the arguments for specific actions - - */ - /** - * This is not bonded to jcommander, it is set up - * after the construction to point to the relevant - * entry - * - * KEEP IN ALPHABETICAL ORDER - */ - private AbstractClusterBuildingActionArgs buildingActionArgs; - // ========================================================= // Keep all of these in alphabetical order. Thanks. // ========================================================= - private final ActionAMSuicideArgs actionAMSuicideArgs = new ActionAMSuicideArgs(); private final ActionBuildArgs actionBuildArgs = new ActionBuildArgs(); private final ActionClientArgs actionClientArgs = new ActionClientArgs(); private final ActionCreateArgs actionCreateArgs = new ActionCreateArgs(); private final ActionDependencyArgs actionDependencyArgs = new ActionDependencyArgs(); private final ActionDestroyArgs actionDestroyArgs = new ActionDestroyArgs(); - private final ActionDiagnosticArgs actionDiagnosticArgs = new ActionDiagnosticArgs(); private final ActionExistsArgs actionExistsArgs = new ActionExistsArgs(); private final ActionFlexArgs actionFlexArgs = new ActionFlexArgs(); private final ActionFreezeArgs actionFreezeArgs = new ActionFreezeArgs(); private final ActionHelpArgs actionHelpArgs = new ActionHelpArgs(); private final ActionKDiagArgs actionKDiagArgs = new ActionKDiagArgs(); private final ActionKeytabArgs actionKeytabArgs = new ActionKeytabArgs(); - private final ActionKillContainerArgs actionKillContainerArgs = - new ActionKillContainerArgs(); private final ActionListArgs actionListArgs = new ActionListArgs(); - private final ActionLookupArgs actionLookupArgs = new ActionLookupArgs(); - private final ActionNodesArgs actionNodesArgs = new ActionNodesArgs(); private final ActionRegistryArgs actionRegistryArgs = new ActionRegistryArgs(); private final ActionResolveArgs actionResolveArgs = new ActionResolveArgs(); private final ActionResourceArgs actionResourceArgs = new ActionResourceArgs(); @@ -99,8 +57,6 @@ public class ClientArgs extends CommonArgs { private final ActionThawArgs actionThawArgs = new ActionThawArgs(); private final ActionTokensArgs actionTokenArgs = new ActionTokensArgs(); private final ActionUpdateArgs actionUpdateArgs = new ActionUpdateArgs(); - private final ActionUpgradeArgs actionUpgradeArgs = new ActionUpgradeArgs(); - private final ActionVersionArgs actionVersionArgs = new ActionVersionArgs(); public ClientArgs(String[] args) { super(args); @@ -114,32 +70,15 @@ public class ClientArgs extends CommonArgs { protected void addActionArguments() { addActions( - actionAMSuicideArgs, actionBuildArgs, - actionClientArgs, actionCreateArgs, actionDependencyArgs, actionDestroyArgs, - actionDiagnosticArgs, - actionExistsArgs, actionFlexArgs, actionFreezeArgs, actionHelpArgs, - actionKDiagArgs, - actionKeytabArgs, - actionKillContainerArgs, - actionListArgs, - actionLookupArgs, - actionNodesArgs, - actionRegistryArgs, - actionResolveArgs, - actionResourceArgs, actionStatusArgs, - actionThawArgs, - actionTokenArgs, - actionUpdateArgs, - actionUpgradeArgs, - actionVersionArgs + actionThawArgs ); } @@ -154,43 +93,20 @@ public class ClientArgs extends CommonArgs { } if (getBasePath() != null) { log.debug("Setting basePath to {}", getBasePath()); - conf.set(SliderXmlConfKeys.KEY_SLIDER_BASE_PATH, + conf.set(YarnServiceConf.YARN_SERVICE_BASE_PATH, getBasePath().toString()); } } - public ActionDiagnosticArgs getActionDiagnosticArgs() { - return actionDiagnosticArgs; - } - - public AbstractClusterBuildingActionArgs getBuildingActionArgs() { - return buildingActionArgs; - } - - public ActionAMSuicideArgs getActionAMSuicideArgs() { - return actionAMSuicideArgs; - } public ActionBuildArgs getActionBuildArgs() { return actionBuildArgs; } - public ActionClientArgs getActionClientArgs() { return actionClientArgs; } - - public ActionKDiagArgs getActionKDiagArgs() { - return actionKDiagArgs; - } - - public ActionKeytabArgs getActionKeytabArgs() { return actionKeytabArgs; } - public ActionUpdateArgs getActionUpdateArgs() { return actionUpdateArgs; } - public ActionUpgradeArgs getActionUpgradeArgs() { - return actionUpgradeArgs; - } - public ActionCreateArgs getActionCreateArgs() { return actionCreateArgs; } @@ -215,21 +131,10 @@ public class ClientArgs extends CommonArgs { return actionFreezeArgs; } - public ActionKillContainerArgs getActionKillContainerArgs() { - return actionKillContainerArgs; - } - public ActionListArgs getActionListArgs() { return actionListArgs; } - public ActionNodesArgs getActionNodesArgs() { - return actionNodesArgs; - } - - public ActionLookupArgs getActionLookupArgs() { - return actionLookupArgs; - } public ActionRegistryArgs getActionRegistryArgs() { return actionRegistryArgs; @@ -268,14 +173,10 @@ public class ClientArgs extends CommonArgs { switch (action) { case ACTION_BUILD: bindCoreAction(actionBuildArgs); - //its a builder, so set those actions too - buildingActionArgs = actionBuildArgs; break; case ACTION_CREATE: bindCoreAction(actionCreateArgs); - //its a builder, so set those actions too - buildingActionArgs = actionCreateArgs; break; case ACTION_STOP: @@ -286,14 +187,6 @@ public class ClientArgs extends CommonArgs { bindCoreAction(actionThawArgs); break; - case ACTION_AM_SUICIDE: - bindCoreAction(actionAMSuicideArgs); - break; - - case ACTION_CLIENT: - bindCoreAction(actionClientArgs); - break; - case ACTION_DEPENDENCY: bindCoreAction(actionDependencyArgs); break; @@ -302,10 +195,6 @@ public class ClientArgs extends CommonArgs { bindCoreAction(actionDestroyArgs); break; - case ACTION_DIAGNOSTICS: - bindCoreAction(actionDiagnosticArgs); - break; - case ACTION_EXISTS: bindCoreAction(actionExistsArgs); break; @@ -326,22 +215,10 @@ public class ClientArgs extends CommonArgs { bindCoreAction(actionKeytabArgs); break; - case ACTION_KILL_CONTAINER: - bindCoreAction(actionKillContainerArgs); - break; - case ACTION_LIST: bindCoreAction(actionListArgs); break; - case ACTION_LOOKUP: - bindCoreAction(actionLookupArgs); - break; - - case ACTION_NODES: - bindCoreAction(actionNodesArgs); - break; - case ACTION_REGISTRY: bindCoreAction(actionRegistryArgs); break; @@ -366,14 +243,6 @@ public class ClientArgs extends CommonArgs { bindCoreAction(actionUpdateArgs); break; - case ACTION_UPGRADE: - bindCoreAction(actionUpgradeArgs); - break; - - case ACTION_VERSION: - bindCoreAction(actionVersionArgs); - break; - default: throw new BadCommandArgumentsException(ErrorStrings.ERROR_UNKNOWN_ACTION + " " + action); http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java index 3160512..d44412a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java @@ -25,11 +25,11 @@ import com.beust.jcommander.ParameterException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; -import org.apache.slider.common.tools.SliderUtils; -import org.apache.slider.core.exceptions.BadCommandArgumentsException; -import org.apache.slider.core.exceptions.ErrorStrings; -import org.apache.slider.core.exceptions.SliderException; -import org.apache.slider.core.exceptions.UsageException; +import org.apache.hadoop.yarn.service.utils.SliderUtils; +import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException; +import org.apache.hadoop.yarn.service.exceptions.ErrorStrings; +import org.apache.hadoop.yarn.service.exceptions.SliderException; +import org.apache.hadoop.yarn.service.exceptions.UsageException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -112,7 +112,7 @@ public abstract class CommonArgs extends ArgOps implements SliderActions, if (commandOfInterest == null) { // JCommander.usage is too verbose for a command with many options like // slider no short version of that is found Instead, we compose our msg by - helperMessage.append("\nUsage: slider COMMAND [options]\n"); + helperMessage.append("\nUsage: service COMMAND [options]\n"); helperMessage.append("where COMMAND is one of\n"); for (String jcommand : serviceArgs.commander.getCommands().keySet()) { helperMessage.append(String.format("\t%-" @@ -123,7 +123,7 @@ public abstract class CommonArgs extends ArgOps implements SliderActions, .append("Most commands print help when invoked without parameters or with --help"); result = helperMessage.toString(); } else { - helperMessage.append("\nUsage: slider ").append(commandOfInterest); + helperMessage.append("\nUsage: service ").append(commandOfInterest); helperMessage.append(serviceArgs.coreAction.getMinParams() > 0 ? " <application>" : ""); helperMessage.append("\n"); for (ParameterDescription paramDesc : serviceArgs.commander.getCommands() @@ -224,14 +224,6 @@ public abstract class CommonArgs extends ArgOps implements SliderActions, } /** - * Get the core action -type depends on the action - * @return the action class - */ - public AbstractActionArgs getCoreAction() { - return coreAction; - } - - /** * Validate the arguments against the action requested */ public void validate() throws BadCommandArgumentsException, UsageException { @@ -244,7 +236,8 @@ public abstract class CommonArgs extends ArgOps implements SliderActions, coreAction.validate(); } catch (BadCommandArgumentsException e) { String badArgMsgBuilder = - e.toString() + "\n" + usage(this, coreAction.getActionName()); + e.getMessage() + System.lineSeparator() + usage(this, + coreAction.getActionName()); throw new BadCommandArgumentsException(badArgMsgBuilder); } } @@ -286,9 +279,4 @@ public abstract class CommonArgs extends ArgOps implements SliderActions, public String getAction() { return commander.getParsedCommand(); } - - public List<String> getActionArgs() { - return coreAction.parameters; - } - } http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java index 0bdf58e..b6cd0a1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java @@ -19,9 +19,7 @@ package org.apache.hadoop.yarn.service.client.params; import com.beust.jcommander.Parameter; -import org.apache.slider.common.params.AbstractArgsDelegate; -import org.apache.slider.common.params.DontSplitArguments; -import org.apache.slider.core.exceptions.BadCommandArgumentsException; +import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException; import java.util.ArrayList; import java.util.List; http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java new file mode 100644 index 0000000..85de615 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +import com.beust.jcommander.converters.IParameterSplitter; + +import java.util.ArrayList; +import java.util.List; + +public class DontSplitArguments implements IParameterSplitter { + + @Override + public List<String> split(String value) { + List<String> list = new ArrayList<>(1); + list.add(value); + return list; + } +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java new file mode 100644 index 0000000..bf194b6 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +import java.io.File; + +/** + * Launch args for create and start and anything else that can start something + */ +public interface LaunchArgsAccessor extends WaitTimeAccessor { + String getRmAddress(); + + File getOutputFile(); +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java new file mode 100644 index 0000000..157fb61 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +import com.beust.jcommander.Parameter; + +import java.io.File; + +/** + * Any launch-time args + */ +public class LaunchArgsDelegate extends WaitArgsDelegate implements + LaunchArgsAccessor { + + + //TODO: do we need this? + @Parameter(names = ARG_RESOURCE_MANAGER, + description = "Resource manager hostname:port ", + required = false) + private String rmAddress; + + @Override + public String getRmAddress() { + return rmAddress; + } + + @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT}, + description = "output file for any application report") + public File outputFile; + + @Override + public File getOutputFile() { + return outputFile; + } +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java new file mode 100644 index 0000000..7972716 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +import com.beust.jcommander.Parameter; +import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Delegate for application and resource options. + */ +public class OptionArgsDelegate extends AbstractArgsDelegate { + + /** + * Options key value. + */ + @Parameter(names = {ARG_OPTION, ARG_OPTION_SHORT}, arity = 2, + description = ARG_OPTION + "<name> <value>", + splitter = DontSplitArguments.class) + public List<String> optionTuples = new ArrayList<>(0); + + + /** + * All the app component option triples. + */ + @Parameter(names = {ARG_COMP_OPT, ARG_COMP_OPT_SHORT}, arity = 3, + description = "Component option " + ARG_COMP_OPT + + " <component> <name> <option>", + splitter = DontSplitArguments.class) + public List<String> compOptTriples = new ArrayList<>(0); + + public Map<String, String> getOptionsMap() throws + BadCommandArgumentsException { + return convertTupleListToMap(ARG_OPTION, optionTuples); + } + + /** + * Get the role heap mapping (may be empty, but never null). + * @return role heap mapping + * @throws BadCommandArgumentsException parse problem + */ + public Map<String, Map<String, String>> getCompOptionMap() + throws BadCommandArgumentsException { + return convertTripleListToMaps(ARG_COMP_OPT, compOptTriples); + } + +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java new file mode 100644 index 0000000..040ac64 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +import com.beust.jcommander.converters.BaseConverter; +import org.apache.hadoop.fs.Path; + +public class PathArgumentConverter extends BaseConverter<Path> { + + public PathArgumentConverter(String optionName) { + super(optionName); + } + + @Override + public Path convert(String value) { + return new Path(value); + } +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java index 1853229..a446665 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java @@ -21,10 +21,6 @@ package org.apache.hadoop.yarn.service.client.params; import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameters; import com.beust.jcommander.ParametersDelegate; -import org.apache.hadoop.yarn.service.client.params.AbstractActionArgs; -import org.apache.hadoop.yarn.service.client.params.SliderActions; -import org.apache.slider.common.params.LaunchArgsAccessor; -import org.apache.slider.common.params.LaunchArgsDelegate; import java.io.File; http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java index 3ea6f67..fc3c5a1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java @@ -24,16 +24,13 @@ package org.apache.hadoop.yarn.service.client.params; * are listed here to ensure the names are consistent */ public interface SliderActions { - String ACTION_AM_SUICIDE = "am-suicide"; String ACTION_BUILD = "build"; String ACTION_CLIENT = "client"; String ACTION_CREATE = "create"; - String ACTION_DIAGNOSTICS = "diagnostics"; String ACTION_DEPENDENCY = "dependency"; String ACTION_UPDATE = "update"; String ACTION_UPGRADE = "upgrade"; String ACTION_DESTROY = "destroy"; - String ACTION_ECHO = "echo"; String ACTION_EXISTS = "exists"; String ACTION_FLEX = "flex"; String ACTION_STOP = "stop"; @@ -41,12 +38,8 @@ public interface SliderActions { String ACTION_INSTALL_KEYTAB = "install-keytab"; String ACTION_KDIAG = "kdiag"; String ACTION_KEYTAB = "keytab"; - String ACTION_KILL_CONTAINER = "kill-container"; String ACTION_LIST = "list"; - String ACTION_LOOKUP = "lookup"; - String ACTION_NODES = "nodes"; - String ACTION_PREFLIGHT = "preflight"; - String ACTION_RECONFIGURE = "reconfigure"; + String ACTION_REGISTRY = "registry"; String ACTION_RESOLVE = "resolve"; String ACTION_RESOURCE = "resource"; @@ -54,52 +47,35 @@ public interface SliderActions { String ACTION_START = "start"; String ACTION_TOKENS = "tokens"; - String ACTION_VERSION = "version"; - String DESCRIBE_ACTION_AM_SUICIDE = - "Tell the Slider Application Master to simulate a process failure by terminating itself"; String DESCRIBE_ACTION_BUILD = - "Build a Slider cluster specification, but do not start it"; + "Build a service specification, but do not start it"; String DESCRIBE_ACTION_CREATE = - "Create a live Slider application"; + "Build and start a service, it's equivalent to first invoke build and then start"; String DESCRIBE_ACTION_DEPENDENCY = - "Slider AM and agent dependency (libraries) management"; + "Yarn service framework dependency (libraries) management"; String DESCRIBE_ACTION_UPDATE = - "Update template for a Slider application"; + "Update template for service"; String DESCRIBE_ACTION_UPGRADE = "Rolling upgrade/downgrade the component/containerto a newer/previous version"; String DESCRIBE_ACTION_DESTROY = - "Destroy a stopped Slider application"; + "Destroy a stopped service, service must be stopped first before destroying."; String DESCRIBE_ACTION_EXISTS = "Probe for an application running"; - String DESCRIBE_ACTION_FLEX = "Flex a Slider application"; + String DESCRIBE_ACTION_FLEX = "Flex a service's component by increasing or decreasing the number of containers."; String DESCRIBE_ACTION_FREEZE = - "Stop a running application"; - String DESCRIBE_ACTION_GETCONF = - "Get the configuration of an application"; + "Stop a running service"; String DESCRIBE_ACTION_KDIAG = "Diagnose Kerberos problems"; - String DESCRIBE_ACTION_KILL_CONTAINER = - "Kill a container in the application"; String DESCRIBE_ACTION_HELP = "Print help information"; String DESCRIBE_ACTION_LIST = - "List running Slider applications"; - String DESCRIBE_ACTION_LOOKUP = - "look up a YARN application"; - String DESCRIBE_ACTION_NODES = "List the node information for the YARN cluster or a running application"; - String DESCRIBE_ACTION_MONITOR = - "Monitor a running application"; + "List running services"; String DESCRIBE_ACTION_REGISTRY = - "Query the registry of a YARN application"; - String DESCRIBE_ACTION_RESOLVE = - "Resolve or list records in the YARN registry"; + "Query the registry of a service"; String DESCRIBE_ACTION_STATUS = - "Get the status of an application"; + "Get the status of a service"; String DESCRIBE_ACTION_THAW = - "Start a stopped application"; - String DESCRIBE_ACTION_VERSION = - "Print the Slider version information"; + "Start a service with pre-built specification or a previously stopped service"; String DESCRIBE_ACTION_CLIENT = "Install the application client in the specified directory or obtain a client keystore or truststore"; String DESCRIBE_ACTION_KEYTAB = "Manage a Kerberos keytab file (install, delete, list) in the sub-folder 'keytabs' of the user's Slider base directory"; - String DESCRIBE_ACTION_DIAGNOSTIC = "Diagnose the configuration of the running slider application and slider client"; String DESCRIBE_ACTION_RESOURCE = "Manage a file (install, delete, list) in the 'resources' sub-folder of the user's Slider base directory"; } http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java new file mode 100644 index 0000000..86f3709 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +import com.beust.jcommander.Parameter; + +public class WaitArgsDelegate extends AbstractArgsDelegate implements + WaitTimeAccessor { + + + //--wait [timeout] + @Parameter(names = {ARG_WAIT}, + description = "time to wait for an action to complete") + public int waittime = 0; + + + @Override + public int getWaittime() { + return waittime; + } + + @Override + public void setWaittime(int waittime) { + this.waittime = waittime; + } +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java new file mode 100644 index 0000000..f6afae6 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.client.params; + +public interface WaitTimeAccessor { + int getWaittime(); + void setWaittime(int waittime); +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java index dcb455f..982a114 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java @@ -36,17 +36,17 @@ import org.apache.hadoop.yarn.event.EventHandler; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.service.ServiceScheduler; +import org.apache.hadoop.yarn.service.api.records.ContainerState; import org.apache.hadoop.yarn.service.component.Component; import org.apache.hadoop.yarn.state.InvalidStateTransitionException; import org.apache.hadoop.yarn.state.SingleArcTransition; import org.apache.hadoop.yarn.state.StateMachine; import org.apache.hadoop.yarn.state.StateMachineFactory; import org.apache.hadoop.yarn.util.BoundedAppender; -import org.apache.slider.api.resource.ContainerState; -import org.apache.slider.common.tools.SliderUtils; +import org.apache.hadoop.yarn.service.utils.SliderUtils; import org.apache.hadoop.yarn.service.timelineservice.ServiceTimelinePublisher; -import org.apache.slider.server.servicemonitor.ProbeStatus; -import org.apache.slider.server.services.yarnregistry.YarnRegistryViewForProviders; +import org.apache.hadoop.yarn.service.servicemonitor.probe.ProbeStatus; +import org.apache.hadoop.yarn.service.registry.YarnRegistryViewForProviders; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -88,7 +88,7 @@ public class ComponentInstance implements EventHandler<ComponentInstanceEvent>, private volatile ContainerStatus status; private long containerStartedTime = 0; // This container object is used for rest API query - private org.apache.slider.api.resource.Container containerSpec; + private org.apache.hadoop.yarn.service.api.records.Container containerSpec; private static final StateMachineFactory<ComponentInstance, ComponentInstanceState, ComponentInstanceEventType, ComponentInstanceEvent> @@ -142,11 +142,11 @@ public class ComponentInstance implements EventHandler<ComponentInstanceEvent>, compInstance.getContainerId(), compInstance), 0, 1, TimeUnit.SECONDS); - org.apache.slider.api.resource.Container container = - new org.apache.slider.api.resource.Container(); + org.apache.hadoop.yarn.service.api.records.Container container = + new org.apache.hadoop.yarn.service.api.records.Container(); container.setId(compInstance.getContainerId().toString()); container.setLaunchTime(new Date()); - container.setState(org.apache.slider.api.resource.ContainerState.RUNNING_BUT_UNREADY); + container.setState(ContainerState.RUNNING_BUT_UNREADY); container.setBareHost(compInstance.container.getNodeId().getHost()); container.setComponentName(compInstance.getCompInstanceName()); if (compInstance.containerSpec != null) { @@ -290,7 +290,7 @@ public class ComponentInstance implements EventHandler<ComponentInstanceEvent>, public void updateContainerStatus(ContainerStatus status) { this.status = status; - org.apache.slider.api.resource.Container container = + org.apache.hadoop.yarn.service.api.records.Container container = getCompSpec().getContainer(getContainerId().toString()); if (container != null) { container.setIp(StringUtils.join(",", status.getIPs())); @@ -330,7 +330,7 @@ public class ComponentInstance implements EventHandler<ComponentInstanceEvent>, return this.container.getNodeId(); } - public org.apache.slider.api.resource.Component getCompSpec() { + public org.apache.hadoop.yarn.service.api.records.Component getCompSpec() { return component.getComponentSpec(); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java index bfe40c0..331871a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java @@ -39,9 +39,9 @@ import org.apache.hadoop.yarn.state.SingleArcTransition; import org.apache.hadoop.yarn.state.StateMachine; import org.apache.hadoop.yarn.state.StateMachineFactory; import org.apache.hadoop.yarn.util.Apps; -import org.apache.slider.common.tools.SliderUtils; -import org.apache.slider.server.servicemonitor.MonitorUtils; -import org.apache.slider.server.servicemonitor.Probe; +import org.apache.hadoop.yarn.service.utils.SliderUtils; +import org.apache.hadoop.yarn.service.servicemonitor.probe.MonitorUtils; +import org.apache.hadoop.yarn.service.servicemonitor.probe.Probe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,12 +61,12 @@ import static org.apache.hadoop.yarn.service.component.ComponentEventType.*; import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType.STARTED; import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType.STOP; import static org.apache.hadoop.yarn.service.component.ComponentState.*; -import static org.apache.slider.api.ResourceKeys.CONTAINER_FAILURE_THRESHOLD; +import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.CONTAINER_FAILURE_THRESHOLD; public class Component implements EventHandler<ComponentEvent> { private static final Logger LOG = LoggerFactory.getLogger(Component.class); - private org.apache.slider.api.resource.Component componentSpec; + private org.apache.hadoop.yarn.service.api.records.Component componentSpec; private long allocateId; private Priority priority; private ServiceMetrics componentMetrics; @@ -124,7 +124,8 @@ public class Component implements EventHandler<ComponentEvent> { FLEX, new FlexComponentTransition()) .installTopology(); - public Component(org.apache.slider.api.resource.Component component, + public Component( + org.apache.hadoop.yarn.service.api.records.Component component, long allocateId, ServiceContext context) { this.allocateId = allocateId; this.priority = Priority.newInstance((int) allocateId); @@ -418,7 +419,7 @@ public class Component implements EventHandler<ComponentEvent> { return compInstances; } - public org.apache.slider.api.resource.Component getComponentSpec() { + public org.apache.hadoop.yarn.service.api.records.Component getComponentSpec() { return this.componentSpec; } http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java new file mode 100644 index 0000000..cbbb206 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.conf; + +public interface RestApiConstants { + + // Rest endpoints + String CONTEXT_ROOT = "/services/v1"; + String VERSION = "/version"; + String APP_ROOT_PATH = "/applications"; + String APP_PATH = "/applications/{app_name}"; + String COMPONENT_PATH = "/applications/{app_name}/components/{component_name}"; + + // Query param + String APP_NAME = "app_name"; + String COMPONENT_NAME = "component_name"; + + String DEFAULT_COMPONENT_NAME = "default"; + + String PROPERTY_REST_SERVICE_HOST = "REST_SERVICE_HOST"; + String PROPERTY_REST_SERVICE_PORT = "REST_SERVICE_PORT"; + Long DEFAULT_UNLIMITED_LIFETIME = -1l; + + Integer ERROR_CODE_APP_DOES_NOT_EXIST = 404001; + Integer ERROR_CODE_APP_IS_NOT_RUNNING = 404002; + Integer ERROR_CODE_APP_SUBMITTED_BUT_NOT_RUNNING_YET = 404003; + Integer ERROR_CODE_APP_NAME_INVALID = 404004; +} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java index d63c1a4..bdef600 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java @@ -18,7 +18,7 @@ package org.apache.hadoop.yarn.service.conf; -import org.apache.slider.core.main.LauncherExitCodes; +import org.apache.hadoop.yarn.service.exceptions.LauncherExitCodes; public interface SliderExitCodes extends LauncherExitCodes { http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderKeys.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderKeys.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderKeys.java deleted file mode 100644 index e1687d2..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderKeys.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.service.conf; - -/** - * Keys and various constants for Slider - */ -public interface SliderKeys extends SliderXmlConfKeys { - - /** - * This is the name of the slider appmaster in configurations :{@value} - */ - String COMPONENT_AM = "slider-appmaster"; - - /** - * Slider role is "special":{@value} - */ - int ROLE_AM_PRIORITY_INDEX = 0; - - - /** - * The path under which cluster and temp data are stored - * {@value} - */ - String SLIDER_BASE_DIRECTORY = ".slider"; - - /** - * The paths under which Slider AM dependency libraries are stored - */ - String SLIDER_DEPENDENCY_LOCALIZED_DIR_LINK = "slider_dep"; - String SLIDER_DEPENDENCY_HDP_PARENT_DIR = "/hdp"; - String SLIDER_DEPENDENCY_DIR = "/apps/%s/slider"; - String SLIDER_DEPENDENCY_TAR_GZ_FILE_NAME = "slider-dep"; - String SLIDER_DEPENDENCY_TAR_GZ_FILE_EXT = ".tar.gz"; - String SLIDER_DEPENDENCY_DIR_PERMISSIONS = "755"; - - /** - * - */ - String HDP_VERSION_PROP_NAME = "HDP_VERSION"; - - /** - * name of the relative path to expaned an image into: {@value}. - * The title of this path is to help people understand it when - * they see it in their error messages - */ - String LOCAL_TARBALL_INSTALL_SUBDIR = "expandedarchive"; - - - /** - * Application type for YARN {@value} - */ - String APP_TYPE = "org-apache-slider"; - - /** - * A component type for an external app that has been predefined using the - * slider build command - */ - String COMPONENT_SEPARATOR = "-"; - - /** - * A component type for a client component - */ - String COMPONENT_TYPE_CLIENT = "client"; - - /** - * Key for application version. - */ - String APP_VERSION_UNKNOWN = "awaiting heartbeat..."; - - /** - * Keys for application container specific properties, like release timeout - */ - String APP_CONTAINER_RELEASE_TIMEOUT = "site.global.app_container.release_timeout_secs"; - - /** - * Subdirectories of HDFS cluster dir. - */ - String DATA_DIR_NAME = "data"; - String HISTORY_DIR_NAME = "history"; - String HISTORY_FILENAME_SUFFIX = "json"; - String HISTORY_FILENAME_PREFIX = "rolehistory-"; - String KEYTAB_DIR = "keytabs"; - String RESOURCE_DIR = "resources"; - - /** - * Filename pattern is required to save in strict temporal order. - * Important: older files must sort less-than newer files when using - * case-sensitive name sort. - */ - String HISTORY_FILENAME_CREATION_PATTERN = HISTORY_FILENAME_PREFIX +"%016x."+ - HISTORY_FILENAME_SUFFIX; - /** - * The posix regexp used to locate this - */ - String HISTORY_FILENAME_MATCH_PATTERN = HISTORY_FILENAME_PREFIX +"[0-9a-f]+\\."+ - HISTORY_FILENAME_SUFFIX; - /** - * The posix regexp used to locate this - */ - String HISTORY_FILENAME_GLOB_PATTERN = HISTORY_FILENAME_PREFIX +"*."+ - HISTORY_FILENAME_SUFFIX; - - String CLUSTER_DIRECTORY = "cluster"; - - /** - * JVM property to define the slider lib directory; - * this is set by the slider script: {@value} - */ - String PROPERTY_LIB_DIR = "slider.libdir"; - - /** - * name of generated dir for this conf: {@value} - */ - String SUBMITTED_CONF_DIR = "conf"; - - /** - * Slider AM log4j file name : {@value} - */ - String LOG4J_SERVER_PROP_FILENAME = "slideram-log4j.properties"; - - /** - * Log4j sysprop to name the resource :{@value} - */ - String SYSPROP_LOG4J_CONFIGURATION = "log4j.configuration"; - - /** - * sysprop for Slider AM log4j directory :{@value} - */ - String SYSPROP_LOG_DIR = "LOG_DIR"; - - /** - * name of the Slider client resource - * loaded when the service is loaded. - */ - String SLIDER_CLIENT_XML = "slider-client.xml"; - - /** - * The name of the resource to put on the classpath - */ - String SLIDER_SERVER_XML = "slider-server.xml"; - - String TMP_DIR_PREFIX = "tmp"; - - /** - * Store the default app definition, e.g. metainfo file or content of a folder - */ - String APP_DEF_DIR = "appdef"; - /** - * Store additional app defs - co-processors - */ - String ADDONS_DIR = "addons"; - - String SLIDER_JAR = "slider-core.jar"; - - String STDOUT_AM = "slider-out.txt"; - String STDERR_AM = "slider-err.txt"; - - String HADOOP_USER_NAME = "HADOOP_USER_NAME"; - - /** - * Name of the AM filter to use: {@value} - */ - String AM_FILTER_NAME = - "org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer"; - - String YARN_CONTAINER_PATH = "/node/container/"; - - String APP_CONF_DIR = "conf"; - - String APP_LIB_DIR = "lib"; - - String OUT_FILE = "stdout.txt"; - String ERR_FILE = "stderr.txt"; - - String QUICK_LINKS = "quicklinks"; - - String KEY_CONTAINER_LAUNCH_DELAY = "container.launch.delay.sec"; -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderXmlConfKeys.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderXmlConfKeys.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderXmlConfKeys.java deleted file mode 100644 index 523e08d..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderXmlConfKeys.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.service.conf; - -/** - * These are the keys that can be added to <code>conf/slider-client.xml</code>. - */ -public interface SliderXmlConfKeys { - String PREFIX_PROVIDER = "slider.provider"; - /** - * pattern to identify a provider - * {@value} - */ - String KEY_PROVIDER = PREFIX_PROVIDER + ".%s"; - - /** - * conf option set to point to where the config came from - * {@value} - */ - String KEY_TEMPLATE_ORIGIN = "slider.template.origin"; - - /** - * Original name for the default FS. This is still - * expected by applications deployed - */ - String FS_DEFAULT_NAME_CLASSIC = "fs.default.name"; - - /** - * Slider principal - */ - String KEY_KERBEROS_PRINCIPAL = "slider.kerberos.principal"; - - /** - * Name of the property for ACLs for Slider AM. - * {@value} - */ - String KEY_PROTOCOL_ACL = "slider.security.protocol.acl"; - - /** - * Limit on restarts for the AM - * {@value} - */ - String KEY_AM_RESTART_LIMIT = "slider.yarn.restart.limit"; - - /** - * queue name, by default let YARN pick the queue - */ - String KEY_YARN_QUEUE = "slider.yarn.queue"; - String DEFAULT_YARN_QUEUE = null; - - /** - * default priority - */ - String KEY_YARN_QUEUE_PRIORITY = "slider.yarn.queue.priority"; - int DEFAULT_YARN_QUEUE_PRIORITY = 1; - - - String KEY_AM_RESOURCE_MEM = "slider.am.resource.memory"; - long DEFAULT_KEY_AM_RESOURCE_MEM = 1024; - - /** - * The slider base path: {@value} - * Defaults to HomeDir/.slider - */ - String KEY_SLIDER_BASE_PATH = "slider.base.path"; - - - /** - * Option for the permissions for the cluster directory itself: {@value} - */ - String CLUSTER_DIRECTORY_PERMISSIONS = - "slider.cluster.directory.permissions"; - - /** - * Default value for the permissions :{@value} - */ - String DEFAULT_CLUSTER_DIRECTORY_PERMISSIONS = "750"; - - /** - * - * Option for the permissions for the data directory itself: {@value} - */ - String DATA_DIRECTORY_PERMISSIONS = "slider.data.directory.permissions"; - - /** - * Default value for the data directory permissions: {@value} - */ - String DEFAULT_DATA_DIRECTORY_PERMISSIONS = "750"; - - String IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH = - "ipc.client.fallback-to-simple-auth-allowed"; - String HADOOP_HTTP_FILTER_INITIALIZERS = - "hadoop.http.filter.initializers"; - String KEY_KEYSTORE_LOCATION = "ssl.server.keystore.location"; - String KEY_AM_LOGIN_KEYTAB_NAME = "slider.am.login.keytab.name"; - /** Declare that a keytab must be provided */ - String KEY_AM_LOGIN_KEYTAB_REQUIRED = "slider.am.login.keytab.required"; - String KEY_HDFS_KEYTAB_DIR = "slider.hdfs.keytab.dir"; - String KEY_AM_KEYTAB_LOCAL_PATH = "slider.am.keytab.local.path"; - String KEY_KEYTAB_PRINCIPAL = "slider.keytab.principal.name"; - String KEY_SECURITY_ENABLED = "site.global.security_enabled"; - - /** - * Set to disable server-side checks for python, openssl &c. - * This should only be set for testing - */ - String KEY_SLIDER_AM_DEPENDENCY_CHECKS_DISABLED = - "slider.am.dependency.checks.disabled"; - - /** - * The path to the python executable utilized to launch the agent. - */ - String PYTHON_EXECUTABLE_PATH = "agent.python.exec.path"; - - /** - * Flag to enable the insecure AM filter: {@value} - */ - String X_DEV_INSECURE_WS = "slider.feature.ws.insecure"; - - /** - * Flag to indicate the insecure AM filter is enabled by default: {@value}. - */ - boolean X_DEV_INSECURE_DEFAULT = false; - - - /** - * Flag to indicate the insecure AM filter is required for - * complex REST Verbs: {@value}. - * When Slider switches to being Hadoop 2.7+ only, this flag - * can be set to false - */ - boolean X_DEV_INSECURE_REQUIRED = true; - - /** - * - */ - String KEY_IPC_CLIENT_RETRY_POLICY_ENABLED = - "slider.ipc.client.retry.enabled"; - boolean IPC_CLIENT_RETRY_POLICY_ENABLED_DEFAULT = true; - String KEY_IPC_CLIENT_RETRY_POLICY_SPEC = - "slider.ipc.client.retry.policy.spec"; - String IPC_CLIENT_RETRY_POLICY_SPEC_DEFAULT = - "10000,6,60000,10"; //t1,n1,t2,n2,... - - String KEY_AM_LAUNCH_ENV = "slider.am.launch.env"; - - /** - * From {@code DFSConfigKeys.DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY} - */ - String DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY = "dfs.namenode.kerberos.principal"; - - String DFS_DATANODE_KERBEROS_PRINCIPAL_KEY = "dfs.datanode.kerberos.principal"; - - //Delegation token related keys - String DFS_NAMENODE_DELEGATION_KEY_UPDATE_INTERVAL_KEY - = "dfs.namenode.delegation.key.update-interval"; - long DFS_NAMENODE_DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT = 24 * 60 * 60 * - 1000; // 1 day - String DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_KEY - = "dfs.namenode.delegation.token.renew-interval"; - long DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT = 24 * 60 * 60 * - 1000; // 1 day - String DFS_NAMENODE_DELEGATION_TOKEN_MAX_LIFETIME_KEY - = "dfs.namenode.delegation.token.max-lifetime"; - long DFS_NAMENODE_DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT = 7 * 24 * 60 * 60 * - 1000; // 7 days - String DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_KEY - = "dfs.namenode.delegation.token.always-use"; // for tests - boolean DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_DEFAULT = false; - String DFS_NAMENODE_KEYTAB_FILE_KEY = "dfs.namenode.keytab.file"; - String DFS_NAMENODE_DU_RESERVED_KEY = "dfs.namenode.resource.du.reserved"; - - String MAPREDUCE_JOB_CREDENTIALS_BINARY = "mapreduce.job.credentials.binary"; - -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java index 9225570..33fc671 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java @@ -18,7 +18,7 @@ package org.apache.hadoop.yarn.service.conf; -import org.apache.slider.api.resource.Configuration; +import org.apache.hadoop.yarn.service.api.records.Configuration; public class YarnServiceConf { @@ -30,8 +30,54 @@ public class YarnServiceConf { public static final String CONTAINER_RETRY_MAX = "yarn.service.container-failure.retry.max"; public static final String CONTAINER_RETRY_INTERVAL = "yarn.service.container-failure.retry-interval"; + public static final String AM_RESTART_MAX = "yarn.service.am-restart.max-attempts"; + public static final String AM_RESOURCE_MEM = "yarn.service.am-resource.memory"; + public static final long DEFAULT_KEY_AM_RESOURCE_MEM = 1024; + + public static final String YARN_QUEUE = "yarn.service.queue"; + + /** + * The yarn service base path: + * Defaults to HomeDir/.yarn/ + */ + public static final String YARN_SERVICE_BASE_PATH = "yarn.service.base.path"; + + //TODO rename + /** Declare that a keytab must be provided */ + public static final String KEY_AM_LOGIN_KEYTAB_REQUIRED = "slider.am.login.keytab.required"; + public static final String KEY_AM_LOGIN_KEYTAB_NAME = "slider.am.login.keytab.name"; + public static final String KEY_HDFS_KEYTAB_DIR = "slider.hdfs.keytab.dir"; + public static final String KEY_AM_KEYTAB_LOCAL_PATH = "slider.am.keytab.local.path"; + + /** + * maximum number of failed containers (in a single component) + * before the app exits + */ + public static final String CONTAINER_FAILURE_THRESHOLD = + "yarn.service.container-failure-per-component.threshold"; + /** + * Maximum number of container failures on a node before the node is blacklisted + */ + public static final String NODE_BLACKLIST_THRESHOLD = + "yarn.service.node-blacklist.threshold"; + + /** + * The failure count for CONTAINER_FAILURE_THRESHOLD and NODE_BLACKLIST_THRESHOLD + * gets reset periodically, the unit is seconds. + */ + public static final String CONTAINER_FAILURE_WINDOW = + "yarn.service.failure-count-reset.window"; + + /** + * interval between readiness checks. + */ + public static final String READINESS_CHECK_INTERVAL = "yarn.service.readiness-check-interval.seconds"; + public static final int DEFAULT_READINESS_CHECK_INTERVAL = 30; // seconds + /** - * Get long value for the property + * Get long value for the property. First get from the userConf, if not + * present, get from systemConf. + * * @param name name of the property * @param defaultValue default value of the property, if it is not defined in * userConf and systemConf. http://git-wip-us.apache.org/repos/asf/hadoop/blob/394183c7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java new file mode 100644 index 0000000..cbcba82 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.service.conf; + +public interface YarnServiceConstants { + + /** + * The path under which cluster and temp data are stored + */ + String SERVICE_BASE_DIRECTORY = ".yarn"; + + /** + * The paths under which Service AM dependency libraries are stored + */ + String DEPENDENCY_LOCALIZED_DIR_LINK = "service_dep"; + String DEPENDENCY_DIR = "/yarn-services/%s/"; + String DEPENDENCY_TAR_GZ_FILE_NAME = "service-dep"; + String DEPENDENCY_TAR_GZ_FILE_EXT = ".tar.gz"; + String DEPENDENCY_DIR_PERMISSIONS = "755"; + + /** + * Application type for YARN service + */ + String APP_TYPE = "yarn-service"; + + String KEYTAB_DIR = "keytabs"; + String RESOURCE_DIR = "resources"; + + + String SERVICES_DIRECTORY = "services"; + + /** + * JVM property to define the service lib directory; + * this is set by the yarn.sh script + */ + String PROPERTY_LIB_DIR = "service.libdir"; + + /** + * name of generated dir for this conf + */ + String SUBMITTED_CONF_DIR = "conf"; + + /** + * Service AM log4j file name + */ + String YARN_SERVICE_LOG4J_FILENAME = "yarnservice-log4j.properties"; + + /** + * Log4j sysprop to name the resource + */ + String SYSPROP_LOG4J_CONFIGURATION = "log4j.configuration"; + + /** + * sysprop for Service AM log4j directory + */ + String SYSPROP_LOG_DIR = "LOG_DIR"; + + String TMP_DIR_PREFIX = "tmp"; + + + String SERVICE_CORE_JAR = "yarn-service-core.jar"; + + String STDOUT_AM = "serviceam-out.txt"; + String STDERR_AM = "serviceam-err.txt"; + + String HADOOP_USER_NAME = "HADOOP_USER_NAME"; + + String APP_CONF_DIR = "conf"; + + String APP_LIB_DIR = "lib"; + + String OUT_FILE = "stdout.txt"; + String ERR_FILE = "stderr.txt"; +} --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org