diff --git a/bin/ext/llapstatus.sh b/bin/ext/llapstatus.sh
index 2d2c8f4..23e6be6 100644
--- a/bin/ext/llapstatus.sh
+++ b/bin/ext/llapstatus.sh
@@ -17,7 +17,7 @@ THISSERVICE=llapstatus
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "
llapstatus () {
- CLASS=org.apache.hadoop.hive.llap.cli.LlapStatusServiceDriver;
+ CLASS=org.apache.hadoop.hive.llap.cli.status.LlapStatusServiceDriver;
if [ ! -f ${HIVE_LIB}/hive-cli-*.jar ]; then
echo "Missing Hive CLI Jar"
exit 3;
@@ -36,7 +36,7 @@ llapstatus () {
}
llapstatus_help () {
- CLASS=org.apache.hadoop.hive.llap.cli.LlapStatusServiceDriver;
+ CLASS=org.apache.hadoop.hive.llap.cli.status.LlapStatusServiceDriver;
execHiveCmd $CLASS "--help"
}
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapSliderUtils.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapSliderUtils.java
index af47b26..5ec9e1d 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapSliderUtils.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapSliderUtils.java
@@ -24,69 +24,24 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.yarn.api.records.ApplicationId;
-import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.exceptions.YarnException;
import org.apache.hadoop.yarn.service.api.records.Service;
import org.apache.hadoop.yarn.service.client.ServiceClient;
import org.apache.hadoop.yarn.service.utils.CoreFileSystem;
-import org.apache.hadoop.yarn.util.Clock;
-import org.apache.hadoop.yarn.util.SystemClock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LlapSliderUtils {
- private static final Logger LOG = LoggerFactory
- .getLogger(LlapSliderUtils.class);
+ private static final Logger LOG = LoggerFactory.getLogger(LlapSliderUtils.class);
private static final String LLAP_PACKAGE_DIR = ".yarn/package/LLAP/";
- public static ServiceClient createServiceClient(
- Configuration conf) throws Exception {
+ public static ServiceClient createServiceClient(Configuration conf) throws Exception {
ServiceClient serviceClient = new ServiceClient();
serviceClient.init(conf);
serviceClient.start();
return serviceClient;
}
- public static ApplicationReport getAppReport(String appName, ServiceClient serviceClient,
- long timeoutMs) throws
- LlapStatusServiceDriver.LlapStatusCliException {
- Clock clock = SystemClock.getInstance();
- long startTime = clock.getTime();
- long timeoutTime = timeoutMs < 0 ? Long.MAX_VALUE : (startTime + timeoutMs);
- ApplicationReport appReport = null;
- ApplicationId appId;
- try {
- appId = serviceClient.getAppId(appName);
- } catch (YarnException | IOException e) {
- return null;
- }
-
- while (appReport == null) {
- try {
- appReport = serviceClient.getYarnClient().getApplicationReport(appId);
- if (timeoutMs == 0) {
- // break immediately if timeout is 0
- break;
- }
- // Otherwise sleep, and try again.
- if (appReport == null) {
- long remainingTime = Math.min(timeoutTime - clock.getTime(), 500l);
- if (remainingTime > 0) {
- Thread.sleep(remainingTime);
- } else {
- break;
- }
- }
- } catch (Exception e) { // No point separating IOException vs YarnException vs others
- throw new LlapStatusServiceDriver.LlapStatusCliException(
- LlapStatusServiceDriver.ExitCode.YARN_ERROR,
- "Failed to get Yarn AppReport", e);
- }
- }
- return appReport;
- }
-
public static Service getService(Configuration conf, String name) {
LOG.info("Get service details for " + name);
ServiceClient sc;
@@ -112,10 +67,8 @@ public static Service getService(Configuration conf, String name) {
return service;
}
- public static void startCluster(Configuration conf, String name,
- String packageName, Path packageDir, String queue) {
- LOG.info("Starting cluster with " + name + ", "
- + packageName + ", " + queue + ", " + packageDir);
+ public static void startCluster(Configuration conf, String name, String packageName, Path packageDir, String queue) {
+ LOG.info("Starting cluster with " + name + ", " + packageName + ", " + queue + ", " + packageDir);
ServiceClient sc;
try {
sc = createServiceClient(conf);
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapStatusOptionsProcessor.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapStatusOptionsProcessor.java
deleted file mode 100644
index dca0c7b..0000000
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapStatusOptionsProcessor.java
+++ /dev/null
@@ -1,278 +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.hive.llap.cli;
-
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import jline.TerminalFactory;
-import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-
-import com.google.common.annotations.VisibleForTesting;
-
-public class LlapStatusOptionsProcessor {
-
- private static final String LLAPSTATUS_CONSTANT = "llapstatus";
-
- @VisibleForTesting
- public static final long FIND_YARN_APP_TIMEOUT_MS = 20 * 1000l; // 20seconds to wait for app to be visible
- @VisibleForTesting
- public static final long DEFAULT_STATUS_REFRESH_INTERVAL_MS = 1 * 1000l; // 1 seconds wait until subsequent status
- @VisibleForTesting
- public static final long DEFAULT_WATCH_MODE_TIMEOUT_MS = 5 * 60 * 1000l; // 5 minutes timeout for watch mode
- @VisibleForTesting
- public static final float DEFAULT_RUNNING_NODES_THRESHOLD = 1.0f;
-
- // TODO: why doesn't this use one of the existing options implementations?!
- enum OptionConstants {
-
- NAME("name", 'n', "LLAP cluster name", true),
- FIND_APP_TIMEOUT("findAppTimeout", 'f',
- "Amount of time(s) that the tool will sleep to wait for the YARN application to start. negative values=wait " +
- "forever, 0=Do not wait. default=" + TimeUnit.SECONDS.convert(FIND_YARN_APP_TIMEOUT_MS, TimeUnit.MILLISECONDS) +
- "s", true),
- OUTPUT_FILE("outputFile", 'o', "File to which output should be written (Default stdout)", true),
- WATCH_MODE("watch", 'w', "Watch mode waits until all LLAP daemons are running or subset of the nodes are " +
- "running (threshold can be specified via -r option) (Default wait until all nodes are running)", false),
- // This is a negative because we want the positive to be the default when nothing is specified.
- NOT_LAUNCHED("notlaunched", 'l', "In watch mode, do not assume that the application was "
- + "already launched if there's doubt (e.g. if the last application instance has failed).",
- false),
- RUNNING_NODES_THRESHOLD("runningNodesThreshold", 'r', "When watch mode is enabled (-w), wait until the " +
- "specified threshold of nodes are running (Default 1.0 which means 100% nodes are running)", true),
- STATUS_REFRESH_INTERVAL("refreshInterval", 'i', "Amount of time in seconds to wait until subsequent status checks" +
- " in watch mode. Valid only for watch mode. (Default " +
- TimeUnit.SECONDS.convert(DEFAULT_STATUS_REFRESH_INTERVAL_MS, TimeUnit.MILLISECONDS) + "s)", true),
- WATCH_MODE_TIMEOUT("watchTimeout", 't', "Exit watch mode if the desired state is not attained until the specified" +
- " timeout. (Default " + TimeUnit.SECONDS.convert(DEFAULT_WATCH_MODE_TIMEOUT_MS, TimeUnit.MILLISECONDS) +"s)",
- true),
- HIVECONF("hiveconf", null, "Use value for given property. Overridden by explicit parameters", "property=value", 2),
- HELP("help", 'H', "Print help information", false);
-
-
- private final String longOpt;
- private final Character shortOpt;
- private final String description;
- private final String argName;
- private final int numArgs;
-
- OptionConstants(String longOpt, char shortOpt, String description, boolean hasArgs) {
- this(longOpt, shortOpt, description, longOpt, hasArgs ? 1 : 0);
- }
-
- OptionConstants(String longOpt, Character shortOpt, String description, String argName, int numArgs) {
- this.longOpt = longOpt;
- this.shortOpt = shortOpt;
- this.description = description;
- this.argName = argName;
- this.numArgs = numArgs;
- }
-
- public String getLongOpt() {
- return longOpt;
- }
-
- public Character getShortOpt() {
- return shortOpt;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getArgName() {
- return argName;
- }
-
- public int getNumArgs() {
- return numArgs;
- }
- }
-
-
- public static class LlapStatusOptions {
- private final String name;
- private final Properties conf;
- private final long findAppTimeoutMs;
- private final String outputFile;
- private final long refreshIntervalMs;
- private final boolean watchMode;
- private final long watchTimeout;
- private final float runningNodesThreshold;
- private final boolean isLaunched;
-
- public LlapStatusOptions(final String name) {
- this(name, new Properties(), FIND_YARN_APP_TIMEOUT_MS, null, DEFAULT_STATUS_REFRESH_INTERVAL_MS, false,
- DEFAULT_WATCH_MODE_TIMEOUT_MS, DEFAULT_RUNNING_NODES_THRESHOLD, true);
- }
-
- public LlapStatusOptions(String name, Properties hiveProperties, long findAppTimeoutMs,
- String outputFile, long refreshIntervalMs,
- final boolean watchMode, final long watchTimeoutMs,
- final float runningNodesThreshold, final boolean isLaunched) {
- this.name = name;
- this.conf = hiveProperties;
- this.findAppTimeoutMs = findAppTimeoutMs;
- this.outputFile = outputFile;
- this.refreshIntervalMs = refreshIntervalMs;
- this.watchMode = watchMode;
- this.watchTimeout = watchTimeoutMs;
- this.runningNodesThreshold = runningNodesThreshold;
- this.isLaunched = isLaunched;
- }
-
- public String getName() {
- return name;
- }
-
- public Properties getConf() {
- return conf;
- }
-
- public long getFindAppTimeoutMs() {
- return findAppTimeoutMs;
- }
-
- public String getOutputFile() {
- return outputFile;
- }
-
- public long getRefreshIntervalMs() {
- return refreshIntervalMs;
- }
-
- public boolean isWatchMode() {
- return watchMode;
- }
-
- public boolean isLaunched() {
- return isLaunched;
- }
-
- public long getWatchTimeoutMs() {
- return watchTimeout;
- }
-
- public float getRunningNodesThreshold() {
- return runningNodesThreshold;
- }
- }
-
- private final Options options = new Options();
- private org.apache.commons.cli.CommandLine commandLine;
-
- public LlapStatusOptionsProcessor() {
-
- for (OptionConstants optionConstant : OptionConstants.values()) {
-
- OptionBuilder optionBuilder = OptionBuilder.hasArgs(optionConstant.getNumArgs())
- .withArgName(optionConstant.getArgName()).withLongOpt(optionConstant.getLongOpt())
- .withDescription(optionConstant.getDescription());
- if (optionConstant.getShortOpt() == null) {
- options.addOption(optionBuilder.create());
- } else {
- options.addOption(optionBuilder.create(optionConstant.getShortOpt()));
- }
- }
- }
-
- public LlapStatusOptions processOptions(String[] args) throws ParseException {
- commandLine = new GnuParser().parse(options, args);
- if (commandLine.hasOption(OptionConstants.HELP.getShortOpt())) {
- printUsage();
- return null;
- }
-
- String name = commandLine.getOptionValue(OptionConstants.NAME.getLongOpt());
-
- long findAppTimeoutMs = FIND_YARN_APP_TIMEOUT_MS;
- if (commandLine.hasOption(OptionConstants.FIND_APP_TIMEOUT.getLongOpt())) {
- findAppTimeoutMs = TimeUnit.MILLISECONDS.convert(Long.parseLong(
- commandLine.getOptionValue(OptionConstants.FIND_APP_TIMEOUT.getLongOpt())),
- TimeUnit.SECONDS);
- }
-
- Properties hiveConf;
- if (commandLine.hasOption(OptionConstants.HIVECONF.getLongOpt())) {
- hiveConf = commandLine.getOptionProperties(OptionConstants.HIVECONF.getLongOpt());
- } else {
- hiveConf = new Properties();
- }
-
- String outputFile = null;
- if (commandLine.hasOption(OptionConstants.OUTPUT_FILE.getLongOpt())) {
- outputFile = commandLine.getOptionValue(OptionConstants.OUTPUT_FILE.getLongOpt());
- }
-
- long refreshIntervalMs = DEFAULT_STATUS_REFRESH_INTERVAL_MS;
- if (commandLine.hasOption(OptionConstants.STATUS_REFRESH_INTERVAL.getLongOpt())) {
- long refreshIntervalSec = Long.parseLong(commandLine.getOptionValue(OptionConstants.STATUS_REFRESH_INTERVAL
- .getLongOpt()));
- if (refreshIntervalSec <= 0) {
- throw new IllegalArgumentException("Refresh interval should be >0");
- }
- refreshIntervalMs = TimeUnit.MILLISECONDS.convert(refreshIntervalSec, TimeUnit.SECONDS);
- }
-
- boolean watchMode = commandLine.hasOption(OptionConstants.WATCH_MODE.getLongOpt());
- long watchTimeoutMs = DEFAULT_WATCH_MODE_TIMEOUT_MS;
- if (commandLine.hasOption(OptionConstants.WATCH_MODE_TIMEOUT.getLongOpt())) {
- long watchTimeoutSec = Long.parseLong(commandLine.getOptionValue(
- OptionConstants.WATCH_MODE_TIMEOUT.getLongOpt()));
- if (watchTimeoutSec <= 0) {
- throw new IllegalArgumentException("Watch timeout should be >0");
- }
- watchTimeoutMs = TimeUnit.MILLISECONDS.convert(watchTimeoutSec, TimeUnit.SECONDS);
- }
-
- boolean isLaunched = !commandLine.hasOption(OptionConstants.NOT_LAUNCHED.getLongOpt());
-
- float runningNodesThreshold = DEFAULT_RUNNING_NODES_THRESHOLD;
- if (commandLine.hasOption(OptionConstants.RUNNING_NODES_THRESHOLD.getLongOpt())) {
- runningNodesThreshold = Float.parseFloat(commandLine.getOptionValue(
- OptionConstants.RUNNING_NODES_THRESHOLD.getLongOpt()));
- if (runningNodesThreshold < 0.0f || runningNodesThreshold > 1.0f) {
- throw new IllegalArgumentException(
- "Running nodes threshold value should be between 0.0 and 1.0 (inclusive)");
- }
- }
- return new LlapStatusOptions(name, hiveConf, findAppTimeoutMs, outputFile, refreshIntervalMs,
- watchMode, watchTimeoutMs, runningNodesThreshold, isLaunched);
- }
-
-
- public static void printUsage() {
- HelpFormatter hf = new HelpFormatter();
- try {
- int width = hf.getWidth();
- int jlineWidth = TerminalFactory.get().getWidth();
- width = Math.min(160, Math.max(jlineWidth, width)); // Ignore potentially incorrect values
- hf.setWidth(width);
- } catch (Throwable t) { // Ignore
- }
-
- LlapStatusOptionsProcessor optionsProcessor = new LlapStatusOptionsProcessor();
- hf.printHelp(LLAPSTATUS_CONSTANT, optionsProcessor.options);
- }
-
-}
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapStatusServiceDriver.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapStatusServiceDriver.java
deleted file mode 100644
index a521799..0000000
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapStatusServiceDriver.java
+++ /dev/null
@@ -1,811 +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.hive.llap.cli;
-
-
-import com.google.common.annotations.VisibleForTesting;
-import java.io.BufferedOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.text.DecimalFormat;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
-import org.apache.hadoop.hive.common.classification.InterfaceAudience;
-import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.llap.cli.LlapStatusOptionsProcessor.LlapStatusOptions;
-import org.apache.hadoop.hive.llap.cli.status.LlapStatusHelpers;
-import org.apache.hadoop.hive.llap.cli.status.LlapStatusHelpers.AppStatusBuilder;
-import org.apache.hadoop.hive.llap.cli.status.LlapStatusHelpers.LlapInstance;
-import org.apache.hadoop.hive.llap.cli.status.LlapStatusHelpers.State;
-import org.apache.hadoop.hive.llap.configuration.LlapDaemonConfiguration;
-import org.apache.hadoop.hive.llap.registry.LlapServiceInstance;
-import org.apache.hadoop.hive.llap.registry.impl.LlapRegistryService;
-import org.apache.hadoop.hive.ql.session.SessionState;
-import org.apache.hadoop.yarn.api.records.ApplicationReport;
-import org.apache.hadoop.yarn.api.records.ContainerExitStatus;
-import org.apache.hadoop.yarn.conf.YarnConfiguration;
-import org.apache.hadoop.yarn.exceptions.YarnException;
-import org.apache.hadoop.yarn.service.api.records.Container;
-import org.apache.hadoop.yarn.service.api.records.Service;
-import org.apache.hadoop.yarn.service.api.records.ServiceState;
-import org.apache.hadoop.yarn.service.client.ServiceClient;
-import org.apache.hadoop.yarn.util.Clock;
-import org.apache.hadoop.yarn.util.SystemClock;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.SerializationConfig;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LlapStatusServiceDriver {
- private static final Logger LOG = LoggerFactory.getLogger(LlapStatusServiceDriver.class);
- private static final Logger CONSOLE_LOGGER = LoggerFactory.getLogger("LlapStatusServiceDriverConsole");
-
- private static final EnumSet NO_YARN_SERVICE_INFO_STATES = EnumSet.of(
- State.APP_NOT_FOUND, State.COMPLETE, State.LAUNCHING);
- private static final EnumSet LAUNCHING_STATES = EnumSet.of(
- State.LAUNCHING, State.RUNNING_PARTIAL, State.RUNNING_ALL);
-
- // Defining a bunch of configs here instead of in HiveConf. These are experimental, and mainly
- // for use when retry handling is fixed in Yarn/Hadoop
-
- private static final String CONF_PREFIX = "hive.llapcli.";
-
- // The following two keys should ideally be used to control RM connect timeouts. However,
- // they don't seem to work. The IPC timeout needs to be set instead.
- @InterfaceAudience.Private
- private static final String CONFIG_YARN_RM_TIMEOUT_MAX_WAIT_MS = CONF_PREFIX + "yarn.rm.connect.max-wait-ms";
- private static final long CONFIG_YARN_RM_TIMEOUT_MAX_WAIT_MS_DEFAULT = 10000l;
- @InterfaceAudience.Private
- private static final String CONFIG_YARN_RM_RETRY_INTERVAL_MS = CONF_PREFIX + "yarn.rm.connect.retry-interval.ms";
- private static final long CONFIG_YARN_RM_RETRY_INTERVAL_MS_DEFAULT = 5000l;
-
- // As of Hadoop 2.7 - this is what controls the RM timeout.
- @InterfaceAudience.Private
- private static final String CONFIG_IPC_CLIENT_CONNECT_MAX_RETRIES = CONF_PREFIX + "ipc.client.max-retries";
- private static final int CONFIG_IPC_CLIENT_CONNECT_MAX_RETRIES_DEFAULT = 2;
- @InterfaceAudience.Private
- private static final String CONFIG_IPC_CLIENT_CONNECT_RETRY_INTERVAL_MS =
- CONF_PREFIX + "ipc.client.connect.retry-interval-ms";
- private static final long CONFIG_IPC_CLIENT_CONNECT_RETRY_INTERVAL_MS_DEFAULT = 1500l;
-
- // As of Hadoop 2.8 - this timeout spec behaves in a strnage manner. "2000,1" means 2000s with 1 retry.
- // However it does this - but does it thrice. Essentially - #retries+2 is the number of times the entire config
- // is retried. "2000,1" means 3 retries - each with 1 retry with a random 2000ms sleep.
- @InterfaceAudience.Private
- private static final String CONFIG_TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_RETRY_POLICY_SPEC =
- CONF_PREFIX + "timeline.service.fs-store.retry.policy.spec";
- private static final String
- CONFIG_TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_RETRY_POLICY_SPEC_DEFAULT = "2000, 1";
-
- private static final String CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS = CONF_PREFIX + "zk-registry.timeout-ms";
- private static final long CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS_DEFAULT = 20000l;
-
- private static final long LOG_SUMMARY_INTERVAL = 15000L; // Log summary every ~15 seconds.
- private static final String LLAP_KEY = "llap";
-
- private final Configuration conf;
- private String appName = null;
- private String applicationId = null;
- private ServiceClient serviceClient = null;
- private Configuration llapRegistryConf = null;
- private LlapRegistryService llapRegistry = null;
-
- private AppStatusBuilder appStatusBuilder;
-
- public LlapStatusServiceDriver() {
- SessionState ss = SessionState.get();
- conf = (ss != null) ? ss.getConf() : new HiveConf(SessionState.class);
- setupConf();
- }
-
- private void setupConf() {
- for (String f : LlapDaemonConfiguration.DAEMON_CONFIGS) {
- conf.addResource(f);
- }
- conf.reloadConfiguration();
-
- // Setup timeouts for various services.
-
- // Once we move to a Hadoop-2.8 dependency, the following paramteer can be used.
- // conf.set(YarnConfiguration.TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_RETRY_POLICY_SPEC);
- conf.set("yarn.timeline-service.entity-group-fs-store.retry-policy-spec",
- conf.get(CONFIG_TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_RETRY_POLICY_SPEC,
- CONFIG_TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_RETRY_POLICY_SPEC_DEFAULT));
-
- conf.setLong(YarnConfiguration.RESOURCEMANAGER_CONNECT_MAX_WAIT_MS,
- conf.getLong(CONFIG_YARN_RM_TIMEOUT_MAX_WAIT_MS, CONFIG_YARN_RM_TIMEOUT_MAX_WAIT_MS_DEFAULT));
- conf.setLong(YarnConfiguration.RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS,
- conf.getLong(CONFIG_YARN_RM_RETRY_INTERVAL_MS, CONFIG_YARN_RM_RETRY_INTERVAL_MS_DEFAULT));
-
- conf.setInt(CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY,
- conf.getInt(CONFIG_IPC_CLIENT_CONNECT_MAX_RETRIES, CONFIG_IPC_CLIENT_CONNECT_MAX_RETRIES_DEFAULT));
- conf.setLong(CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_RETRY_INTERVAL_KEY,
- conf.getLong(CONFIG_IPC_CLIENT_CONNECT_RETRY_INTERVAL_MS, CONFIG_IPC_CLIENT_CONNECT_RETRY_INTERVAL_MS_DEFAULT));
-
- HiveConf.setVar(conf, HiveConf.ConfVars.HIVE_ZOOKEEPER_SESSION_TIMEOUT, (
- conf.getLong(CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS, CONFIG_LLAP_ZK_REGISTRY_TIMEOUT_MS_DEFAULT) + "ms"));
-
- llapRegistryConf = new Configuration(conf);
- }
-
- /**
- * Parse command line options.
- *
- * @return command line options.
- */
- @VisibleForTesting
- public LlapStatusOptions parseOptions(String[] args) throws LlapStatusCliException {
-
- LlapStatusOptionsProcessor optionsProcessor = new LlapStatusOptionsProcessor();
- LlapStatusOptions options;
- try {
- options = optionsProcessor.processOptions(args);
- return options;
- } catch (Exception e) {
- LOG.info("Failed to parse arguments", e);
- throw new LlapStatusCliException(ExitCode.INCORRECT_USAGE, "Incorrect usage");
- }
- }
-
- public int run(LlapStatusOptions options, long watchTimeoutMs) {
- appStatusBuilder = new AppStatusBuilder();
- try {
- if (appName == null) {
- // user provided configs
- for (Map.Entry