You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ji...@apache.org on 2017/11/06 22:02:25 UTC
[51/58] [abbrv] hadoop git commit: YARN-7384. Remove apiserver cmd
and merge service cmd into application cmd. Contributed by Billie Rinaldi
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java
deleted file mode 100644
index 65f0472..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java
+++ /dev/null
@@ -1,153 +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.client.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException;
-import org.apache.hadoop.yarn.service.exceptions.UsageException;
-
-import java.io.File;
-
-import static org.apache.hadoop.yarn.service.client.params.SliderActions.ACTION_RESOLVE;
-import static org.apache.hadoop.yarn.service.client.params.SliderActions.DESCRIBE_ACTION_REGISTRY;
-
-/**
- * Resolve registry entries
- *
- * --path {path}
- * --out {destfile}
- * --verbose
- * --list
- */
-@Parameters(commandNames = {ACTION_RESOLVE},
- commandDescription = DESCRIBE_ACTION_REGISTRY)
-public class ActionResolveArgs extends AbstractActionArgs {
-
- public static final String USAGE =
- "Usage: " + SliderActions.ACTION_RESOLVE
- + " "
- + ARG_PATH + " <path> "
- + "[" + ARG_LIST + "] "
- + "[" + ARG_OUTPUT + " <filename> ] "
- + "[" + ARG_DESTDIR + " <directory> ] "
- ;
- public ActionResolveArgs() {
- }
-
- @Override
- public String getActionName() {
- return ACTION_RESOLVE;
- }
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- @Override
- public int getMinParams() {
- return 0;
- }
-
- @Parameter(names = {ARG_LIST},
- description = "list services")
- public boolean list;
-
- @Parameter(names = {ARG_PATH},
- description = "resolve a path")
- public String path;
-
- @Parameter(names = {ARG_DESTDIR},
- description = "destination directory for operations")
- public File destdir;
-
- @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
- description = "dest file")
- public File out;
-
- @Override
- public String toString() {
- final StringBuilder sb =
- new StringBuilder(ACTION_RESOLVE).append(" ");
- sb.append(ARG_PATH).append(" ").append(path).append(" ");
- if (list) {
- sb.append(ARG_LIST).append(" ");
- }
- if (destdir != null) {
- sb.append(ARG_DESTDIR).append(" ").append(destdir).append(" ");
- }
- if (out != null) {
- sb.append(ARG_OUTPUT).append(" ").append(out).append(" ");
- }
- return sb.toString();
- }
-
- @Override
- public void validate() throws BadCommandArgumentsException, UsageException {
- super.validate();
- if (StringUtils.isEmpty(path)) {
- throw new BadCommandArgumentsException("Missing mandatory argument "
- + ARG_PATH);
- }
- if (list && out != null) {
- throw new BadCommandArgumentsException("Argument "
- + ARG_OUTPUT +
- " not supported for " + ARG_LIST);
- }
- if (out != null && destdir != null) {
- throw new BadCommandArgumentsException(
- ARG_OUTPUT + " and " + ARG_DESTDIR + " cannot be used together"
- );
- }
- }
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public boolean isList() {
- return list;
- }
-
- public void setList(boolean list) {
- this.list = list;
- }
-
- public File getDestdir() {
- return destdir;
- }
-
- public void setDestdir(File destdir) {
- this.destdir = destdir;
- }
-
- public File getOut() {
- return out;
- }
-
- public void setOut(File out) {
- this.out = out;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java
deleted file mode 100644
index b03dc92..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java
+++ /dev/null
@@ -1,70 +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.client.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import org.apache.hadoop.yarn.service.client.params.AbstractActionArgs;
-import org.apache.hadoop.yarn.service.client.params.SliderActions;
-
-@Parameters(commandNames = { SliderActions.ACTION_RESOURCE},
- commandDescription = SliderActions.DESCRIBE_ACTION_RESOURCE)
-
-public class ActionResourceArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_RESOURCE;
- }
-
- @Parameter(names = {ARG_INSTALL},
- description = "Install the resource(s)")
- public boolean install;
-
- @Parameter(names = {ARG_DELETE},
- description = "Delete the file")
- public boolean delete;
-
- @Parameter(names = {ARG_LIST},
- description = "List of installed files")
- public boolean list;
-
- @Parameter(names = {ARG_RESOURCE},
- description = "Name of the file or directory")
- public String resource;
-
- @Parameter(names = {ARG_DESTDIR},
- description = "The name of the folder in which to store the resources")
- public String folder;
-
- @Parameter(names = {ARG_OVERWRITE}, description = "Overwrite existing resource(s)")
- 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/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java
deleted file mode 100644
index 31f25ef..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.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.hadoop.yarn.service.client.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import org.apache.hadoop.yarn.service.client.params.AbstractActionArgs;
-import org.apache.hadoop.yarn.service.client.params.SliderActions;
-
-@Parameters(commandNames = { SliderActions.ACTION_STATUS},
- commandDescription = SliderActions.DESCRIBE_ACTION_STATUS)
-
-public class ActionStatusArgs extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_STATUS;
- }
-
- @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
- description = "Output file for the status information")
- public String output;
-
- @Parameter(names = {ARG_LIFETIME},
- description = "Lifetime of the service from the time of request")
- public boolean lifetime;
-
- public String getOutput() {
- return output;
- }
-
- public void setOutput(String output) {
- this.output = output;
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java
deleted file mode 100644
index 175e367..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java
+++ /dev/null
@@ -1,67 +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.client.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import com.beust.jcommander.ParametersDelegate;
-
-import java.io.File;
-
-@Parameters(commandNames = { SliderActions.ACTION_START },
- commandDescription = SliderActions.DESCRIBE_ACTION_THAW)
-public class ActionThawArgs extends AbstractActionArgs implements
- WaitTimeAccessor,
- LaunchArgsAccessor {
-
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_START;
- }
-
- @Override
- public int getWaittime() {
- return launchArgs.getWaittime();
- }
-
- @ParametersDelegate
- LaunchArgsDelegate launchArgs = new LaunchArgsDelegate();
-
- @Parameter(names = {ARG_LIFETIME},
- description = "Life time of the service since service started at"
- + " running state")
- public long lifetime;
-
- @Override
- public String getRmAddress() {
- return launchArgs.getRmAddress();
- }
-
- @Override
- public void setWaittime(int waittime) {
- launchArgs.setWaittime(waittime);
- }
-
-
- @Override
- public File getOutputFile() {
- return launchArgs.getOutputFile();
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java
deleted file mode 100644
index cf48513..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java
+++ /dev/null
@@ -1,78 +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.client.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException;
-import org.apache.hadoop.yarn.service.exceptions.UsageException;
-
-import java.io.File;
-
-@Parameters(commandNames = { SliderActions.ACTION_TOKENS},
- commandDescription = "save tokens to a file or list tokens in a file")
-public class ActionTokensArgs extends AbstractActionArgs {
-
- public static final String DUPLICATE_ARGS = "Only one of " +
- ARG_SOURCE + " and " + ARG_OUTPUT + " allowed";
-
- public static final String MISSING_KT_PROVIDER =
- "Both " + ARG_KEYTAB + " and " + ARG_PRINCIPAL
- + " must be provided";
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_TOKENS;
- }
-
- @Parameter(names = {ARG_OUTPUT},
- description = "File to write")
- public File output;
-
- @Parameter(names = {ARG_SOURCE},
- description = "source file")
- public File source;
-
- @Parameter(names = {ARG_KEYTAB}, description = "keytab to use")
- public File keytab;
-
- @Parameter(names = {ARG_PRINCIPAL}, description = "principal to log in from a keytab")
- public String principal="";
-
- /**
- * Get the min #of params expected
- * @return the min number of params in the {@link #parameters} field
- */
- public int getMinParams() {
- return 0;
- }
-
- @Override
- public void validate() throws BadCommandArgumentsException, UsageException {
- super.validate();
- if (output != null && source != null) {
- throw new BadCommandArgumentsException(DUPLICATE_ARGS);
- }
-
- // this is actually a !xor
- if (keytab != null ^ !principal.isEmpty()) {
- throw new BadCommandArgumentsException(MISSING_KT_PROVIDER);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java
deleted file mode 100644
index 00af69a..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.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.hadoop.yarn.service.client.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = { SliderActions.ACTION_UPDATE},
- commandDescription = SliderActions.DESCRIBE_ACTION_UPDATE)
-
-public class ActionUpdateArgs extends AbstractActionArgs {
-
- @Parameter(names = {
- ARG_LIFETIME }, description = "Lifetime of the service from the time of request")
- public long lifetime;
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_UPDATE;
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java
deleted file mode 100644
index 00151f4..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java
+++ /dev/null
@@ -1,156 +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.client.params;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException;
-import org.apache.hadoop.yarn.service.exceptions.ErrorStrings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Static argument manipulation operations
- */
-public class ArgOps {
-
- private static final Logger
- log = LoggerFactory.getLogger(ArgOps.class);
-
- /**
- * create a 3-tuple
- */
- public static List<Object> triple(String msg, int min, int max) {
- List<Object> l = new ArrayList<>(3);
- l.add(msg);
- l.add(min);
- l.add(max);
- return l;
- }
-
- public static void applyFileSystemBinding(String filesystemBinding,
- Configuration conf) {
- if (filesystemBinding != null) {
- //filesystem argument was set -this overwrites any defaults in the
- //configuration
- FileSystem.setDefaultUri(conf, filesystemBinding);
- }
- }
-
- public static void splitPairs(Collection<String> pairs,
- Map<String, String> dest) {
- for (String prop : pairs) {
- String[] keyval = prop.split("=", 2);
- if (keyval.length == 2) {
- dest.put(keyval[0], keyval[1]);
- }
- }
- }
-
-
- public static void applyDefinitions(Map<String, String> definitionMap,
- Configuration conf) {
- for (Map.Entry<String, String> entry : definitionMap.entrySet()) {
- String key = entry.getKey();
- String val = entry.getValue();
- log.debug("configuration[{}]<=\"{}\"", key, val);
- conf.set(key, val, "command line");
- }
- }
-
- /**
- * Create a map from a tuple list like ['worker','2','master','1] into a map
- * ['worker':'2',"master":'1'];
- * Duplicate entries also trigger errors
- * @param description description for errors
- * @param list list to conver to tuples
- * @return the map of key value pairs -unordered.
- * @throws BadCommandArgumentsException odd #of arguments received
- */
- public static Map<String, String> convertTupleListToMap(String description,
- List<String> list) throws
- BadCommandArgumentsException {
- Map<String, String> results = new HashMap<>();
- if (list != null && !list.isEmpty()) {
- int size = list.size();
- if (size % 2 != 0) {
- //odd number of elements, not permitted
- throw new BadCommandArgumentsException(
- ErrorStrings.ERROR_PARSE_FAILURE + description);
- }
- for (int count = 0; count < size; count += 2) {
- String key = list.get(count);
- String val = list.get(count + 1);
- if (results.get(key) != null) {
- throw new BadCommandArgumentsException(
- ErrorStrings.ERROR_DUPLICATE_ENTRY + description
- + ": " + key);
- }
- results.put(key, val);
- }
- }
- return results;
- }
-
- /**
- * Create a map from a tuple list like
- * ['worker','heapsize','5G','master','heapsize','2M'] into a map
- * ['worker':'2',"master":'1'];
- * Duplicate entries also trigger errors
-
- * @throws BadCommandArgumentsException odd #of arguments received
- */
- public static Map<String, Map<String, String>> convertTripleListToMaps(String description,
- List<String> list) throws BadCommandArgumentsException {
-
- Map<String, Map<String, String>> results = new HashMap<>();
- if (list != null && !list.isEmpty()) {
- int size = list.size();
- if (size % 3 != 0) {
- //wrong number of elements, not permitted
- throw new BadCommandArgumentsException(
- ErrorStrings.ERROR_PARSE_FAILURE + description);
- }
- for (int count = 0; count < size; count += 3) {
- String role = list.get(count);
- String key = list.get(count + 1);
- String val = list.get(count + 2);
- Map<String, String> roleMap = results.get(role);
- if (roleMap == null) {
- //demand create new role map
- roleMap = new HashMap<>();
- results.put(role, roleMap);
- }
- if (roleMap.get(key) != null) {
- throw new BadCommandArgumentsException(
- ErrorStrings.ERROR_DUPLICATE_ENTRY + description
- + ": for key " + key + " under " + role);
- }
- roleMap.put(key, val);
- }
- }
- return results;
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java
deleted file mode 100644
index 67571e2..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java
+++ /dev/null
@@ -1,103 +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.client.params;
-
-/**
- * Here are all the arguments that may be parsed by the client or server
- * command lines.
- *
- * Important: Please keep the main list in alphabetical order
- * so it is easier to see what arguments are there
- */
-public interface Arguments {
-
- String ARG_FILE = "--file";
- String ARG_FILE_SHORT = "-f";
- String ARG_BASE_PATH = "--basepath";
- String ARG_COMPONENT = "--component";
- 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_DEBUG = "--debug";
- String ARG_DEFINE = "-D";
- String ARG_DELETE = "--delete";
- String ARG_DEST = "--dest";
- String ARG_DESTDIR = "--destdir";
- String ARG_EXAMPLE = "--example";
- String ARG_EXAMPLE_SHORT = "-e";
- String ARG_FOLDER = "--folder";
- String ARG_FORCE = "--force";
- String ARG_FORMAT = "--format";
- String ARG_GETCONF = "--getconf";
- String ARG_GETEXP = "--getexp";
- String ARG_GETFILES = "--getfiles";
- String ARG_HELP = "--help";
- String ARG_IMAGE = "--image";
- String ARG_INSTALL = "--install";
- String ARG_INTERNAL = "--internal";
- String ARG_KEYLEN = "--keylen";
- String ARG_KEYTAB = "--keytab";
- String ARG_KEYTABINSTALL = ARG_INSTALL;
- String ARG_KEYTABDELETE = ARG_DELETE;
- String ARG_KEYTABLIST = "--list";
- String ARG_LIST = "--list";
- String ARG_LISTCONF = "--listconf";
- String ARG_LISTEXP = "--listexp";
- String ARG_LISTFILES = "--listfiles";
- String ARG_LIVE = "--live";
- String ARG_MANAGER = "--manager";
- String ARG_MANAGER_SHORT = "--m";
- String ARG_MESSAGE = "--message";
- String ARG_NAME = "--name";
- String ARG_OPTION = "--option";
- String ARG_OPTION_SHORT = "-O";
- String ARG_OUTPUT = "--out";
- String ARG_OUTPUT_SHORT = "-o";
- String ARG_OVERWRITE = "--overwrite";
- String ARG_PACKAGE = "--package";
- String ARG_PATH = "--path";
- String ARG_PRINCIPAL = "--principal";
- String ARG_QUEUE = "--queue";
- String ARG_SHORT_QUEUE = "-q";
- String ARG_LIFETIME = "--lifetime";
- String ARG_RESOURCE = "--resource";
- String ARG_RESOURCE_MANAGER = "--rm";
- String ARG_SECURE = "--secure";
- String ARG_SERVICETYPE = "--servicetype";
- String ARG_SERVICES = "--services";
- String ARG_SOURCE = "--source";
- String ARG_STATE = "--state";
- String ARG_SYSPROP = "-S";
- String ARG_USER = "--user";
- String ARG_UPLOAD = "--upload";
- String ARG_VERBOSE = "--verbose";
- String ARG_VERSION = "--version";
- String ARG_WAIT = "--wait";
-/*
- STOP: DO NOT ADD YOUR ARGUMENTS HERE. GO BACK AND INSERT THEM IN THE
- RIGHT PLACE IN THE LIST
- */
-
- // Tha path in hdfs to be read by Service AM
- String ARG_SERVICE_DEF_PATH = "-cluster-uri";
-
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java
deleted file mode 100644
index 84d3bbd..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java
+++ /dev/null
@@ -1,193 +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.client.params;
-
-import org.apache.hadoop.conf.Configuration;
-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;
-
-/**
- * Client CLI Args
- */
-
-public class ClientArgs extends CommonArgs {
-
- // =========================================================
- // Keep all of these in alphabetical order. Thanks.
- // =========================================================
-
- 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 ActionExistsArgs actionExistsArgs = new ActionExistsArgs();
- private final ActionFlexArgs actionFlexArgs = new ActionFlexArgs();
- private final ActionFreezeArgs actionFreezeArgs = new ActionFreezeArgs();
- private final ActionHelpArgs actionHelpArgs = new ActionHelpArgs();
- private final ActionKeytabArgs actionKeytabArgs = new ActionKeytabArgs();
- private final ActionListArgs actionListArgs = new ActionListArgs();
- private final ActionRegistryArgs actionRegistryArgs = new ActionRegistryArgs();
- private final ActionResolveArgs actionResolveArgs = new ActionResolveArgs();
- private final ActionResourceArgs actionResourceArgs = new ActionResourceArgs();
- private final ActionStatusArgs actionStatusArgs = new ActionStatusArgs();
- private final ActionThawArgs actionThawArgs = new ActionThawArgs();
- private final ActionTokensArgs actionTokenArgs = new ActionTokensArgs();
- private final ActionUpdateArgs actionUpdateArgs = new ActionUpdateArgs();
-
- public ClientArgs(String[] args) {
- super(args);
- }
-
- public ClientArgs(Collection args) {
- super(args);
- }
-
- @Override
- protected void addActionArguments() {
-
- addActions(
- actionBuildArgs,
- actionCreateArgs,
- actionDependencyArgs,
- actionDestroyArgs,
- actionFlexArgs,
- actionFreezeArgs,
- actionHelpArgs,
- actionStatusArgs,
- actionThawArgs
- );
- }
-
- @Override
- public void applyDefinitions(Configuration conf) throws
- BadCommandArgumentsException {
- super.applyDefinitions(conf);
- }
-
-
- public ActionBuildArgs getActionBuildArgs() {
- return actionBuildArgs;
- }
-
- public ActionUpdateArgs getActionUpdateArgs() {
- return actionUpdateArgs;
- }
-
- public ActionCreateArgs getActionCreateArgs() {
- return actionCreateArgs;
- }
-
- public ActionDependencyArgs getActionDependencyArgs() {
- return actionDependencyArgs;
- }
-
- public ActionFlexArgs getActionFlexArgs() {
- return actionFlexArgs;
- }
-
- /**
- * Look at the chosen action and bind it as the core action for the operation.
- * @throws SliderException bad argument or similar
- */
- @Override
- public void applyAction() throws SliderException {
- String action = getAction();
- if (SliderUtils.isUnset(action)) {
- action = ACTION_HELP;
- }
- switch (action) {
- case ACTION_BUILD:
- bindCoreAction(actionBuildArgs);
- break;
-
- case ACTION_CREATE:
- bindCoreAction(actionCreateArgs);
- break;
-
- case ACTION_STOP:
- bindCoreAction(actionFreezeArgs);
- break;
-
- case ACTION_START:
- bindCoreAction(actionThawArgs);
- break;
-
- case ACTION_DEPENDENCY:
- bindCoreAction(actionDependencyArgs);
- break;
-
- case ACTION_DESTROY:
- bindCoreAction(actionDestroyArgs);
- break;
-
- case ACTION_EXISTS:
- bindCoreAction(actionExistsArgs);
- break;
-
- case ACTION_FLEX:
- bindCoreAction(actionFlexArgs);
- break;
-
- case ACTION_HELP:
- bindCoreAction(actionHelpArgs);
- break;
-
- case ACTION_KEYTAB:
- bindCoreAction(actionKeytabArgs);
- break;
-
- case ACTION_LIST:
- bindCoreAction(actionListArgs);
- break;
-
- case ACTION_REGISTRY:
- bindCoreAction(actionRegistryArgs);
- break;
-
- case ACTION_RESOLVE:
- bindCoreAction(actionResolveArgs);
- break;
-
- case ACTION_RESOURCE:
- bindCoreAction(actionResourceArgs);
- break;
-
- case ACTION_STATUS:
- bindCoreAction(actionStatusArgs);
- break;
-
- case ACTION_TOKENS:
- bindCoreAction(actionTokenArgs);
- break;
-
- case ACTION_UPDATE:
- bindCoreAction(actionUpdateArgs);
- break;
- default:
- throw new BadCommandArgumentsException(ErrorStrings.ERROR_UNKNOWN_ACTION
- + " " + action);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java
deleted file mode 100644
index 145b44a..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java
+++ /dev/null
@@ -1,245 +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.client.params;
-
-import com.beust.jcommander.JCommander;
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.ParameterDescription;
-import com.beust.jcommander.ParameterException;
-
-import org.apache.hadoop.conf.Configuration;
-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;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class contains the common argument set for all tne entry points,
- * and the core parsing logic to verify that the action is on the list
- * of allowed actions -and that the remaining number of arguments is
- * in the range allowed
- */
-
-public abstract class CommonArgs extends ArgOps implements SliderActions,
- Arguments {
-
- protected static final Logger log = LoggerFactory.getLogger(CommonArgs.class);
-
-
- private static final int DIFF_BETWEEN_DESCIPTION_AND_COMMAND_NAME = 30;
-
-
- @Parameter(names = ARG_HELP, help = true)
- public boolean help;
-
-
- /**
- -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.
-
- */
-
- public Map<String, String> definitionMap = new HashMap<String, String>();
- /**
- * System properties
- */
- public Map<String, String> syspropsMap = new HashMap<String, String>();
-
-
- /**
- * fields
- */
- public final JCommander commander;
- private final String[] args;
-
- private AbstractActionArgs coreAction;
-
- /**
- * 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 coreAction.getServiceName();
- }
-
- protected CommonArgs(String[] args) {
- this.args = args;
- commander = new JCommander(this);
- }
-
- protected CommonArgs(Collection args) {
- List<String> argsAsStrings = SliderUtils.collectionToStringList(args);
- this.args = argsAsStrings.toArray(new String[argsAsStrings.size()]);
- commander = new JCommander(this);
- }
-
- public String usage() {
- return usage(this, null);
- }
-
- public static String usage(CommonArgs serviceArgs, String commandOfInterest) {
- String result = null;
- StringBuilder helperMessage = new StringBuilder();
- 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: service COMMAND [options]\n");
- helperMessage.append("where COMMAND is one of\n");
- for (String jcommand : serviceArgs.commander.getCommands().keySet()) {
- helperMessage.append(String.format("\t%-"
- + DIFF_BETWEEN_DESCIPTION_AND_COMMAND_NAME + "s%s", jcommand,
- serviceArgs.commander.getCommandDescription(jcommand) + "\n"));
- }
- helperMessage
- .append("Most commands print help when invoked without parameters or with --help");
- result = helperMessage.toString();
- } else {
- helperMessage.append("\nUsage: service ").append(commandOfInterest);
- helperMessage.append(serviceArgs.coreAction.getMinParams() > 0 ? " <service>" : "");
- helperMessage.append("\n");
- for (ParameterDescription paramDesc : serviceArgs.commander.getCommands()
- .get(commandOfInterest).getParameters()) {
- String optional = paramDesc.getParameter().required() ? " (required)"
- : " (optional)";
- String paramName = paramDesc.getParameterized().getType() == Boolean.TYPE ? paramDesc
- .getLongestName() : paramDesc.getLongestName() + " <"
- + paramDesc.getParameterized().getName() + ">";
- helperMessage.append(String.format("\t%-"
- + DIFF_BETWEEN_DESCIPTION_AND_COMMAND_NAME + "s%s", paramName,
- paramDesc.getDescription() + optional + "\n"));
- result = helperMessage.toString();
- }
- }
- return result;
- }
-
- /**
- * Parse routine -includes registering the action-specific argument classes
- * and postprocess it
- * @throws SliderException on any problem
- */
- public void parse() throws SliderException {
- addActionArguments();
- try {
- commander.parse(args);
- } catch (ParameterException e) {
- commander.usage(args[0]);
- throw e;
- }
- //now copy back to this class some of the attributes that are common to all
- //actions
- postProcess();
- }
-
-
- protected void addActions(Object... actions) {
- for (Object action : actions) {
- commander.addCommand(action);
- }
- }
-
- /**
- * Override point to add a set of actions
- */
- protected void addActionArguments() {
-
- }
-
- /**
- * validate args via {@link #validate()}
- * then postprocess the arguments
- */
- public void postProcess() throws SliderException {
- applyAction();
- validate();
-
- //apply entry set
- for (Map.Entry<String, String> entry : syspropsMap.entrySet()) {
- System.setProperty(entry.getKey(), entry.getValue());
- }
- }
-
-
- /**
- * Implementors must implement their action apply routine here
- */
- public abstract void applyAction() throws SliderException;
-
-
- /**
- * Bind the core action; this extracts any attributes that are used
- * across routines
- * @param action action to bind
- */
- protected void bindCoreAction(AbstractActionArgs action) {
- coreAction = action;
-
- splitPairs(coreAction.definitions, definitionMap);
- splitPairs(coreAction.sysprops, syspropsMap);
- }
-
- /**
- * Validate the arguments against the action requested
- */
- public void validate() throws BadCommandArgumentsException, UsageException {
- if (coreAction == null) {
- throw new UsageException(ErrorStrings.ERROR_NO_ACTION + usage());
- }
- log.debug("action={}", getAction());
- // let the action validate itself
- try {
- coreAction.validate();
- } catch (BadCommandArgumentsException e) {
- String badArgMsgBuilder =
- e.getMessage() + System.lineSeparator() + usage(this,
- coreAction.getActionName());
- throw new BadCommandArgumentsException(badArgMsgBuilder);
- }
- }
-
- /**
- * Apply all the definitions on the command line to the configuration
- * @param conf config
- */
- public void applyDefinitions(Configuration conf) throws
- BadCommandArgumentsException {
- applyDefinitions(definitionMap, conf);
- }
-
- public boolean isDebug() {
- return coreAction.debug;
- }
-
-
- public String getAction() {
- return commander.getParsedCommand();
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java
deleted file mode 100644
index b6cd0a1..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java
+++ /dev/null
@@ -1,52 +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.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;
-
-public class ComponentArgsDelegate extends AbstractArgsDelegate {
-
- /**
- * This is a listing of the roles to create
- */
- @Parameter(names = {ARG_COMPONENT, ARG_COMPONENT_SHORT},
- arity = 2,
- description = "--component <name> <count> e.g. +1 incr by 1, -2 decr by 2, and 3 makes final count 3",
- splitter = DontSplitArguments.class)
- public List<String> componentTuples = new ArrayList<>(0);
-
-
- /**
- * 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 convertTupleListToMap("component", componentTuples);
- }
-
- public List<String> getComponentTuples() {
- return componentTuples;
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java
deleted file mode 100644
index 85de615..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java
+++ /dev/null
@@ -1,34 +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.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/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java
deleted file mode 100644
index bf194b6..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java
+++ /dev/null
@@ -1,30 +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.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/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java
deleted file mode 100644
index d42510c..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.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.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 service report")
- public File outputFile;
-
- @Override
- public File getOutputFile() {
- return outputFile;
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java
deleted file mode 100644
index 7972716..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java
+++ /dev/null
@@ -1,66 +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.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/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java
deleted file mode 100644
index 040ac64..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java
+++ /dev/null
@@ -1,34 +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.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/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMArgs.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMArgs.java
deleted file mode 100644
index 800bb24..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMArgs.java
+++ /dev/null
@@ -1,50 +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.client.params;
-
-/**
- * Parameters sent by the Client to the AM
- */
-public class ServiceAMArgs extends CommonArgs {
-
- ServiceAMCreateAction createAction = new ServiceAMCreateAction();
-
- public ServiceAMArgs(String[] args) {
- super(args);
- }
-
- @Override
- protected void addActionArguments() {
- addActions(createAction);
- }
-
- // This is the path in hdfs to the service definition JSON file
- public String getServiceDefPath() {
- return createAction.serviceDefPath;
- }
-
- /**
- * Am binding is simple: there is only one action
- */
- @Override
- public void applyAction() {
- bindCoreAction(createAction);
- }
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMCreateAction.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMCreateAction.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMCreateAction.java
deleted file mode 100644
index 384e8ba..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ServiceAMCreateAction.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.hadoop.yarn.service.client.params;
-
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-@Parameters(commandNames = { SliderActions.ACTION_CREATE},
- commandDescription = SliderActions.DESCRIBE_ACTION_CREATE)
-
-public class ServiceAMCreateAction extends AbstractActionArgs {
-
- @Override
- public String getActionName() {
- return SliderActions.ACTION_CREATE;
- }
-
- @Parameter(names = ARG_SERVICE_DEF_PATH,
- description = "Path to the service definition JSON file", required = true)
- public String serviceDefPath;
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java
deleted file mode 100644
index 680bc0f..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java
+++ /dev/null
@@ -1,79 +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.client.params;
-
-/**
- * Actions by client
- */
-public interface SliderActions {
- String ACTION_BUILD = "build";
- String ACTION_CLIENT = "client";
- String ACTION_CREATE = "create";
- String ACTION_DEPENDENCY = "dependency";
- String ACTION_UPDATE = "update";
- String ACTION_UPGRADE = "upgrade";
- String ACTION_DESTROY = "destroy";
- String ACTION_EXISTS = "exists";
- String ACTION_FLEX = "flex";
- String ACTION_STOP = "stop";
- String ACTION_HELP = "help";
- String ACTION_INSTALL_KEYTAB = "install-keytab";
- String ACTION_KEYTAB = "keytab";
- String ACTION_LIST = "list";
-
- String ACTION_REGISTRY = "registry";
- String ACTION_RESOLVE = "resolve";
- String ACTION_RESOURCE = "resource";
- String ACTION_STATUS = "status";
- String ACTION_START = "start";
- String ACTION_TOKENS = "tokens";
-
- String DESCRIBE_ACTION_BUILD =
- "Build a service specification, but do not start it";
- String DESCRIBE_ACTION_CREATE =
- "Create a service, it's equivalent to first invoke build and then start";
- String DESCRIBE_ACTION_DEPENDENCY =
- "Yarn service framework dependency (libraries) management";
- String DESCRIBE_ACTION_UPDATE =
- "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 service, service must be stopped first before destroying.";
- String DESCRIBE_ACTION_EXISTS =
- "Probe for a service running";
- String DESCRIBE_ACTION_FLEX = "Flex a service's component by increasing or decreasing the number of containers.";
- String DESCRIBE_ACTION_FREEZE =
- "Stop a running service";
- String DESCRIBE_ACTION_KDIAG = "Diagnose Kerberos problems";
- String DESCRIBE_ACTION_HELP = "Print help information";
- String DESCRIBE_ACTION_LIST =
- "List running services";
- String DESCRIBE_ACTION_REGISTRY =
- "Query the registry of a service";
- String DESCRIBE_ACTION_STATUS =
- "Get the status of a service";
- String DESCRIBE_ACTION_THAW =
- "Start a service with pre-built specification or a previously stopped service";
- String DESCRIBE_ACTION_CLIENT = "Install the service 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_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/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java
deleted file mode 100644
index 86f3709..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java
+++ /dev/null
@@ -1,42 +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.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/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java
deleted file mode 100644
index f6afae6..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java
+++ /dev/null
@@ -1,24 +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.client.params;
-
-public interface WaitTimeAccessor {
- int getWaittime();
- void setWaittime(int waittime);
-}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java
index 7e53d18..2809dfb 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java
@@ -29,8 +29,6 @@ import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.yarn.api.ApplicationConstants;
import org.apache.hadoop.yarn.api.records.LocalResource;
-import org.apache.hadoop.yarn.service.client.params.Arguments;
-import org.apache.hadoop.yarn.service.client.params.SliderActions;
import org.apache.hadoop.yarn.service.conf.YarnServiceConstants;
import org.apache.hadoop.yarn.service.containerlaunch.ClasspathConstructor;
import org.apache.hadoop.yarn.service.exceptions.BadClusterStateException;
@@ -484,8 +482,8 @@ public final class SliderUtils {
classpath.addLibDir(YarnServiceConstants.DEPENDENCY_LOCALIZED_DIR_LINK);
} else {
log.info(
- "For faster submission of apps, upload dependencies using cmd {} {}",
- SliderActions.ACTION_DEPENDENCY, Arguments.ARG_UPLOAD);
+ "For faster submission of apps, upload dependencies using cmd " +
+ "enableFastLaunch");
}
classpath.addRemoteClasspathEnvVar();
classpath.append(ApplicationConstants.Environment.HADOOP_CONF_DIR.$$());
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ba7ed7b6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java
index 0498ebf..1f4581e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java
@@ -19,10 +19,10 @@ package org.apache.hadoop.yarn.service.client;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.yarn.client.api.AppAdminClient;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.service.api.records.Component;
import org.apache.hadoop.yarn.service.conf.ExampleAppJson;
-import org.apache.hadoop.yarn.service.client.params.ClientArgs;
import org.apache.hadoop.yarn.service.utils.ServiceApiUtil;
import org.apache.hadoop.yarn.service.utils.SliderFileSystem;
import org.junit.After;
@@ -36,7 +36,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import static org.apache.hadoop.yarn.service.client.params.Arguments.ARG_FILE;
import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.YARN_SERVICE_BASE_PATH;
/**
@@ -60,18 +59,10 @@ public class TestBuildExternalComponents {
// 2. check component names
private void buildAndCheckComponents(String appName, String appDef,
SliderFileSystem sfs, Set<String> names) throws Throwable {
- String[] args =
- { "build", ARG_FILE, ExampleAppJson.resourceName(appDef) };
- ClientArgs clientArgs = new ClientArgs(args);
- clientArgs.parse();
- ServiceCLI cli = new ServiceCLI() {
- @Override protected void createServiceClient() {
- client = new ServiceClient();
- client.init(conf);
- client.start();
- }
- };
- cli.exec(clientArgs);
+ AppAdminClient client = AppAdminClient.createAppAdminClient(AppAdminClient
+ .DEFAULT_TYPE, conf);
+ client.actionSave(ExampleAppJson.resourceName(appDef), null, null,
+ null);
// verify generated conf
List<Component> components =
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org