/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then an empty array is returned. * * @param name property name. * @return property value as an array of trimmed <code>String</code>s, * or empty array. */ public String[] getTrimmedStrings(String name) { String valueString = get(name); return StringUtils.getTrimmedStrings(valueString); }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then an empty array is returned. * * @param name property name. * @return property value as an array of trimmed <code>String</code>s, * or empty array. */ public String[] getTrimmedStrings(String name) { String valueString = get(name); return StringUtils.getTrimmedStrings(valueString); }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then default value is returned. * * @param name property name. * @param defaultValue The default value * @return property value as an array of trimmed <code>String</code>s, * or default value. */ public String[] getTrimmedStrings(String name, String... defaultValue) { String valueString = get(name); if (null == valueString) { return defaultValue; } else { return StringUtils.getTrimmedStrings(valueString); } }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then default value is returned. * * @param name property name. * @param defaultValue The default value * @return property value as an array of trimmed <code>String</code>s, * or default value. */ public String[] getTrimmedStrings(String name, String... defaultValue) { String valueString = get(name); if (null == valueString) { return defaultValue; } else { return StringUtils.getTrimmedStrings(valueString); } }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then an empty array is returned. * * @param name property name. * @return property value as an array of trimmed <code>String</code>s, * or empty array. */ public String[] getTrimmedStrings(String name) { String valueString = get(name); return StringUtils.getTrimmedStrings(valueString); }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then default value is returned. * * @param name property name. * @param defaultValue The default value * @return property value as an array of trimmed <code>String</code>s, * or default value. */ public String[] getTrimmedStrings(String name, String... defaultValue) { String valueString = get(name); if (null == valueString) { return defaultValue; } else { return StringUtils.getTrimmedStrings(valueString); } }
public ConfigRedactor(Configuration conf) { String sensitiveRegexList = conf.get( HADOOP_SECURITY_SENSITIVE_CONFIG_KEYS, HADOOP_SECURITY_SENSITIVE_CONFIG_KEYS_DEFAULT); List<String> sensitiveRegexes = Arrays.asList(StringUtils.getTrimmedStrings(sensitiveRegexList)); compiledPatterns = new ArrayList<Pattern>(); for (String regex : sensitiveRegexes) { Pattern p = Pattern.compile(regex); compiledPatterns.add(p); } }
/** * Splits a comma separated value <code>String</code>, trimming leading and * trailing whitespace on each value. Duplicate and empty values are removed. * * @param str a comma separated <String> with values, may be null * @return a <code>Collection</code> of <code>String</code> values, empty * Collection if null String input */ public static Collection<String> getTrimmedStringCollection(String str){ Set<String> set = new LinkedHashSet<String>( Arrays.asList(getTrimmedStrings(str))); set.remove(""); return set; }
public ApplicationClassLoader(URL[] urls, ClassLoader parent, List<String> systemClasses) { super(urls, parent); this.parent = parent; if (parent == null) { throw new IllegalArgumentException("No parent classloader!"); } // if the caller-specified system classes are null or empty, use the default this.systemClasses = (systemClasses == null || systemClasses.isEmpty()) ? Arrays.asList(StringUtils.getTrimmedStrings(SYSTEM_CLASSES_DEFAULT)) : systemClasses; LOG.info("classpath: " + Arrays.toString(urls)); LOG.info("system classes: " + this.systemClasses); }
public static String[] getTrimmedStringsVar(Configuration conf, ConfVars var) { assert (var.valClass == String.class) : var.varname; String[] result = conf.getTrimmedStrings(var.varname, (String[])null); if (result != null) { return result; } if (var.altName != null) { result = conf.getTrimmedStrings(var.altName, (String[])null); if (result != null) { return result; } } return org.apache.hadoop.util.StringUtils.getTrimmedStrings(var.defaultStrVal); }
String[] hosts = StringUtils.getTrimmedStrings(v); String str = readFirstTagValue(e, "timeout"); Integer timeout = (str == null)? null : Integer.parseInt(str);
String[] dirStrings = StringUtils.getTrimmedStrings(newLocalDirs); ctx.localFS = FileSystem.getLocal(conf); int numDirs = dirStrings.length;
List<String> systemClassesList = systemClasses == null ? null : Arrays.asList(StringUtils.getTrimmedStrings(systemClasses));
return createFileInTmp(prefix, suffix, "Local directories not specified", isDirectory); String[] localDirs = StringUtils.getTrimmedStrings(localDirList); if (localDirs.length == 0) { return createFileInTmp(prefix, suffix, "Local directories not specified", isDirectory);
/** * Get values from comma-separated config, to an array after extracting individual values. * @param conf Configuration to retrieve it from * @param var variable to retrieve * @return Array of String, containing each value from the comma-separated config, * or default value if value not in config file */ public static String[] getTrimmedStringsVar(Configuration conf, ConfVars var) { assert var.defaultVal.getClass() == String.class; String[] result = conf.getTrimmedStrings(var.varname, (String[]) null); if (result != null) { return result; } if (var.hiveName != null) { result = conf.getTrimmedStrings(var.hiveName, (String[]) null); if (result != null) { return result; } } return org.apache.hadoop.util.StringUtils.getTrimmedStrings((String) var.getDefaultVal()); }
StringUtils.getTrimmedStrings(tokenFileLocation)) { if (tokenFileName.length() > 0) { File tokenFile = new File(tokenFileName);
StringUtils.getTrimmedStrings(tokenFileLocation)) { if (tokenFileName.length() > 0) { File tokenFile = new File(tokenFileName);
private ServerConnector createHttpsChannelConnector( Server server, HttpConfiguration httpConfig) { httpConfig.setSecureScheme(HTTPS_SCHEME); httpConfig.addCustomizer(new SecureRequestCustomizer()); ServerConnector conn = createHttpChannelConnector(server, httpConfig); SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setNeedClientAuth(needsClientAuth); sslContextFactory.setKeyManagerPassword(keyPassword); if (keyStore != null) { sslContextFactory.setKeyStorePath(keyStore); sslContextFactory.setKeyStoreType(keyStoreType); sslContextFactory.setKeyStorePassword(keyStorePassword); } if (trustStore != null) { sslContextFactory.setTrustStorePath(trustStore); sslContextFactory.setTrustStoreType(trustStoreType); sslContextFactory.setTrustStorePassword(trustStorePassword); } if(null != excludeCiphers && !excludeCiphers.isEmpty()) { sslContextFactory.setExcludeCipherSuites( StringUtils.getTrimmedStrings(excludeCiphers)); LOG.info("Excluded Cipher List:" + excludeCiphers); } conn.addFirstConnectionFactory(new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString())); return conn; } }
new String[0] : StringUtils.getTrimmedStrings(localDirList); int rpcPort = HiveConf.getIntVar(daemonConf, ConfVars.LLAP_DAEMON_RPC_PORT); int mngPort = HiveConf.getIntVar(daemonConf, ConfVars.LLAP_MANAGEMENT_RPC_PORT);
private static Set<String> parseBlockPoolList(String string) { String[] addrs = StringUtils.getTrimmedStrings(string); return new HashSet<String>(Arrays.asList(addrs)); }