public int getAvailablePort() throws SliderException, IOException { if (remainingPortsToCheck != null) { return getAvailablePortViaPortArray(); } else { return SliderUtils.getOpenPort(); } }
/** * probe to see if the RM scheduler is defined * @param conf config * @return true if the RM scheduler address is set to * something other than 0.0.0.0 */ public static boolean isRmSchedulerAddressDefined(Configuration conf) { InetSocketAddress address = getRmSchedulerAddress(conf); return isAddressDefined(address); }
public String buildClasspath() { return SliderUtils.join(pathElements, CLASS_PATH_SEPARATOR, false); }
/** * Build the environment map from a role option map, finding all entries * beginning with "env.", adding them to a map of (prefix-removed) * env vars * @param roleOpts role options. This can be null, meaning the * role is undefined * @return a possibly empty map of environment variables. */ public static Map<String, String> buildEnvMap(Map<String, String> roleOpts) { return buildEnvMap(roleOpts, null); }
/** * Load a Hadoop configuration from a local file. * @param file file to load * @return a configuration which hasn't actually had the load triggered * yet. * @throws FileNotFoundException file is not there * @throws IOException any other IO problem */ public static Configuration loadConfFromFile(File file) throws IOException { return loadConfFromFile(file, false); }
/** * return true if the limit has been exceeded * @return true if a limit was set and the current time * exceeds it. */ public boolean getLimitExceeded() { return limit >= 0 && ((now() - start) > limit); }
public static void validateOpenSSLEnv(Logger logger) throws IOException, SliderException { execCommand(OPENSSL, 0, 5000, logger, "OpenSSL", OPENSSL, "version"); }
/** * Set the time for an information (human, machine) timestamp pair of fields. * The human time is the time in millis converted via the {@link Date} class. * @param keyHumanTime name of human time key * @param keyMachineTime name of machine time * @param time timestamp */ public void setInfoTime(String keyHumanTime, String keyMachineTime, long time) { SliderUtils.setInfoTime(info, keyHumanTime, keyMachineTime, time); }
/** * return the HDFS path where the application package has been uploaded * manually or by using slider client (install package command) * * @param conf configuration * @return */ public static String getApplicationDefinitionPath(ConfTreeOperations conf) throws BadConfigException { return getApplicationDefinitionPath(conf, null); }
/** * Submit the AM tar.gz containing all dependencies and map it * @param providerResources provider map to build up * @param sliderFileSystem remote fs * @throws IOException, SliderException trouble copying to HDFS */ public static void putAmTarGzipAndUpdate( Map<String, LocalResource> providerResources, SliderFileSystem sliderFileSystem ) throws IOException, SliderException { sliderFileSystem.submitTarGzipAndUpdate(providerResources); }
@Override public String toString() { return appReportToString(report, "\n"); } }
/** * Merge any options * @param component dest values */ public void mergeInGlobal(Map<String, String> component) { SliderUtils.mergeMapsIgnoreDuplicateKeys(component, confTree.global); }
/** * Build the environment map from a role option map, finding all entries * beginning with "env.", adding them to a map of (prefix-removed) * env vars * @param roleOpts role options. This can be null, meaning the * role is undefined * @return a possibly empty map of environment variables. */ public static Map<String, String> buildEnvMap(Map<String, String> roleOpts) { return buildEnvMap(roleOpts, null); }
public int getAvailablePort() throws SliderException, IOException { if (remainingPortsToCheck != null) { return getAvailablePortViaPortArray(); } else { return SliderUtils.getOpenPort(); } }
/** * Join an collection of objects with a separator that appears after every * instance in the list -including at the end * @param collection collection to call toString() on each element * @param separator separator string * @return the joined entries */ public static String join(Collection collection, String separator) { return join(collection, separator, true); }
/** * Start * @return self */ public Duration start() { start = now(); return this; }
public static void validateOpenSSLEnv(Logger logger) throws IOException, SliderException { execCommand(OPENSSL, 0, 5000, logger, "SSL", OPENSSL, "version"); }
/** * Join an array of strings with a separator that appears after every * instance in the list -including at the end * @param collection strings * @param separator separator string * @return the joined entries */ public static String join(String[] collection, String separator) { return join(collection, separator, true); }
/** * Start * @return self */ public Duration start() { start = now(); return this; }
/** * Build the command line * @return the command line */ public String build() { return SliderUtils.join(argumentList, " "); }