本文整理匯總了Java中org.apache.commons.configuration.BaseConfiguration.setDelimiterParsingDisabled方法的典型用法代碼示例。如果您正苦於以下問題:Java BaseConfiguration.setDelimiterParsingDisabled方法的具體用法?Java BaseConfiguration.setDelimiterParsingDisabled怎麽用?Java BaseConfiguration.setDelimiterParsingDisabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.configuration.BaseConfiguration
的用法示例。
在下文中一共展示了BaseConfiguration.setDelimiterParsingDisabled方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: open
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
public static TorcGraph open(String graphName) {
Map<String, String> env = System.getenv();
BaseConfiguration config = new BaseConfiguration();
config.setDelimiterParsingDisabled(true);
config.setProperty(TorcGraph.CONFIG_GRAPH_NAME, graphName);
config.setProperty(TorcGraph.CONFIG_COORD_LOCATOR,
env.get("RAMCLOUD_COORDINATOR_LOCATOR"));
if (env.containsKey("RAMCLOUD_SERVERS")) {
config.setProperty(TorcGraph.CONFIG_NUM_MASTER_SERVERS,
env.get("RAMCLOUD_SERVERS"));
}
return open(config);
}
示例2: program
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
@Override
public GraphComputer program(final VertexProgram vertexProgram) {
super.program(vertexProgram);
this.memory.addVertexProgramMemoryComputeKeys(this.vertexProgram);
final BaseConfiguration apacheConfiguration = new BaseConfiguration();
apacheConfiguration.setDelimiterParsingDisabled(true);
vertexProgram.storeState(apacheConfiguration);
IteratorUtils.fill(apacheConfiguration.getKeys(), this.vertexProgramConfigurationKeys);
ConfUtil.mergeApacheIntoHadoopConfiguration(apacheConfiguration, this.giraphConfiguration);
this.vertexProgram.getMessageCombiner().ifPresent(combiner -> this.giraphConfiguration.setMessageCombinerClass(GiraphMessageCombiner.class));
return this;
}
示例3: makeApacheConfiguration
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
private static Configuration makeApacheConfiguration(final SparkConf sparkConfiguration) {
final BaseConfiguration apacheConfiguration = new BaseConfiguration();
apacheConfiguration.setDelimiterParsingDisabled(true);
for (final Tuple2<String, String> tuple : sparkConfiguration.getAll()) {
apacheConfiguration.setProperty(tuple._1(), tuple._2());
}
return apacheConfiguration;
}
示例4: getBaseConfiguration
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
protected Configuration getBaseConfiguration() {
final BaseConfiguration configuration = new BaseConfiguration();
configuration.setDelimiterParsingDisabled(true);
configuration.setProperty("spark.master", "local[4]");
configuration.setProperty(Constants.SPARK_SERIALIZER, GryoSerializer.class.getCanonicalName());
configuration.setProperty("spark.kryo.registrationRequired", true);
configuration.setProperty(Graph.GRAPH, HadoopGraph.class.getName());
configuration.setProperty(Constants.GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE, false);
return configuration;
}
示例5: TitanDbConnectionState
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
public TitanDbConnectionState(Map<String, String> props) {
BaseConfiguration config = new BaseConfiguration();
config.setDelimiterParsingDisabled(true);
/*
* Extract parameters from properties map.
*/
String cassandraLocator;
if (props.containsKey("cassandraLocator")) {
cassandraLocator = props.get("cassandraLocator");
} else {
cassandraLocator = "127.0.0.1";
}
String graphName;
if (props.containsKey("graphName")) {
graphName = props.get("graphName");
} else {
graphName = "default";
}
config.setProperty("storage.backend", "cassandra");
config.setProperty("storage.hostname", cassandraLocator);
config.setProperty("storage.cassandra.keyspace", graphName);
client = TitanFactory.open(config);
}
示例6: TorcDbConnectionState
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
public TorcDbConnectionState(Map<String, String> props) {
BaseConfiguration config = new BaseConfiguration();
config.setDelimiterParsingDisabled(true);
/*
* Extract parameters from properties map.
*/
String coordinatorLocator;
if (props.containsKey("coordinatorLocator")) {
coordinatorLocator = props.get("coordinatorLocator");
} else {
coordinatorLocator = "tcp:host=127.0.0.1,port=12246";
}
String graphName;
if (props.containsKey("graphName")) {
graphName = props.get("graphName");
} else {
graphName = "default";
}
config.setProperty(
TorcGraph.CONFIG_COORD_LOCATOR,
coordinatorLocator);
config.setProperty(
TorcGraph.CONFIG_GRAPH_NAME,
graphName);
this.client = TorcGraph.open(config);
}
示例7: getSystemPropertiesConfiguration
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
/**
* Generate a {@link Configuration} from the {@link System#getProperties}.
* Only those properties with specified prefix key are aggregated.
* If the prefix and a . should be removed, then trim prefix.
*
* @param prefix the prefix of the keys to include in the configuration
* @param trimPrefix whether to trim the prefix + . from the key
* @return a configuration generated from the System properties
*/
public static Configuration getSystemPropertiesConfiguration(final String prefix, final boolean trimPrefix) {
final BaseConfiguration apacheConfiguration = new BaseConfiguration();
apacheConfiguration.setDelimiterParsingDisabled(true);
for (final Map.Entry<Object, Object> entry : System.getProperties().entrySet()) {
final String key = entry.getKey().toString();
final Object value = entry.getValue();
if (key.startsWith(prefix + "."))
apacheConfiguration.setProperty(trimPrefix ? key.substring(prefix.length() + 1) : key, value);
}
return apacheConfiguration;
}
示例8: getBaseConfiguration
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
protected Configuration getBaseConfiguration() {
final BaseConfiguration configuration = new BaseConfiguration();
configuration.setDelimiterParsingDisabled(true);
configuration.setProperty(SparkLauncher.SPARK_MASTER, "local[4]");
configuration.setProperty(Constants.SPARK_SERIALIZER, GryoSerializer.class.getCanonicalName());
configuration.setProperty(Constants.SPARK_KRYO_REGISTRATION_REQUIRED, true);
configuration.setProperty(Graph.GRAPH, HadoopGraph.class.getName());
configuration.setProperty(Constants.GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE, false);
return configuration;
}
示例9: makeApacheConfiguration
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
public static org.apache.commons.configuration.Configuration makeApacheConfiguration(final Configuration hadoopConfiguration) {
final BaseConfiguration apacheConfiguration = new BaseConfiguration();
apacheConfiguration.setDelimiterParsingDisabled(true);
hadoopConfiguration.iterator().forEachRemaining(e -> apacheConfiguration.setProperty(e.getKey(), e.getValue()));
return apacheConfiguration;
}
示例10: executeMapReduceJob
import org.apache.commons.configuration.BaseConfiguration; //導入方法依賴的package包/類
public static void executeMapReduceJob(final MapReduce mapReduce, final Memory.Admin memory, final Configuration configuration) throws IOException, ClassNotFoundException, InterruptedException {
final Configuration newConfiguration = new Configuration(configuration);
final boolean vertexProgramExists = newConfiguration.get(VertexProgram.VERTEX_PROGRAM, null) != null;
if (vertexProgramExists) {
newConfiguration.set(Constants.GREMLIN_HADOOP_GRAPH_READER, InputOutputHelper.getInputFormat((Class) newConfiguration.getClass(Constants.GREMLIN_HADOOP_GRAPH_WRITER, OutputFormat.class)).getCanonicalName());
newConfiguration.unset(Constants.GREMLIN_HADOOP_GRAPH_FILTER);
}
final BaseConfiguration apacheConfiguration = new BaseConfiguration();
apacheConfiguration.setDelimiterParsingDisabled(true);
mapReduce.storeState(apacheConfiguration);
ConfUtil.mergeApacheIntoHadoopConfiguration(apacheConfiguration, newConfiguration);
final Optional<Comparator<?>> mapSort = mapReduce.getMapKeySort();
final Optional<Comparator<?>> reduceSort = mapReduce.getReduceKeySort();
newConfiguration.setClass(Constants.GREMLIN_HADOOP_MAP_REDUCE_CLASS, mapReduce.getClass(), MapReduce.class);
final Job job = Job.getInstance(newConfiguration, mapReduce.toString());
HadoopGraph.LOGGER.info(Constants.GREMLIN_HADOOP_JOB_PREFIX + mapReduce.toString());
job.setJarByClass(HadoopGraph.class);
if (mapSort.isPresent())
job.setSortComparatorClass(ObjectWritableComparator.ObjectWritableMapComparator.class);
job.setMapperClass(HadoopMap.class);
if (mapReduce.doStage(MapReduce.Stage.REDUCE)) {
if (mapReduce.doStage(MapReduce.Stage.COMBINE))
job.setCombinerClass(HadoopCombine.class);
job.setReducerClass(HadoopReduce.class);
} else {
if (mapSort.isPresent()) {
job.setReducerClass(Reducer.class);
job.setNumReduceTasks(1); // todo: is this necessary to ensure sorted order?
} else {
job.setNumReduceTasks(0);
}
}
job.setMapOutputKeyClass(ObjectWritable.class);
job.setMapOutputValueClass(ObjectWritable.class);
job.setOutputKeyClass(ObjectWritable.class);
job.setOutputValueClass(ObjectWritable.class);
job.setInputFormatClass(GraphFilterInputFormat.class);
job.setOutputFormatClass(SequenceFileOutputFormat.class);
// if there is no vertex program, then grab the graph from the input location
final Path graphPath;
if (vertexProgramExists) {
graphPath = new Path(Constants.getGraphLocation(newConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION)));
} else {
graphPath = new Path(newConfiguration.get(Constants.GREMLIN_HADOOP_INPUT_LOCATION));
}
Path memoryPath = new Path(Constants.getMemoryLocation(newConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION), (reduceSort.isPresent() ? mapReduce.getMemoryKey() + "-temp" : mapReduce.getMemoryKey())));
if (FileSystem.get(newConfiguration).exists(memoryPath)) {
FileSystem.get(newConfiguration).delete(memoryPath, true);
}
FileInputFormat.setInputPaths(job, graphPath);
FileOutputFormat.setOutputPath(job, memoryPath);
job.waitForCompletion(true);
// if there is a reduce sort, we need to run another identity MapReduce job
if (reduceSort.isPresent()) {
final Job reduceSortJob = Job.getInstance(newConfiguration, "ReduceKeySort");
reduceSortJob.setSortComparatorClass(ObjectWritableComparator.ObjectWritableReduceComparator.class);
reduceSortJob.setMapperClass(Mapper.class);
reduceSortJob.setReducerClass(Reducer.class);
reduceSortJob.setMapOutputKeyClass(ObjectWritable.class);
reduceSortJob.setMapOutputValueClass(ObjectWritable.class);
reduceSortJob.setOutputKeyClass(ObjectWritable.class);
reduceSortJob.setOutputValueClass(ObjectWritable.class);
reduceSortJob.setInputFormatClass(SequenceFileInputFormat.class);
reduceSortJob.setOutputFormatClass(SequenceFileOutputFormat.class);
reduceSortJob.setNumReduceTasks(1); // todo: is this necessary to ensure sorted order?
FileInputFormat.setInputPaths(reduceSortJob, memoryPath);
final Path sortedMemoryPath = new Path(Constants.getMemoryLocation(newConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION), mapReduce.getMemoryKey()));
FileOutputFormat.setOutputPath(reduceSortJob, sortedMemoryPath);
reduceSortJob.waitForCompletion(true);
FileSystem.get(newConfiguration).delete(memoryPath, true); // delete the temporary memory path
memoryPath = sortedMemoryPath;
}
mapReduce.addResultToMemory(memory, new ObjectWritableIterator(newConfiguration, memoryPath));
}