本文整理汇总了Java中org.apache.giraph.conf.GiraphConfiguration.setLong方法的典型用法代码示例。如果您正苦于以下问题:Java GiraphConfiguration.setLong方法的具体用法?Java GiraphConfiguration.setLong怎么用?Java GiraphConfiguration.setLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.giraph.conf.GiraphConfiguration
的用法示例。
在下文中一共展示了GiraphConfiguration.setLong方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
CommandLine cmd) {
conf.setComputationClass(ShortestPathsComputation.class);
if (EDGES_CLASS.getOptionIntValue(cmd, 1) == 1) {
conf.setOutEdgesClass(ArrayListEdges.class);
} else {
conf.setOutEdgesClass(HashMapEdges.class);
}
LOG.info("Using class " + GiraphConstants.COMPUTATION_CLASS.get(conf));
conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
if (!NO_COMBINER.optionTurnedOn(cmd)) {
conf.setCombinerClass(MinimumDoubleCombiner.class);
}
conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd));
}
示例2: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
CommandLine cmd) {
conf.setComputationClass(RandomMessageComputation.class);
conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
conf.setWorkerContextClass(RandomMessageBenchmarkWorkerContext.class);
conf.setMasterComputeClass(RandomMessageBenchmarkMasterCompute.class);
conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd));
conf.setInt(SUPERSTEP_COUNT,
BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd));
conf.setInt(RandomMessageBenchmark.NUM_BYTES_PER_MESSAGE,
BYTES_PER_MESSAGE.getOptionIntValue(cmd));
conf.setInt(RandomMessageBenchmark.NUM_MESSAGES_PER_EDGE,
MESSAGES_PER_EDGE.getOptionIntValue(cmd));
if (FLUSH_THREADS.optionTurnedOn(cmd)) {
conf.setInt(GiraphConstants.MSG_NUM_FLUSH_THREADS,
FLUSH_THREADS.getOptionIntValue(cmd));
}
}
示例3: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
CommandLine cmd) {
conf.setVertexClass(ShortestPathsVertex.class);
if (EDGES_CLASS.getOptionIntValue(cmd, 1) == 1) {
conf.setOutEdgesClass(ArrayListEdges.class);
} else {
conf.setOutEdgesClass(HashMapEdges.class);
}
LOG.info("Using class " + GiraphConstants.VERTEX_CLASS.get(conf));
conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
if (!NO_COMBINER.optionTurnedOn(cmd)) {
conf.setCombinerClass(MinimumDoubleCombiner.class);
}
conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd));
}
示例4: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
CommandLine cmd) {
conf.setVertexClass(RandomMessageVertex.class);
conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
conf.setWorkerContextClass(RandomMessageBenchmarkWorkerContext.class);
conf.setMasterComputeClass(RandomMessageBenchmarkMasterCompute.class);
conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd));
conf.setInt(SUPERSTEP_COUNT,
BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd));
conf.setInt(RandomMessageBenchmark.NUM_BYTES_PER_MESSAGE,
BYTES_PER_MESSAGE.getOptionIntValue(cmd));
conf.setInt(RandomMessageBenchmark.NUM_MESSAGES_PER_EDGE,
MESSAGES_PER_EDGE.getOptionIntValue(cmd));
if (FLUSH_THREADS.optionTurnedOn(cmd)) {
conf.setInt(GiraphConstants.MSG_NUM_FLUSH_THREADS,
FLUSH_THREADS.getOptionIntValue(cmd));
}
}
示例5: computeResults
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
private Map<Integer, Integer> computeResults(String[] graph,
int partitionCount, int maxIterations, float capacityTreshold,
int maxStabilization, long seed) throws Exception {
GiraphConfiguration conf = getConfiguration();
conf.setInt(ARPComputation.NUMBER_OF_PARTITIONS, partitionCount);
conf.setInt(ARPComputation.NUMBER_OF_ITERATIONS, maxIterations);
conf.setFloat(ARPComputation.CAPACITY_THRESHOLD, capacityTreshold);
conf.setInt(ARPComputation.NUMBER_OF_STABLE_ITERATIONS, maxStabilization);
conf.setLong(ARPComputation.SEED, seed);
Iterable<String> results = InternalVertexRunner.run(conf, graph);
return parseResults(results);
}
示例6: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
CommandLine cmd) {
conf.setComputationClass(AggregatorsBenchmarkComputation.class);
conf.setMasterComputeClass(AggregatorsBenchmarkMasterCompute.class);
conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
conf.setWorkerContextClass(AggregatorsBenchmarkWorkerContext.class);
conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, 1);
conf.setInt(AGGREGATORS_NUM, AGGREGATORS.getOptionIntValue(cmd));
conf.setInt("workers", conf.getInt(GiraphConstants.MAX_WORKERS, -1));
}
示例7: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
CommandLine cmd) {
conf.setVertexClass(AggregatorsBenchmarkVertex.class);
conf.setMasterComputeClass(AggregatorsBenchmarkMasterCompute.class);
conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
conf.setWorkerContextClass(AggregatorsBenchmarkWorkerContext.class);
conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, 1);
conf.setInt(AGGREGATORS_NUM, AGGREGATORS.getOptionIntValue(cmd));
conf.setInt("workers", conf.getInt(GiraphConstants.MAX_WORKERS, -1));
}
示例8: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
/**
* Set vertex edges, input format, partitioner classes and related parameters
* based on command-line arguments.
*
* @param cmd Command line arguments
* @param configuration Giraph job configuration
*/
protected void prepareConfiguration(GiraphConfiguration configuration,
CommandLine cmd) {
configuration.setComputationClass(WeightedPageRankComputation.class);
int edgesClassOption = EDGES_CLASS.getOptionIntValue(cmd, 1);
switch (edgesClassOption) {
case 0:
configuration.setOutEdgesClass(LongDoubleArrayEdges.class);
break;
case 1:
configuration.setOutEdgesClass(ByteArrayEdges.class);
break;
case 2:
configuration.setOutEdgesClass(ByteArrayEdges.class);
configuration.useUnsafeSerialization(true);
break;
case 3:
configuration.setOutEdgesClass(ArrayListEdges.class);
break;
case 4:
configuration.setOutEdgesClass(HashMapEdges.class);
break;
default:
LOG.info("Unknown OutEdges class, " +
"defaulting to LongDoubleArrayEdges");
configuration.setOutEdgesClass(LongDoubleArrayEdges.class);
}
LOG.info("Using edges class " +
GiraphConstants.VERTEX_EDGES_CLASS.get(configuration));
if (COMBINER_TYPE.getOptionIntValue(cmd, 1) == 1) {
configuration.setCombinerClass(DoubleSumCombiner.class);
}
if (EDGE_INPUT.optionTurnedOn(cmd)) {
configuration.setEdgeInputFormatClass(PseudoRandomEdgeInputFormat.class);
} else {
configuration.setVertexInputFormatClass(
PseudoRandomVertexInputFormat.class);
}
configuration.setLong(
PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
configuration.setLong(
PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd));
configuration.setFloat(
PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO,
BenchmarkOption.LOCAL_EDGES_MIN_RATIO.getOptionFloatValue(cmd,
PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO_DEFAULT));
if (OUTPUT_FORMAT.getOptionIntValue(cmd, -1) == 0) {
LOG.info("Using vertex output format class " +
JsonBase64VertexOutputFormat.class.getName());
configuration.setVertexOutputFormatClass(
JsonBase64VertexOutputFormat.class);
}
if (PARTITIONER.getOptionIntValue(cmd, 0) == 1) {
configuration.setGraphPartitionerFactoryClass(
SimpleLongRangePartitionerFactory.class);
}
configuration.setInt(WeightedPageRankComputation.SUPERSTEP_COUNT,
BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd));
}
示例9: setupConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
/**
* Adjust the configuration to the basic test case
*/
public final Configuration setupConfiguration(GiraphJob job)
throws IOException {
GiraphConfiguration conf = job.getConfiguration();
conf.set("mapred.jar", getJarLocation());
// Allow this test to be run on a real Hadoop setup
if (runningInDistributedMode()) {
System.out.println("setupConfiguration: Sending job to job tracker " +
jobTracker + " with jar path " + getJarLocation()
+ " for " + getName());
conf.set("mapred.job.tracker", jobTracker);
conf.setWorkerConfiguration(getNumWorkers(), getNumWorkers(), 100.0f);
}
else {
System.out.println("setupConfiguration: Using local job runner with " +
"location " + getJarLocation() + " for " + getName());
conf.setWorkerConfiguration(1, 1, 100.0f);
// Single node testing
GiraphConstants.SPLIT_MASTER_WORKER.set(conf, false);
GiraphConstants.LOCAL_TEST_MODE.set(conf, true);
}
conf.setMaxMasterSuperstepWaitMsecs(30 * 1000);
conf.setEventWaitMsecs(3 * 1000);
GiraphConstants.ZOOKEEPER_SERVERLIST_POLL_MSECS.set(conf, 500);
if (getZooKeeperList() != null) {
conf.setZooKeeperConfiguration(getZooKeeperList());
}
// GeneratedInputSplit will generate 5 vertices
conf.setLong(READER_VERTICES_OPT, 5);
// Setup pathes for temporary files
Path zookeeperDir = getTempPath("_bspZooKeeper");
Path zkManagerDir = getTempPath("_defaultZkManagerDir");
Path checkPointDir = getTempPath("_checkpoints");
// We might start several jobs per test, so we need to clean up here
FileUtils.deletePath(conf, zookeeperDir);
FileUtils.deletePath(conf, zkManagerDir);
FileUtils.deletePath(conf, checkPointDir);
conf.set(GiraphConstants.ZOOKEEPER_DIR, zookeeperDir.toString());
GiraphConstants.ZOOKEEPER_MANAGER_DIRECTORY.set(conf,
zkManagerDir.toString());
GiraphConstants.CHECKPOINT_DIRECTORY.set(conf, checkPointDir.toString());
return conf;
}
示例10: prepareConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
/**
* Set vertex edges, input format, partitioner classes and related parameters
* based on command-line arguments.
*
* @param cmd Command line arguments
* @param configuration Giraph job configuration
*/
protected void prepareConfiguration(GiraphConfiguration configuration,
CommandLine cmd) {
configuration.setVertexClass(WeightedPageRankVertex.class);
int edgesClassOption = EDGES_CLASS.getOptionIntValue(cmd, 1);
switch (edgesClassOption) {
case 0:
configuration.setOutEdgesClass(LongDoubleArrayEdges.class);
break;
case 1:
configuration.setOutEdgesClass(ByteArrayEdges.class);
break;
case 2:
configuration.setOutEdgesClass(ByteArrayEdges.class);
configuration.useUnsafeSerialization(true);
break;
case 3:
configuration.setOutEdgesClass(ArrayListEdges.class);
break;
case 4:
configuration.setOutEdgesClass(HashMapEdges.class);
break;
default:
LOG.info("Unknown OutEdges class, " +
"defaulting to LongDoubleArrayEdges");
configuration.setOutEdgesClass(LongDoubleArrayEdges.class);
}
LOG.info("Using edges class " +
GiraphConstants.VERTEX_EDGES_CLASS.get(configuration));
if (COMBINER_TYPE.getOptionIntValue(cmd, 1) == 1) {
configuration.setCombinerClass(DoubleSumCombiner.class);
}
if (EDGE_INPUT.optionTurnedOn(cmd)) {
configuration.setEdgeInputFormatClass(PseudoRandomEdgeInputFormat.class);
} else {
configuration.setVertexInputFormatClass(
PseudoRandomVertexInputFormat.class);
}
configuration.setLong(
PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
BenchmarkOption.VERTICES.getOptionLongValue(cmd));
configuration.setLong(
PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd));
configuration.setFloat(
PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO,
BenchmarkOption.LOCAL_EDGES_MIN_RATIO.getOptionFloatValue(cmd,
PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO_DEFAULT));
if (OUTPUT_FORMAT.getOptionIntValue(cmd, -1) == 0) {
LOG.info("Using vertex output format class " +
JsonBase64VertexOutputFormat.class.getName());
configuration.setVertexOutputFormatClass(
JsonBase64VertexOutputFormat.class);
}
if (PARTITIONER.getOptionIntValue(cmd, 0) == 1) {
configuration.setGraphPartitionerFactoryClass(
SimpleLongRangePartitionerFactory.class);
}
configuration.setInt(WeightedPageRankVertex.SUPERSTEP_COUNT,
BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd));
}
示例11: setupConfiguration
import org.apache.giraph.conf.GiraphConfiguration; //导入方法依赖的package包/类
/**
* Adjust the configuration to the basic test case
*/
public final Configuration setupConfiguration(GiraphJob job)
throws IOException {
GiraphConfiguration conf = job.getConfiguration();
conf.set("mapred.jar", getJarLocation());
// Allow this test to be run on a real Hadoop setup
if (runningInDistributedMode()) {
System.out.println("setupConfiguration: Sending job to job tracker " +
jobTracker + " with jar path " + getJarLocation()
+ " for " + getName());
conf.set("mapred.job.tracker", jobTracker);
conf.setWorkerConfiguration(getNumWorkers(), getNumWorkers(), 100.0f);
}
else {
System.out.println("setupConfiguration: Using local job runner with " +
"location " + getJarLocation() + " for " + getName());
conf.setWorkerConfiguration(1, 1, 100.0f);
// Single node testing
GiraphConstants.SPLIT_MASTER_WORKER.set(conf, false);
}
conf.setMaxMasterSuperstepWaitMsecs(30 * 1000);
conf.setEventWaitMsecs(3 * 1000);
GiraphConstants.ZOOKEEPER_SERVERLIST_POLL_MSECS.set(conf, 500);
if (getZooKeeperList() != null) {
conf.setZooKeeperConfiguration(getZooKeeperList());
}
// GeneratedInputSplit will generate 5 vertices
conf.setLong(READER_VERTICES, 5);
// Setup pathes for temporary files
Path zookeeperDir = getTempPath("_bspZooKeeper");
Path zkManagerDir = getTempPath("_defaultZkManagerDir");
Path checkPointDir = getTempPath("_checkpoints");
// We might start several jobs per test, so we need to clean up here
FileUtils.deletePath(conf, zookeeperDir);
FileUtils.deletePath(conf, zkManagerDir);
FileUtils.deletePath(conf, checkPointDir);
conf.set(GiraphConstants.ZOOKEEPER_DIR, zookeeperDir.toString());
GiraphConstants.ZOOKEEPER_MANAGER_DIRECTORY.set(conf,
zkManagerDir.toString());
GiraphConstants.CHECKPOINT_DIRECTORY.set(conf, checkPointDir.toString());
return conf;
}