You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by go...@apache.org on 2016/08/25 20:20:06 UTC
[37/46] incubator-slider git commit: SLIDER-1165 Create
yarn-native-services branch on Slider corresponding to the
yarn-native-services branch on Hadoop
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java b/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java
deleted file mode 100644
index 120b1fc..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java
+++ /dev/null
@@ -1,291 +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.slider.common;
-
-
-/**
- * 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";
- 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";
-
- /**
- * Key for component type. This MUST NOT be set in app_config/global {@value}
- */
- String COMPONENT_TYPE_KEY = "site.global.component_type";
- /**
- * A component type for an external app that has been predefined using the
- * slider build command
- */
- String COMPONENT_TYPE_EXTERNAL_APP = "external_app";
- String COMPONENT_SEPARATOR = "-";
- String[] COMPONENT_KEYS_TO_SKIP = {"zookeeper.", "env.MALLOC_ARENA_MAX",
- "site.fs.", "site.dfs."};
-
- /**
- * Key for application version. This must be set in app_config/global {@value}
- */
- String APP_VERSION = "site.global.app_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";
- int APP_CONTAINER_HEARTBEAT_INTERVAL_SEC = 10; // look for HEARTBEAT_IDDLE_INTERVAL_SEC
-
- /**
- * JVM arg to force IPv4 {@value}
- */
- String JVM_ENABLE_ASSERTIONS = "-ea";
-
- /**
- * JVM arg enable JVM system/runtime {@value}
- */
- String JVM_ENABLE_SYSTEM_ASSERTIONS = "-esa";
-
- /**
- * JVM arg to force IPv4 {@value}
- */
- String JVM_FORCE_IPV4 = "-Djava.net.preferIPv4Stack=true";
-
- /**
- * JVM arg to go headless {@value}
- */
-
- String JVM_JAVA_HEADLESS = "-Djava.awt.headless=true";
-
- /**
- * This is the name of the dir/subdir containing
- * the hbase conf that is propagated via YARN
- * {@value}
- */
- String PROPAGATED_CONF_DIR_NAME = "propagatedconf";
- String INFRA_DIR_NAME = "infra";
- String GENERATED_CONF_DIR_NAME = "generated";
- String SNAPSHOT_CONF_DIR_NAME = "snapshot";
- String DATA_DIR_NAME = "database";
- 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;
- /**
- * XML resource listing the standard Slider providers
- * {@value}
- */
- String SLIDER_XML = "org/apache/slider/slider.xml";
-
- String CLUSTER_DIRECTORY = "cluster";
-
- String PACKAGE_DIRECTORY = "package";
-
- /**
- * JVM property to define the slider configuration directory;
- * this is set by the slider script: {@value}
- */
- String PROPERTY_CONF_DIR = "slider.confdir";
-
- /**
- * 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 = "confdir";
-
- /**
- * Slider AM log4j file name : {@value}
- */
- String LOG4J_SERVER_PROP_FILENAME = "log4j-server.properties";
-
- /**
- * Standard log4j file name : {@value}
- */
- String LOG4J_PROP_FILENAME = "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_LOGDIR_PREFIX = "/tmp/slider-";
- String TMP_DIR_PREFIX = "tmp";
- String AM_DIR_PREFIX = "appmaster";
-
- /**
- * 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.jar";
- String JCOMMANDER_JAR = "jcommander.jar";
- String GSON_JAR = "gson.jar";
- String AGENT_TAR = "slider-agent.tar.gz";
- String DEFAULT_APP_PKG = "appPkg.zip";
-
- String DEFAULT_JVM_HEAP = "256M";
- int DEFAULT_YARN_MEMORY = 256;
- String STDOUT_AM = "slider-out.txt";
- String STDERR_AM = "slider-err.txt";
- String DEFAULT_GC_OPTS = "";
-
- String HADOOP_USER_NAME = "HADOOP_USER_NAME";
- String HADOOP_PROXY_USER = "HADOOP_PROXY_USER";
- String SLIDER_PASSPHRASE = "SLIDER_PASSPHRASE";
-
- boolean PROPAGATE_RESOURCE_OPTION = true;
-
- /**
- * Security associated keys.
- */
- String SECURITY_DIR = "security";
- String CRT_FILE_NAME = "ca.crt";
- String CSR_FILE_NAME = "ca.csr";
- String KEY_FILE_NAME = "ca.key";
- String KEYSTORE_FILE_NAME = "keystore.p12";
- String CRT_PASS_FILE_NAME = "pass.txt";
- String PASS_LEN = "50";
-
- String COMP_STORES_REQUIRED_KEY =
- "slider.component.security.stores.required";
- String COMP_KEYSTORE_PASSWORD_PROPERTY_KEY =
- "slider.component.keystore.password.property";
- String COMP_KEYSTORE_PASSWORD_ALIAS_KEY =
- "slider.component.keystore.credential.alias.property";
- String COMP_KEYSTORE_PASSWORD_ALIAS_DEFAULT =
- "component.keystore.credential.alias";
- String COMP_TRUSTSTORE_PASSWORD_PROPERTY_KEY =
- "slider.component.truststore.password.property";
- String COMP_TRUSTSTORE_PASSWORD_ALIAS_KEY =
- "slider.component.truststore.credential.alias.property";
- String COMP_TRUSTSTORE_PASSWORD_ALIAS_DEFAULT =
- "component.truststore.credential.alias";
-
- /**
- * Python specific
- */
- String PYTHONPATH = "PYTHONPATH";
-
-
- /**
- * Name of the AM filter to use: {@value}
- */
- String AM_FILTER_NAME =
- "org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer";
-
- /**
- * Allowed port range. This MUST be set in app_conf/global.
- * {@value}
- */
- String KEY_ALLOWED_PORT_RANGE = "site.global.slider.allowed.ports";
-
- /**
- * env var for custom JVM options.
- */
- String SLIDER_JVM_OPTS = "SLIDER_JVM_OPTS";
-
- String SLIDER_CLASSPATH_EXTRA = "SLIDER_CLASSPATH_EXTRA";
- String YARN_CONTAINER_PATH = "/node/container/";
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java b/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java
deleted file mode 100644
index 61c828e..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java
+++ /dev/null
@@ -1,83 +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.slider.common;
-
-/**
- * Keys shared across tests
- */
-public interface SliderXMLConfKeysForTesting {
-
- String KEY_TEST_THAW_WAIT_TIME = "slider.test.thaw.wait.seconds";
-
- int DEFAULT_THAW_WAIT_TIME_SECONDS = 60;
-
-
- String KEY_TEST_FREEZE_WAIT_TIME = "slider.test.freeze.wait.seconds";
-
- int DEFAULT_TEST_FREEZE_WAIT_TIME_SECONDS = 60;
-
- String KEY_TEST_TIMEOUT = "slider.test.timeout.seconds";
-
- int DEFAULT_TEST_TIMEOUT_SECONDS = 30 * 60;
-
- String KEY_ACCUMULO_LAUNCH_TIME =
- "slider.test.accumulo.launch.wait.seconds";
- int DEFAULT_ACCUMULO_LAUNCH_TIME_SECONDS = 60 * 3;
-
- String KEY_ACCUMULO_GO_LIVE_TIME =
- "slider.test.accumulo.live.wait.seconds";
- int DEFAULT_ACCUMULO_LIVE_TIME_SECONDS = 90;
-
- String KEY_TEST_AGENT_ENABLED = "slider.test.agent.enabled";
- String KEY_AGENTTESTS_QUEUE_LABELED_DEFINED = "slider.test.agent.labeled.queue.enabled";
- String KEY_AGENTTESTS_LABELS_RED_BLUE_DEFINED = "slider.test.agent.labels.defined";
- String KEY_AGENTTESTS_AM_FAILURES_ENABLED = "slider.test.agent.am.failures.enabled";
-
- int DEFAULT_AGENT_LAUNCH_TIME_SECONDS = 60 * 3;
-
- String KEY_TEST_AGENT_HOME = "slider.test.agent.home";
- String KEY_TEST_AGENT_TAR = "slider.test.agent.tar";
-
- String KEY_TEST_TEARDOWN_KILLALL = "slider.test.teardown.killall";
- boolean DEFAULT_TEARDOWN_KILLALL = true;
-
-
- /**
- * Key for amount of RAM to request
- */
- String KEY_TEST_YARN_RAM_REQUEST = "slider.test.yarn.ram";
- String DEFAULT_YARN_RAM_REQUEST = "192";
-
- /**
- * security related keys
- */
- String TEST_SECURITY_DIR = "/tmp/work/security";
-
- /**
- * Local path to AM keytab: {@value}
- */
- String KEY_TEST_AM_KEYTAB = "slider.test.am.keytab.local";
-
- /**
- * Is the test cluster windows? Default is: same as the local system.
- * {@value}
- */
- String KEY_TEST_WINDOWS_CLUSTER = "slider.test.windows.cluster";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/SliderXmlConfKeys.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/SliderXmlConfKeys.java b/slider-core/src/main/java/org/apache/slider/common/SliderXmlConfKeys.java
deleted file mode 100644
index 72dd44f..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/SliderXmlConfKeys.java
+++ /dev/null
@@ -1,206 +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.slider.common;
-
-import org.apache.hadoop.registry.client.api.RegistryConstants;
-
-/**
- * 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;
-
-
- /**
- * 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";
-
- /**
- *
- * Use {@link RegistryConstants#KEY_REGISTRY_ZK_ROOT}
- *
- */
- @Deprecated
- String REGISTRY_PATH = "slider.registry.path";
-
- /**
- *
- * @Deprecated use {@link RegistryConstants#KEY_REGISTRY_ZK_QUORUM}
- *
- */
- @Deprecated
- String REGISTRY_ZK_QUORUM = "slider.zookeeper.quorum";
-
-
- 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/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/AbstractActionArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/AbstractActionArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/AbstractActionArgs.java
deleted file mode 100644
index e3cb288..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/AbstractActionArgs.java
+++ /dev/null
@@ -1,178 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import org.apache.hadoop.fs.Path;
-import org.apache.slider.core.exceptions.BadCommandArgumentsException;
-import org.apache.slider.core.exceptions.ErrorStrings;
-import org.apache.slider.core.exceptions.UsageException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Base args for all actions
- */
-public abstract class AbstractActionArgs extends ArgOps implements Arguments {
- protected static final Logger log =
- LoggerFactory.getLogger(AbstractActionArgs.class);
-
-
- protected AbstractActionArgs() {
- }
-
- /**
- * URI/binding to the filesystem
- */
- @Parameter(names = {ARG_FILESYSTEM, ARG_FILESYSTEM_LONG},
- description = "Filesystem Binding")
- public String filesystemBinding;
-
- @Parameter(names = {ARG_BASE_PATH},
- description = "Slider base path on the filesystem",
- converter = PathArgumentConverter.class)
- public Path basePath;
-
- /**
- * This is the default parameter
- */
- @Parameter
- public final List<String> parameters = new ArrayList<>();
-
- /**
- * get the name: relies on arg 1 being the cluster name in all operations
- * @return the name argument, null if there is none
- */
- public String getClusterName() {
- return (parameters.isEmpty()) ? null : parameters.get(0);
- }
-
- /**
- -D name=value
-
- Define an HBase configuration option which overrides any options in
- the configuration XML files of the image or in the image configuration
- directory. The values will be persisted.
- Configuration options are only passed to the cluster when creating or reconfiguring a cluster.
-
- */
-
- @Parameter(names = ARG_DEFINE, arity = 1, description = "Definitions")
- public final List<String> definitions = new ArrayList<>();
-
- /**
- * System properties
- */
- @Parameter(names = {ARG_SYSPROP}, arity = 1,
- description = "system properties in the form name value" +
- " These are set after the JVM is started.")
- public final List<String> sysprops = new ArrayList<>(0);
-
-
- @Parameter(names = {ARG_MANAGER_SHORT, ARG_MANAGER},
- description = "Binding (usually hostname:port) of the YARN resource manager")
- public String manager;
-
-
- @Parameter(names = ARG_DEBUG, description = "Debug mode")
- public boolean debug = false;
-
- @Parameter(names = {ARG_HELP}, description = "Help", help = true)
- public boolean help = false;
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 1;
- }
-
- /**
- * Get the name of the action
- * @return the action name
- */
- public abstract String getActionName() ;
-
- /**
- * Get the max #of params expected
- * @return the number of params in the {@link #parameters} field;
- */
- public int getMaxParams() {
- return getMinParams();
- }
-
- public void validate() throws BadCommandArgumentsException, UsageException {
-
- int minArgs = getMinParams();
- int actionArgSize = parameters.size();
- if (minArgs > actionArgSize) {
- throw new BadCommandArgumentsException(
- ErrorStrings.ERROR_NOT_ENOUGH_ARGUMENTS + getActionName() +
- " Expected minimum " + minArgs + " but got " + actionArgSize);
- }
- int maxArgs = getMaxParams();
- if (maxArgs == -1) {
- maxArgs = minArgs;
- }
- if (actionArgSize > maxArgs) {
- String message = String.format("%s for action %s: limit is %d but saw %d: ",
- ErrorStrings.ERROR_TOO_MANY_ARGUMENTS,
- getActionName(), maxArgs,
- actionArgSize);
-
- log.error(message);
- int index = 1;
- for (String actionArg : parameters) {
- log.error("[{}] \"{}\"", index++, actionArg);
- message += " \"" + actionArg + "\" ";
- }
- throw new BadCommandArgumentsException(message);
- }
- }
-
- @Override
- public String toString() {
- return super.toString() + ": " + getActionName();
- }
-
- /**
- * Override point:
- * Flag to indicate that core hadoop API services are needed (HDFS, YARN, etc)
- * \u2014and that validation of the client state should take place.
- *
- * @return a flag to indicate that the core hadoop services will be needed.
- */
- public boolean getHadoopServicesRequired() {
- return true;
- }
-
- /**
- * Flag to disable secure login.
- * This MUST only be set if the action is bypassing security or setting
- * it itself
- * @return true if login at slider client init time is to be skipped
- */
- public boolean disableSecureLogin() {
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/AbstractArgsDelegate.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/AbstractArgsDelegate.java b/slider-core/src/main/java/org/apache/slider/common/params/AbstractArgsDelegate.java
deleted file mode 100644
index 23ba414..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/AbstractArgsDelegate.java
+++ /dev/null
@@ -1,26 +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.slider.common.params;
-
-
-/**
- * Base class for all the delegates
- */
-public class AbstractArgsDelegate extends ArgOps implements Arguments {
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/AbstractClusterBuildingActionArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/AbstractClusterBuildingActionArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/AbstractClusterBuildingActionArgs.java
deleted file mode 100644
index 2a5eedc..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/AbstractClusterBuildingActionArgs.java
+++ /dev/null
@@ -1,217 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.ParametersDelegate;
-import com.google.common.annotations.VisibleForTesting;
-import org.apache.hadoop.fs.Path;
-import org.apache.slider.core.conf.ConfTree;
-import org.apache.slider.core.conf.ConfTreeOperations;
-import org.apache.slider.core.exceptions.BadCommandArgumentsException;
-import org.apache.slider.providers.SliderProviderFactory;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Abstract Action to build things; shares args across build and
- * list
- */
-public abstract class AbstractClusterBuildingActionArgs extends
- AbstractActionArgs {
-
- /**
- * Declare the image configuration directory to use when creating or
- * reconfiguring a slider cluster. The path must be on a filesystem visible
- * to all nodes in the YARN cluster. Only one configuration directory can
- * be specified.
- */
- @Parameter(names = ARG_CONFDIR,
- description = "Path to cluster configuration directory in HDFS",
- converter = PathArgumentConverter.class)
- public Path confdir;
-
- @Parameter(names = ARG_ZKPATH,
- description = "Zookeeper path for the application")
- public String appZKPath;
-
- @Parameter(names = ARG_ZKHOSTS,
- description = "comma separated list of the Zookeeper hosts")
- public String zkhosts;
-
- /**
- * --image path
- * the full path to a .tar or .tar.gz path containing an HBase image.
- */
- @Parameter(names = ARG_IMAGE,
- description = "The full path to a .tar or .tar.gz path containing the application",
- converter = PathArgumentConverter.class)
- public Path image;
-
- @Parameter(names = ARG_APP_HOME,
- description = "Home directory of a pre-installed application")
- public String appHomeDir;
-
- @Parameter(names = ARG_PROVIDER,
- description = "Provider of the specific cluster application")
- public String provider = SliderProviderFactory.DEFAULT_CLUSTER_TYPE;
-
- @Parameter(names = {ARG_PACKAGE},
- description = "URI to a slider package")
- public String packageURI;
-
- @Parameter(names = {ARG_RESOURCES},
- description = "File defining the resources of this instance")
- public File resources;
-
- @Parameter(names = {ARG_TEMPLATE},
- description = "Template application configuration")
- public File template;
-
- @Parameter(names = {ARG_METAINFO},
- description = "Application meta info file")
- public File appMetaInfo;
-
- @Parameter(names = {ARG_METAINFO_JSON},
- description = "Application meta info JSON blob")
- public String appMetaInfoJson;
-
- @Parameter(names = {ARG_APPDEF},
- description = "Application def (folder or a zip package)")
- public File appDef;
-
- @Parameter(names = {ARG_QUEUE},
- description = "Queue to submit the application")
- public String queue;
-
- @ParametersDelegate
- public ComponentArgsDelegate componentDelegate = new ComponentArgsDelegate();
-
- @ParametersDelegate
- public AddonArgsDelegate addonDelegate = new AddonArgsDelegate();
-
-
- @ParametersDelegate
- public AppAndResouceOptionArgsDelegate optionsDelegate =
- new AppAndResouceOptionArgsDelegate();
-
-
- public Map<String, String> getOptionsMap() throws
- BadCommandArgumentsException {
- return optionsDelegate.getOptionsMap();
- }
-
- /**
- * 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 optionsDelegate.getCompOptionMap();
- }
-
-
- public Map<String, String> getResourceOptionsMap() throws
- BadCommandArgumentsException {
- return optionsDelegate.getResourceOptionsMap();
- }
-
- /**
- * 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>> getResourceCompOptionMap() throws
- BadCommandArgumentsException {
- return optionsDelegate.getResourceCompOptionMap();
- }
-
- @VisibleForTesting
- public List<String> getComponentTuples() {
- return componentDelegate.getComponentTuples();
- }
-
- /**
- * Get the role mapping (may be empty, but never null)
- * @return role mapping
- * @throws BadCommandArgumentsException parse problem
- */
- public Map<String, String> getComponentMap() throws
- BadCommandArgumentsException {
- return componentDelegate.getComponentMap();
- }
-
- @VisibleForTesting
- public List<String> getAddonTuples() {
- return addonDelegate.getAddonTuples();
- }
-
- /**
- * Get the list of addons (may be empty, but never null)
- */
- public Map<String, String> getAddonMap() throws
- BadCommandArgumentsException {
- return addonDelegate.getAddonMap();
- }
-
- public Path getConfdir() {
- return confdir;
- }
-
- public String getAppZKPath() {
- return appZKPath;
- }
-
- public String getZKhosts() {
- return zkhosts;
- }
-
- public Path getImage() {
- return image;
- }
-
- public String getAppHomeDir() {
- return appHomeDir;
- }
-
- public String getProvider() {
- return provider;
- }
-
- public ConfTree buildAppOptionsConfTree() throws
- BadCommandArgumentsException {
- return buildConfTree(getOptionsMap());
- }
-
- public ConfTree buildResourceOptionsConfTree() throws
- BadCommandArgumentsException {
- return buildConfTree(getResourceOptionsMap());
- }
-
- protected ConfTree buildConfTree(Map<String, String> optionsMap) throws
- BadCommandArgumentsException {
- ConfTree confTree = new ConfTree();
- ConfTreeOperations ops = new ConfTreeOperations(confTree);
- confTree.global.putAll(optionsMap);
- return confTree;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionAMSuicideArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionAMSuicideArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionAMSuicideArgs.java
deleted file mode 100644
index 5b4cfdc..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionAMSuicideArgs.java
+++ /dev/null
@@ -1,44 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_AM_SUICIDE},
- commandDescription = SliderActions.DESCRIBE_ACTION_AM_SUICIDE)
-public class ActionAMSuicideArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_AM_SUICIDE;
- }
-
- @Parameter(names = {ARG_MESSAGE},
- description = "reason for the action")
- public String message = "";
-
- @Parameter(names = {ARG_EXITCODE},
- description = "exit code")
- public int exitcode = 1;
-
- @Parameter(names = {ARG_WAIT},
- description = "time for AM to wait before exiting")
- public int waittime = 1000;
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionBuildArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionBuildArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionBuildArgs.java
deleted file mode 100644
index 1a182d1..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionBuildArgs.java
+++ /dev/null
@@ -1,32 +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.slider.common.params;
-
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_BUILD},
- commandDescription = SliderActions.DESCRIBE_ACTION_BUILD)
-
-public class ActionBuildArgs extends AbstractClusterBuildingActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_BUILD;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionClientArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionClientArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionClientArgs.java
deleted file mode 100644
index 85d39ea..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionClientArgs.java
+++ /dev/null
@@ -1,98 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-import java.io.File;
-
-@Parameters(commandNames = {SliderActions.ACTION_CLIENT},
- commandDescription = SliderActions.DESCRIBE_ACTION_CLIENT)
-
-public class ActionClientArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_CLIENT;
- }
-
- @Parameter(names = {ARG_INSTALL},
- description = "Install client")
- public boolean install;
-
- @Parameter(names = {ARG_GETCERTSTORE},
- description = "Get a certificate store")
- public boolean getCertStore;
-
- @Parameter(names = {ARG_KEYSTORE},
- description = "Retrieve keystore to specified location")
- public File keystore;
-
- @Parameter(names = {ARG_TRUSTSTORE},
- description = "Retrieve truststore to specified location")
- public File truststore;
-
- @Parameter(names = {ARG_HOSTNAME},
- description = "(Optional) Specify the hostname to use for generation of keystore certificate")
- public String hostname;
-
- @Parameter(names = {ARG_NAME},
- description = "The name of the application")
- public String name;
-
- @Parameter(names = {ARG_PROVIDER},
- description = "The credential provider in which the password is stored")
- public String provider;
-
- @Parameter(names = {ARG_ALIAS},
- description = "The credential provider alias associated with the password")
- public String alias;
-
- @Parameter(names = {ARG_PASSWORD},
- description = "The certificate store password (alternative to " +
- "provider/alias; if password is specified, those will be ignored)")
- public String password;
-
- @Parameter(names = {ARG_PACKAGE},
- description = "Path to app package")
- public String packageURI;
-
- @Parameter(names = {ARG_DEST},
- description = "The location where to install the client")
- public File installLocation;
-
- @Parameter(names = {ARG_CONFIG},
- description = "Client configuration")
- public File clientConfig;
-
- /**
- * Get the min #of params expected
- *
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 1;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionCreateArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionCreateArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionCreateArgs.java
deleted file mode 100644
index e70f30a..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionCreateArgs.java
+++ /dev/null
@@ -1,59 +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.slider.common.params;
-
-import com.beust.jcommander.Parameters;
-import com.beust.jcommander.ParametersDelegate;
-
-import java.io.File;
-
-@Parameters(commandNames = {SliderActions.ACTION_CREATE},
- commandDescription = SliderActions.DESCRIBE_ACTION_CREATE)
-
-public class ActionCreateArgs extends AbstractClusterBuildingActionArgs
- implements WaitTimeAccessor, LaunchArgsAccessor {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_CREATE;
- }
-
- @ParametersDelegate
- LaunchArgsDelegate launchArgs = new LaunchArgsDelegate();
-
- @Override
- public File getOutputFile() {
- return launchArgs.getOutputFile();
- }
-
- @Override
- public String getRmAddress() {
- return launchArgs.getRmAddress();
- }
-
- @Override
- public int getWaittime() {
- return launchArgs.getWaittime();
- }
-
- @Override
- public void setWaittime(int waittime) {
- launchArgs.setWaittime(waittime);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionDependencyArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionDependencyArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionDependencyArgs.java
deleted file mode 100644
index 87f9f0d..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionDependencyArgs.java
+++ /dev/null
@@ -1,65 +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.slider.common.params;
-
-import org.apache.slider.core.exceptions.BadCommandArgumentsException;
-import org.apache.slider.core.exceptions.UsageException;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = { SliderActions.ACTION_DEPENDENCY },
- commandDescription = SliderActions.DESCRIBE_ACTION_DEPENDENCY)
-public class ActionDependencyArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_DEPENDENCY;
- }
-
- @Parameter(names = { ARG_UPLOAD },
- description = "Upload AM and agent libraries to HDFS for this client")
- public boolean upload;
-
- @Parameter(names = { ARG_OVERWRITE },
- description = "Overwrite current uploaded dependency libs")
- public boolean overwrite = false;
-
- /**
- * Get the min #of params expected
- *
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 1;
- }
-
- @Override
- public void validate() throws BadCommandArgumentsException, UsageException {
- super.validate();
-
- if (!upload) {
- throw new UsageException("Option " + ARG_UPLOAD + " is mandatory");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionDestroyArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionDestroyArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionDestroyArgs.java
deleted file mode 100644
index 4a129ab..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionDestroyArgs.java
+++ /dev/null
@@ -1,37 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_DESTROY},
- commandDescription = SliderActions.DESCRIBE_ACTION_DESTROY)
-
-public class ActionDestroyArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_DESTROY;
- }
-
- @Parameter(names = {ARG_FORCE},
- description = "force the operation")
- public boolean force;
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionDiagnosticArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionDiagnosticArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionDiagnosticArgs.java
deleted file mode 100644
index c891873..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionDiagnosticArgs.java
+++ /dev/null
@@ -1,73 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(
- commandNames = {SliderActions.ACTION_DIAGNOSTICS},
- commandDescription = SliderActions.DESCRIBE_ACTION_DIAGNOSTIC)
-public class ActionDiagnosticArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_DIAGNOSTICS;
- }
-
- @Parameter(names = {ARG_NAME},
- description = "the name of the running application")
- public String name;
-
- @Parameter(names = {ARG_CLIENT},
- description = "print configuration of the slider client")
- public boolean client = false;
-
- @Parameter(names = {ARG_APPLICATION},
- description = "print configuration of the running application")
- public boolean application;
-
- @Parameter(names = {ARG_VERBOSE},
- description = "print out information in details")
- public boolean verbose = false;
-
- @Parameter(names = {ARG_YARN},
- description = "print configuration of the YARN cluster")
- public boolean yarn = false;
-
- @Parameter(names = {ARG_CREDENTIALS},
- description = "print credentials of the current user")
- public boolean credentials = false;
-
- @Parameter(names = {ARG_ALL},
- description = "print all of the information above")
- public boolean all;
-
- @Parameter(names = {ARG_LEVEL},
- description = "diagnose each slider configuration one by one")
- public boolean level;
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- @Override
- public int getMinParams() {
- return 0;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionEchoArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionEchoArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionEchoArgs.java
deleted file mode 100644
index d05f10b..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionEchoArgs.java
+++ /dev/null
@@ -1,33 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-
-public class ActionEchoArgs extends AbstractActionArgs {
- @Override
- public String getActionName() {
- return SliderActions.ACTION_ECHO;
- }
-
- @Parameter(names = {ARG_MESSAGE},
- description = "message to echo")
- public String message;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionExistsArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionExistsArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionExistsArgs.java
deleted file mode 100644
index dd1c04b..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionExistsArgs.java
+++ /dev/null
@@ -1,47 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-import java.io.File;
-
-@Parameters(commandNames = {SliderActions.ACTION_EXISTS},
- commandDescription = SliderActions.DESCRIBE_ACTION_EXISTS)
-
-public class ActionExistsArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_EXISTS;
- }
-
- @Parameter(names = {ARG_LIVE},
- description = "verify that the application is running")
- public boolean live;
-
- @Parameter(names = {ARG_STATE},
- description = "verify that the application is in the specific YARN state")
- public String state = "";
-
- @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
- description = "output file for any application report")
- public File out;
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionFlexArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionFlexArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionFlexArgs.java
deleted file mode 100644
index 725973e..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionFlexArgs.java
+++ /dev/null
@@ -1,54 +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.slider.common.params;
-
-import com.beust.jcommander.Parameters;
-import com.beust.jcommander.ParametersDelegate;
-import org.apache.slider.core.exceptions.BadCommandArgumentsException;
-
-import java.util.List;
-import java.util.Map;
-
-@Parameters(commandNames = {SliderActions.ACTION_FLEX},
- commandDescription = SliderActions.DESCRIBE_ACTION_FLEX)
-
-public class ActionFlexArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_FLEX;
- }
-
- @ParametersDelegate
- public ComponentArgsDelegate componentDelegate = new ComponentArgsDelegate();
-
- /**
- * Get the component mapping (may be empty, but never null)
- * @return mapping
- * @throws BadCommandArgumentsException parse problem
- */
- public Map<String, String> getComponentMap() throws BadCommandArgumentsException {
- return componentDelegate.getComponentMap();
- }
-
- public List<String> getComponentTuples() {
- return componentDelegate.getComponentTuples();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionFreezeArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionFreezeArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionFreezeArgs.java
deleted file mode 100644
index e3085d9..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionFreezeArgs.java
+++ /dev/null
@@ -1,56 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import com.beust.jcommander.ParametersDelegate;
-
-@Parameters(commandNames = {SliderActions.ACTION_FREEZE},
- commandDescription = SliderActions.DESCRIBE_ACTION_FREEZE)
-
-public class ActionFreezeArgs extends AbstractActionArgs implements
- WaitTimeAccessor {
- @Override
- public String getActionName() {
- return SliderActions.ACTION_FREEZE;
- }
-
- public static final String FREEZE_COMMAND_ISSUED = "stop command issued";
- @ParametersDelegate
- public WaitArgsDelegate waitDelegate = new WaitArgsDelegate();
-
- @Override
- public int getWaittime() {
- return waitDelegate.getWaittime();
- }
-
- @Override
- public void setWaittime(int waittime) {
- waitDelegate.setWaittime(waittime);
- }
-
- @Parameter(names={ARG_MESSAGE},
- description = "reason for the operation")
- public String message = FREEZE_COMMAND_ISSUED;
-
- @Parameter(names = {ARG_FORCE},
- description = "force the operation")
- public boolean force;
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionHelpArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionHelpArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionHelpArgs.java
deleted file mode 100644
index 62773c4..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionHelpArgs.java
+++ /dev/null
@@ -1,51 +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.slider.common.params;
-
-import com.beust.jcommander.Parameters;
-
-/**
- * The Help command
- */
-@Parameters(commandNames = {SliderActions.ACTION_HELP},
- commandDescription = SliderActions.DESCRIBE_ACTION_HELP)
-public class ActionHelpArgs extends AbstractActionArgs {
- @Override
- public String getActionName() {
- return SliderActions.ACTION_HELP;
- }
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- @Override
- public int getMinParams() {
- return 0;
- }
-
- /**
- * This action does not need hadoop services
- * @return false
- */
- @Override
- public boolean getHadoopServicesRequired() {
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallKeytabArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallKeytabArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallKeytabArgs.java
deleted file mode 100644
index 4cfb889..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallKeytabArgs.java
+++ /dev/null
@@ -1,57 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_INSTALL_KEYTAB},
- commandDescription = SliderActions.DESCRIBE_ACTION_INSTALL_KEYTAB)
-
-public class ActionInstallKeytabArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_INSTALL_KEYTAB;
- }
-
- @Parameter(names = {ARG_KEYTAB},
- description = "Path to keytab on local disk")
- public String keytabUri;
-
- @Parameter(names = {ARG_FOLDER},
- description = "The name of the folder in which to store the keytab")
- public String folder;
-
- @Parameter(names = {ARG_OVERWRITE}, description = "Overwrite existing keytab")
- public boolean overwrite = false;
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 3;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallPackageArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallPackageArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallPackageArgs.java
deleted file mode 100644
index 646e795..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionInstallPackageArgs.java
+++ /dev/null
@@ -1,58 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import com.beust.jcommander.ParametersDelegate;
-
-@Parameters(commandNames = {SliderActions.ACTION_INSTALL_PACKAGE},
- commandDescription = SliderActions.DESCRIBE_ACTION_INSTALL_PACKAGE)
-
-public class ActionInstallPackageArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_INSTALL_PACKAGE;
- }
-
- @Parameter(names = {ARG_PACKAGE},
- description = "Path to app package on local disk")
- public String packageURI;
-
- @Parameter(names = {ARG_NAME},
- description = "The type of the package")
- public String name;
-
- @Parameter(names = {ARG_REPLACE_PKG}, description = "Overwrite existing package")
- public boolean replacePkg = false;
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 1;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionKDiagArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionKDiagArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionKDiagArgs.java
deleted file mode 100644
index 9fc9d2e..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionKDiagArgs.java
+++ /dev/null
@@ -1,86 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import org.apache.slider.common.tools.SliderUtils;
-import org.apache.slider.core.exceptions.BadCommandArgumentsException;
-import org.apache.slider.core.exceptions.UsageException;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-@Parameters(commandNames = {SliderActions.ACTION_KDIAG},
- commandDescription = SliderActions.DESCRIBE_ACTION_KDIAG)
-
-public class ActionKDiagArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_KDIAG;
- }
-
- @Parameter(names = {ARG_SERVICES}, variableArity = true,
- description =" list of services to check")
- public List<String> services = new ArrayList<>();
-
- @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
- description = "output file for report")
- public File out;
-
- @Parameter(names = {ARG_KEYTAB}, description = "keytab to use")
- public File keytab;
-
- @Parameter(names = {ARG_KEYLEN}, description = "minimum key length")
- public int keylen = 256;
-
- @Parameter(names = {ARG_PRINCIPAL}, description = "principal to log in from a keytab")
- public String principal;
-
- @Parameter(names = {ARG_SECURE}, description = "Is security required")
- public boolean secure = false;
-
- @Override
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public boolean getHadoopServicesRequired() {
- return false;
- }
-
- @Override
- public boolean disableSecureLogin() {
- return true;
- }
-
- @Override
- public void validate() throws BadCommandArgumentsException, UsageException {
- super.validate();
- if (keytab != null && SliderUtils.isUnset(principal)) {
- throw new UsageException("Missing argument " + ARG_PRINCIPAL);
- }
- if (keytab == null && SliderUtils.isSet(principal)) {
- throw new UsageException("Missing argument " + ARG_KEYTAB);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionKeytabArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionKeytabArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionKeytabArgs.java
deleted file mode 100644
index 32b1d2b..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionKeytabArgs.java
+++ /dev/null
@@ -1,81 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_KEYTAB},
- commandDescription = SliderActions.DESCRIBE_ACTION_KEYTAB)
-
-public class ActionKeytabArgs extends AbstractActionArgs {
-
- public ActionKeytabArgs(ActionInstallKeytabArgs installKeytabInfo) {
- this.install = true;
- this.overwrite = installKeytabInfo.overwrite;
- this.keytab = installKeytabInfo.keytabUri;
- this.folder = installKeytabInfo.folder;
- }
-
- public ActionKeytabArgs() {
- super();
- }
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_INSTALL_KEYTAB;
- }
-
- @Parameter(names = {ARG_KEYTABINSTALL},
- description = "Install the keytab")
- public boolean install;
-
- @Parameter(names = {ARG_KEYTABDELETE},
- description = "Delete the keytab")
- public boolean delete;
-
- @Parameter(names = {ARG_KEYTABLIST},
- description = "List of installed keytabs")
- public boolean list;
-
- @Parameter(names = {ARG_KEYTAB},
- description = "Path or name of the keytab")
- public String keytab;
-
- @Parameter(names = {ARG_FOLDER},
- description = "The name of the folder in which to store the keytab")
- public String folder;
-
- @Parameter(names = {ARG_OVERWRITE}, description = "Overwrite existing keytab")
- public boolean overwrite = false;
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 3;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionKillContainerArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionKillContainerArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionKillContainerArgs.java
deleted file mode 100644
index 8c18ad8..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionKillContainerArgs.java
+++ /dev/null
@@ -1,37 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_KILL_CONTAINER},
- commandDescription = SliderActions.DESCRIBE_ACTION_KILL_CONTAINER)
-
-public class ActionKillContainerArgs extends AbstractActionArgs {
- @Override
- public String getActionName() {
- return SliderActions.ACTION_KILL_CONTAINER;
- }
-
- @Parameter(names = {ARG_ID},
- description = "ID of the container")
- public String id;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionListArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionListArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionListArgs.java
deleted file mode 100644
index 739b5fc..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionListArgs.java
+++ /dev/null
@@ -1,74 +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.slider.common.params;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_LIST},
- commandDescription = SliderActions.DESCRIBE_ACTION_LIST)
-
-public class ActionListArgs extends AbstractActionArgs {
- @Override
- public String getActionName() {
- return SliderActions.ACTION_LIST;
- }
-
- @Parameter(names = {ARG_LIVE},
- description = "List only live application instances")
- public boolean live;
-
- @Parameter(names = {ARG_STATE},
- description = "list only applications in the specific YARN state")
- public String state = "";
-
- @Parameter(names = {ARG_VERBOSE},
- description = "print out information in details")
- public boolean verbose = false;
-
- @Parameter(names = {ARG_CONTAINERS},
- description = "List containers of an application instance")
- public boolean containers;
-
- @Parameter(names = {ARG_VERSION},
- description = "Filter containers by app version (used with " +
- ARG_CONTAINERS + ")")
- public String version;
-
- @Parameter(names = {ARG_COMPONENTS}, variableArity = true,
- description = "Filter containers by component names (used with " +
- ARG_CONTAINERS + ")")
- public Set<String> components = new HashSet<>(0);
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 1;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionLookupArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionLookupArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionLookupArgs.java
deleted file mode 100644
index 1b73522..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionLookupArgs.java
+++ /dev/null
@@ -1,76 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import org.apache.commons.lang.StringUtils;
-import org.apache.slider.core.exceptions.BadCommandArgumentsException;
-import org.apache.slider.core.exceptions.UsageException;
-
-import java.io.File;
-
-@Parameters(commandNames = {SliderActions.ACTION_LOOKUP},
- commandDescription = SliderActions.DESCRIBE_ACTION_LOOKUP)
-
-public class ActionLookupArgs extends AbstractActionArgs {
- @Override
- public String getActionName() {
- return SliderActions.ACTION_LOOKUP;
- }
-
- public int getMinParams() {
- return 0;
- }
- public int getMaxParams() {
- return 0;
- }
-
- @Parameter(names = {ARG_ID},
- description = "ID of the application")
- public String id;
-
- @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
- description = "output file for any application report")
- public File outputFile;
-
- @Override
- public void validate() throws BadCommandArgumentsException, UsageException {
- super.validate();
- if (StringUtils.isEmpty(id)) {
- throw new BadCommandArgumentsException("Missing mandatory argument "
- + ARG_ID);
- }
- }
-
- @Override
- public String toString() {
- final StringBuilder sb =
- new StringBuilder(SliderActions.ACTION_LOOKUP);
- if (id!=null) {
- sb.append(" ");
- sb.append(ARG_ID).append(" ").append(id);
- }
- if (outputFile != null) {
- sb.append(" ");
- sb.append(ARG_OUTPUT).append(" ").append(outputFile.getAbsolutePath());
- }
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionNodesArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionNodesArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionNodesArgs.java
deleted file mode 100644
index ec38c80..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionNodesArgs.java
+++ /dev/null
@@ -1,71 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-import java.io.File;
-
-@Parameters(commandNames = {SliderActions.ACTION_NODES},
- commandDescription = SliderActions.DESCRIBE_ACTION_NODES)
-public class ActionNodesArgs extends AbstractActionArgs {
-
- /**
- * Instance for API use; on CLI the name is derived from {@link #getClusterName()}.
- */
- public String instance;
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_NODES;
- }
-
- @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
- description = "Output file for the information")
- public File outputFile;
-
- @Parameter(names = {ARG_LABEL})
- public String label = "";
-
- @Parameter(names = {ARG_HEALTHY} )
- public boolean healthy;
-
- @Override
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 1;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder(
- "ActionNodesArgs{");
- sb.append("instance='").append(instance).append('\'');
- sb.append(", outputFile=").append(outputFile);
- sb.append(", label='").append(label).append('\'');
- sb.append(", healthy=").append(healthy);
- sb.append('}');
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/51c2b92c/slider-core/src/main/java/org/apache/slider/common/params/ActionPackageArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionPackageArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionPackageArgs.java
deleted file mode 100644
index 4833934..0000000
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionPackageArgs.java
+++ /dev/null
@@ -1,81 +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.slider.common.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = {SliderActions.ACTION_PACKAGE},
- commandDescription = SliderActions.DESCRIBE_ACTION_PACKAGE)
-
-public class ActionPackageArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_PACKAGE;
- }
-
- @Parameter(names = {ARG_INSTALL},
- description = "Install package in the sub-folder 'package' of the user's Slider base directory")
- public boolean install;
-
- @Parameter(names = {ARG_PKGDELETE},
- description = "Delete package operation")
- public boolean delete;
-
- @Parameter(names = {ARG_PKGLIST},
- description = "List of package(s) installed")
- public boolean list;
-
- @Parameter(names = {ARG_PKGINSTANCES},
- description = "Lists all application instances referring to package")
- public boolean instances;
-
- @Parameter(names = {ARG_PACKAGE},
- description = "Path to app package on local disk")
- public String packageURI;
-
- @Parameter(names = {ARG_NAME},
- description = "Package name")
- public String name;
-
- @Parameter(names = {ARG_VERSION}, description = "Package version")
- public String version;
-
- @Parameter(names = {ARG_REPLACE_PKG},
- description = "Overwrite existing package")
- public boolean replacePkg = false;
-
- @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
- description = "Output file for package data")
- public String out;
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public int getMaxParams() {
- return 1;
- }
-}