@Override public Iterable<String> getKeys(String prefix) { return asReadConfiguration().getKeys(prefix); }
public Map<ConfigElement.PathIdentifier,Object> getAll() { Map<ConfigElement.PathIdentifier,Object> result = Maps.newHashMap(); for (String key : config.getKeys("")) { Preconditions.checkArgument(StringUtils.isNotBlank(key)); try { final ConfigElement.PathIdentifier pid = ConfigElement.parse(getRootNamespace(),key); Preconditions.checkArgument(pid.element.isOption() && !pid.lastIsUmbrella); result.put(pid, get((ConfigOption) pid.element, pid.umbrellaElements)); } catch (IllegalArgumentException e) { log.debug("Ignored configuration entry for {} since it does not map to an option",key,e); } } return result; }
protected Set<String> getContainedNamespaces(ReadConfiguration config, ConfigNamespace umbrella, String... umbrellaElements) { verifyElement(umbrella); Preconditions.checkArgument(umbrella.isUmbrella()); String prefix = ConfigElement.getPath(umbrella,umbrellaElements); Set<String> result = Sets.newHashSet(); for (String key : config.getKeys(prefix)) { Preconditions.checkArgument(key.startsWith(prefix)); String sub = key.substring(prefix.length()+1).trim(); if (!sub.isEmpty()) { String ns = ConfigElement.getComponents(sub)[0]; Preconditions.checkArgument(StringUtils.isNotBlank(ns),"Invalid sub-namespace for key: %s",key); result.add(ns); } } return result; }
protected Map<String,Object> getSubset(ReadConfiguration config, ConfigNamespace umbrella, String... umbrellaElements) { verifyElement(umbrella); String prefix = umbrella.isRoot() ? "" : ConfigElement.getPath(umbrella, umbrellaElements); Map<String,Object> result = Maps.newHashMap(); for (String key : config.getKeys(prefix)) { Preconditions.checkArgument(key.startsWith(prefix)); // A zero-length prefix is a root. A positive-length prefix // is not a root and we should tack on an additional character // to consume the dot between the prefix and the rest of the key. int startIndex = umbrella.isRoot() ? prefix.length() : prefix.length() + 1; String sub = key.substring(startIndex).trim(); if (!sub.isEmpty()) { result.put(sub,config.get(key,Object.class)); } } return result; }
public org.apache.commons.configuration.Configuration getConfigurationAtOpen() { org.apache.commons.configuration.Configuration result = new BaseConfiguration(); for (String k : configurationAtOpen.getKeys("")) { result.setProperty(k, configurationAtOpen.get(k, Object.class)); } return result; }
public ScanMetrics run() throws InterruptedException, IOException, ClassNotFoundException { org.apache.hadoop.conf.Configuration hadoopConf = null != baseHadoopConf ? baseHadoopConf : new org.apache.hadoop.conf.Configuration(); if (null != janusgraphConf) { String prefix = ConfigElement.getPath(JanusGraphHadoopConfiguration.GRAPH_CONFIG_KEYS, true) + "."; for (String k : janusgraphConf.getKeys("")) { hadoopConf.set(prefix + k, janusgraphConf.get(k, Object.class).toString()); log.debug("Set: {}={}", prefix + k, janusgraphConf.get(k, Object.class).toString()); } } Preconditions.checkNotNull(hadoopConf); if (null != scanJob) { return HadoopScanRunner.runScanJob(scanJob, scanJobConf, scanJobConfRoot, hadoopConf, HBaseBinaryInputFormat.class); } else { return HadoopScanRunner.runVertexScanJob(vertexScanJob, scanJobConf, scanJobConfRoot, hadoopConf, HBaseBinaryInputFormat.class); } } }
public ScanMetrics run() throws InterruptedException, IOException, ClassNotFoundException { org.apache.hadoop.conf.Configuration hadoopConf = null != baseHadoopConf ? baseHadoopConf : new org.apache.hadoop.conf.Configuration(); if (null != janusgraphConf) { String prefix = ConfigElement.getPath(JanusGraphHadoopConfiguration.GRAPH_CONFIG_KEYS, true) + "."; for (String k : janusgraphConf.getKeys("")) { hadoopConf.set(prefix + k, janusgraphConf.get(k, Object.class).toString()); log.debug("Set: {}={}", prefix + k, janusgraphConf.get(k, Object.class).toString()); } } Preconditions.checkNotNull(hadoopConf); if (null != scanJob) { return HadoopScanRunner.runScanJob(scanJob, scanJobConf, scanJobConfRoot, hadoopConf, HBaseBinaryInputFormat.class); } else { return HadoopScanRunner.runVertexScanJob(vertexScanJob, scanJobConf, scanJobConfRoot, hadoopConf, HBaseBinaryInputFormat.class); } } }
for (String k : janusgraphConf.getKeys("")) { String prefix = ConfigElement.getPath(JanusGraphHadoopConfiguration.GRAPH_CONFIG_KEYS, true) + "."; hadoopConf.set(prefix + k, janusgraphConf.get(k, Object.class).toString());
for (String k : janusgraphConf.getKeys("")) { String prefix = ConfigElement.getPath(JanusGraphHadoopConfiguration.GRAPH_CONFIG_KEYS, true) + "."; hadoopConf.set(prefix + k, janusgraphConf.get(k, Object.class).toString());