本文整理汇总了Java中com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration.set方法的典型用法代码示例。如果您正苦于以下问题:Java ModifiableHadoopConfiguration.set方法的具体用法?Java ModifiableHadoopConfiguration.set怎么用?Java ModifiableHadoopConfiguration.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration
的用法示例。
在下文中一共展示了ModifiableHadoopConfiguration.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRecordReaderWithVertexQueryFilterDirection
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public void testRecordReaderWithVertexQueryFilterDirection() throws Exception {
Configuration config = new Configuration();
ModifiableHadoopConfiguration faunusConf = ModifiableHadoopConfiguration.of(config);
faunusConf.set(TitanHadoopConfiguration.INPUT_VERTEX_QUERY_FILTER, "v.query().direction(OUT)");
GraphSONRecordReader reader = new GraphSONRecordReader(VertexQueryFilter.create(config));
reader.initialize(new FileSplit(new Path(GraphSONRecordReaderTest.class.getResource("graph-of-the-gods.json").toURI()), 0, Long.MAX_VALUE, new String[]{}),
HadoopCompatLoader.getCompat().newTask(new Configuration(), new TaskAttemptID()));
int counter = 0;
while (reader.nextKeyValue()) {
counter++;
assertEquals(reader.getCurrentKey(), NullWritable.get());
FaunusVertex vertex = reader.getCurrentValue();
assertEquals(Iterables.size(vertex.getEdges(Direction.IN)), 0);
}
assertEquals(counter, 12);
reader.close();
}
示例2: runScanJob
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public static ScanMetrics runScanJob(ScanJob scanJob, Configuration conf, String confRootField,
org.apache.hadoop.conf.Configuration hadoopConf,
Class<? extends InputFormat> inputFormat)
throws IOException, InterruptedException, ClassNotFoundException {
ModifiableHadoopConfiguration scanConf =
ModifiableHadoopConfiguration.of(TitanHadoopConfiguration.MAPRED_NS, hadoopConf);
tryToLoadClassByName(scanJob);
// Set the ScanJob class
scanConf.set(TitanHadoopConfiguration.SCAN_JOB_CLASS, scanJob.getClass().getName());
String jobName = HadoopScanMapper.class.getSimpleName() + "[" + scanJob + "]";
return runJob(conf, confRootField, hadoopConf, inputFormat, jobName, HadoopScanMapper.class);
}
示例3: runVertexScanJob
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public static ScanMetrics runVertexScanJob(VertexScanJob vertexScanJob, Configuration conf, String confRootField,
org.apache.hadoop.conf.Configuration hadoopConf,
Class<? extends InputFormat> inputFormat)
throws IOException, InterruptedException, ClassNotFoundException {
ModifiableHadoopConfiguration scanConf =
ModifiableHadoopConfiguration.of(TitanHadoopConfiguration.MAPRED_NS, hadoopConf);
tryToLoadClassByName(vertexScanJob);
// Set the VertexScanJob class
scanConf.set(TitanHadoopConfiguration.SCAN_JOB_CLASS, vertexScanJob.getClass().getName());
String jobName = HadoopScanMapper.class.getSimpleName() + "[" + vertexScanJob + "]";
return runJob(conf, confRootField, hadoopConf, inputFormat, jobName, HadoopVertexScanMapper.class);
}
示例4: createConfiguration
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public static org.apache.hadoop.conf.Configuration createConfiguration(final Direction direction, final String label, final int step, final String mergeWeightKey) {
ModifiableHadoopConfiguration c = ModifiableHadoopConfiguration.withoutResources();
c.set(LINK_STEP, step);
c.set(LINK_DIRECTION, direction);
c.set(LINK_LABEL, label);
if (null == mergeWeightKey) {
c.set(LINK_MERGE_DUPLICATES, false);
c.set(LINK_MERGE_WEIGHT_KEY, NO_WEIGHT_KEY);
} else {
c.set(LINK_MERGE_DUPLICATES, true);
c.set(LINK_MERGE_WEIGHT_KEY, mergeWeightKey);
}
c.set(PIPELINE_TRACK_PATHS, true);
return c.getHadoopConfiguration();
}
示例5: getTitanOutputConfig
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
/**
* Return an unfinished configuration that writes to Titan and
* includes custom and common faunus options. This config has
* no input settings (which should be added by the caller after
* this method returns).
*
* @return an incomplete configuration that outputs to titan
*/
private ModifiableHadoopConfiguration getTitanOutputConfig() {
ModifiableHadoopConfiguration faunusConf = new ModifiableHadoopConfiguration();
ModifiableConfiguration titanConf = getTitanConfiguration();
// Output
faunusConf.set(OUTPUT_FORMAT, getTitanOutputFormatClass().getCanonicalName());
faunusConf.setAllOutput(titanConf.getAll());
setCommonFaunusOptions(faunusConf);
setCustomFaunusOptions(faunusConf);
return faunusConf;
}
示例6: cassandraRepair
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public static void cassandraRepair(Properties titanProperties, String indexName, String indexType, String partitioner) throws Exception {
Configuration hadoopConfig = new Configuration();
ConfigHelper.setInputPartitioner(hadoopConfig, partitioner);
ModifiableHadoopConfiguration titanConf = ModifiableHadoopConfiguration.of(hadoopConfig);
titanConf.set(TitanHadoopConfiguration.INPUT_FORMAT, TitanCassandraInputFormat.class.getCanonicalName());
setCommonRepairOptions(titanConf, indexName, indexType);
copyPropertiesToInputAndOutputConf(hadoopConfig, titanProperties);
HadoopGraph hg = new HadoopGraph(hadoopConfig);
repairIndex(hg);
}
示例7: hbaseRepair
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public static void hbaseRepair(Properties titanProperties, String indexName, String indexType) throws Exception {
Configuration hadoopConfig = new Configuration();
ModifiableHadoopConfiguration titanConf = ModifiableHadoopConfiguration.of(hadoopConfig);
titanConf.set(TitanHadoopConfiguration.INPUT_FORMAT, TitanHBaseInputFormat.class.getCanonicalName());
setCommonRepairOptions(titanConf, indexName, indexType);
copyPropertiesToInputAndOutputConf(hadoopConfig, titanProperties);
HadoopGraph hg = new HadoopGraph(hadoopConfig);
repairIndex(hg);
}
示例8: setCommonRepairOptions
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
private static void setCommonRepairOptions(ModifiableHadoopConfiguration titanConf, String indexName, String indexType) {
titanConf.set(TitanHadoopConfiguration.INDEX_NAME, indexName);
titanConf.set(TitanHadoopConfiguration.INDEX_TYPE, indexType);
log.info("Set input format {}", titanConf.get(TitanHadoopConfiguration.INPUT_FORMAT));
titanConf.set(TitanHadoopConfiguration.OUTPUT_FORMAT, NullOutputFormat.class.getCanonicalName());
log.info("Set output format {}", titanConf.get(TitanHadoopConfiguration.OUTPUT_FORMAT));
titanConf.set(TitanHadoopConfiguration.SIDE_EFFECT_FORMAT, TextOutputFormat.class.getCanonicalName());
titanConf.set(TitanHadoopConfiguration.JOBDIR_LOCATION, "jobs");
titanConf.set(TitanHadoopConfiguration.JOBDIR_OVERWRITE, true);
}
示例9: setCommonFaunusOptions
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
private void setCommonFaunusOptions(ModifiableHadoopConfiguration faunusConf) {
// Side effect and misc
faunusConf.set(OUTPUT_INFER_SCHEMA, true);
faunusConf.set(PIPELINE_TRACK_PATHS, true);
faunusConf.set(PIPELINE_TRACK_STATE, true);
faunusConf.set(SIDE_EFFECT_FORMAT, TextOutputFormat.class.getCanonicalName());
faunusConf.set(JOBDIR_LOCATION, Joiner.on(File.separator).join("target", "test-data", "output"));
faunusConf.set(JOBDIR_OVERWRITE, true);
}
示例10: createConfiguration
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public static org.apache.hadoop.conf.Configuration createConfiguration(final Class<? extends Element> klass, final int step) {
ModifiableHadoopConfiguration c = ModifiableHadoopConfiguration.withoutResources();
c.set(BACK_FILTER_STEP, step);
c.set(BACK_FILTER_CLASS, klass.getCanonicalName());
c.set(PIPELINE_TRACK_PATHS, true);
return c.getHadoopConfiguration();
}
示例11: testVertexQueryConstruction
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
public void testVertexQueryConstruction() {
Configuration config = new Configuration();
ModifiableHadoopConfiguration faunusConf = ModifiableHadoopConfiguration.of(config);
faunusConf.set(TitanHadoopConfiguration.INPUT_VERTEX_QUERY_FILTER, "v.query().limit(0).direction(IN).labels('knows')");
VertexQueryFilter query = VertexQueryFilter.create(config);
assertTrue(query.doesFilter());
assertEquals(query.limit, 0);
assertEquals(query.hasContainers.size(), 0);
assertEquals(query.direction, Direction.IN);
assertEquals(query.labels.length, 1);
assertEquals(query.labels[0], "knows");
}
示例12: getCustomIncrementalCerberusLoad
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
private HadoopGraph getCustomIncrementalCerberusLoad() {
ModifiableHadoopConfiguration faunusConf = getTitanOutputConfig();
// Input
faunusConf.set(INPUT_FORMAT, GraphSONInputFormat.class.getCanonicalName());
faunusConf.set(INPUT_LOCATION, "target/test-classes/com/thinkaurelius/titan/hadoop/formats/graphson/extra-cerberus.json");
// Output (incremental loading)
faunusConf.set(OUTPUT_LOADER_SCRIPT_FILE, "target/test-classes/com/thinkaurelius/titan/hadoop/formats/graphson/incremental-custom-cerberus-load.groovy");
return new HadoopGraph(faunusConf.getHadoopConfiguration());
}
示例13: getNaiveIncrementalCerberusLoad
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
private HadoopGraph getNaiveIncrementalCerberusLoad() {
ModifiableHadoopConfiguration faunusConf = getTitanOutputConfig();
// Input
faunusConf.set(INPUT_FORMAT, GraphSONInputFormat.class.getCanonicalName());
faunusConf.set(INPUT_LOCATION, "target/test-classes/com/thinkaurelius/titan/hadoop/formats/graphson/extra-cerberus.json");
// Output (incremental loading)
faunusConf.set(OUTPUT_LOADER_SCRIPT_FILE, "target/test-classes/com/thinkaurelius/titan/hadoop/formats/graphson/incremental-naive-cerberus-load.groovy");
return new HadoopGraph(faunusConf.getHadoopConfiguration());
}
示例14: getIncrementalGraphSONToTitan
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
private HadoopGraph getIncrementalGraphSONToTitan() {
ModifiableHadoopConfiguration faunusConf = getTitanOutputConfig();
// Input
faunusConf.set(INPUT_FORMAT, GraphSONInputFormat.class.getCanonicalName());
faunusConf.set(INPUT_LOCATION, "target/test-classes/com/thinkaurelius/titan/hadoop/formats/graphson/graph-of-the-gods.json");
// Output (incremental loading)
faunusConf.set(OUTPUT_LOADER_SCRIPT_FILE, "target/test-classes/com/thinkaurelius/titan/hadoop/formats/graphson/incremental-load.groovy");
return new HadoopGraph(faunusConf.getHadoopConfiguration());
}
示例15: getGraphSONToTitan
import com.thinkaurelius.titan.hadoop.config.ModifiableHadoopConfiguration; //导入方法依赖的package包/类
private HadoopGraph getGraphSONToTitan() {
ModifiableHadoopConfiguration faunusConf = getTitanOutputConfig();
// Input
faunusConf.set(INPUT_FORMAT, GraphSONInputFormat.class.getCanonicalName());
faunusConf.set(INPUT_LOCATION, "target/test-classes/com/thinkaurelius/titan/hadoop/formats/graphson/graph-of-the-gods.json");
return new HadoopGraph(faunusConf.getHadoopConfiguration());
}