本文整理汇总了Java中org.apache.giraph.worker.WorkerContext类的典型用法代码示例。如果您正苦于以下问题:Java WorkerContext类的具体用法?Java WorkerContext怎么用?Java WorkerContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkerContext类属于org.apache.giraph.worker包,在下文中一共展示了WorkerContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void initialize(GraphState graphState,
WorkerClientRequestProcessor<LongWritable, ARPVertexValue, NullWritable>
workerClientRequestProcessor,
GraphTaskManager<LongWritable, ARPVertexValue, NullWritable>
graphTaskManager,
WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager,
workerGlobalCommUsage, workerContext);
this.k =
getConf().getInt(NUMBER_OF_PARTITIONS, DEFAULT_NUMBER_OF_PARTITIONS);
this.stableThreshold = getConf()
.getInt(NUMBER_OF_STABLE_ITERATIONS, DEFAULT_NUMBER_OF_STABLE_ITERATIONS);
this.capacityThreshold =
getConf().getFloat(CAPACITY_THRESHOLD, DEFAULT_CAPACITY_THRESHOLD);
this.totalPartitionCapacity = getTotalCapacity();
this.isPartitioned = getConf()
.getBoolean(ARPTextVertexInputFormat.PARTITIONED_INPUT,
ARPTextVertexInputFormat.DEFAULT_PARTITIONED_INPUT);
this.seed = getConf().getLong(SEED, DEFAULT_SEED);
if (seed != 0) {
random = new Random(seed);
} else {
random = new Random();
}
}
开发者ID:dbs-leipzig,项目名称:giraph-algorithms,代码行数:27,代码来源:ARPComputation.java
示例2: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* Initialize, called by infrastructure before the superstep starts.
* Shouldn't be called by user code.
*
* @param graphState
* Graph state
* @param workerClientRequestProcessor
* Processor for handling requests
* @param graphTaskManager
* Graph-wide BSP Mapper for this Vertex
* @param workerAggregatorUsage
* Worker aggregator usage
* @param workerContext
* Worker context
*/
public void initialize(GraphState graphState,
WorkerClientRequestProcessor<I, V, E> workerClientRequestProcessor,
GraphTaskManager<I, V, E> graphTaskManager,
WorkerAggregatorUsage workerAggregatorUsage,
WorkerContext workerContext) {
this.graphState = graphState;
this.workerClientRequestProcessor = workerClientRequestProcessor;
this.graphTaskManager = graphTaskManager;
this.workerAggregatorUsage = workerAggregatorUsage;
this.workerContext = workerContext;
// Request the creation of the injector vertex right at the
// initialization
// addVertexRequest(INJECTOR_VERTEX_ID, INJECTOR_VERTEX_VALUE);
// LOG.info("[PROMETHEUS] Injector Vertex created in initialization!");
}
开发者ID:MarcoLotz,项目名称:dynamicGraph,代码行数:32,代码来源:Computation.java
示例3: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void initialize(GraphState graphState,
WorkerClientRequestProcessor<LongWritable, DiffusionVertexValue,
NullWritable> workerClientRequestProcessor,
GraphTaskManager<LongWritable, DiffusionVertexValue, NullWritable>
graphTaskManager,
WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
this.k = getConf().getInt(NUMBER_OF_CLUSTERS, DEFAULT_NUMBER_OF_CLUSTERS);
this.secondaryLoadFactor =
getConf().getDouble(SECONDARY_LOAD_FACTOR, DEFAULT_SECONDARY_LOAD_FACTOR);
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager,
workerGlobalCommUsage, workerContext);
}
开发者ID:galpha,项目名称:giraph-didic,代码行数:17,代码来源:DiffusionComputation.java
示例4: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void initialize(GraphState graphState,
WorkerClientRequestProcessor<LongWritable, LPVertexValue, NullWritable>
workerClientRequestProcessor,
GraphTaskManager<LongWritable, LPVertexValue, NullWritable>
graphTaskManager,
WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager,
workerGlobalCommUsage, workerContext);
this.stabilizationRounds = getConf()
.getLong(STABILISATION_ROUNDS, DEFAULT_NUMBER_OF_STABILIZATION_ROUNDS);
}
开发者ID:dbs-leipzig,项目名称:giraph-algorithms,代码行数:13,代码来源:LPComputation.java
示例5: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* Initialize, called by infrastructure before the superstep starts.
* Shouldn't be called by user code.
*
* @param graphState Graph state
* @param workerClientRequestProcessor Processor for handling requests
* @param graphTaskManager Graph-wide BSP Mapper for this Vertex
* @param workerAggregatorUsage Worker aggregator usage
* @param workerContext Worker context
*/
@Override
public void initialize(
GraphState graphState,
WorkerClientRequestProcessor<I, V, E> workerClientRequestProcessor,
GraphTaskManager<I, V, E> graphTaskManager,
WorkerAggregatorUsage workerAggregatorUsage,
WorkerContext workerContext) {
this.graphState = graphState;
this.workerClientRequestProcessor = workerClientRequestProcessor;
this.graphTaskManager = graphTaskManager;
this.workerAggregatorUsage = workerAggregatorUsage;
this.workerContext = workerContext;
}
开发者ID:renato2099,项目名称:giraph-gora,代码行数:24,代码来源:AbstractComputation.java
示例6: createWorkerContext
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* Create a user worker context
*
* @param graphState State of the graph from the worker
* @return Instantiated user worker context
*/
@SuppressWarnings("rawtypes")
public WorkerContext createWorkerContext(GraphState<I, V, E, M> graphState) {
WorkerContext workerContext =
ReflectionUtils.newInstance(getWorkerContextClass(), this);
workerContext.setGraphState(graphState);
return workerContext;
}
开发者ID:zfighter,项目名称:giraph-research,代码行数:14,代码来源:ImmutableClassesGiraphConfiguration.java
示例7: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void initialize(GraphState graphState, WorkerClientRequestProcessor<Text, DoubleWritable, Text> workerClientRequestProcessor, GraphTaskManager<Text, DoubleWritable, Text> graphTaskManager, WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager, workerGlobalCommUsage, workerContext);
DGALoggingUtil.setDGALogLevel(this.getConf());
}
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:6,代码来源:PageRankComputation.java
示例8: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void initialize(GraphState graphState, WorkerClientRequestProcessor<Text, LouvainNodeState, LongWritable> workerClientRequestProcessor, GraphTaskManager<Text, LouvainNodeState, LongWritable> graphTaskManager, WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager, workerGlobalCommUsage, workerContext);
DGALoggingUtil.setDGALogLevel(this.getConf());
}
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:6,代码来源:LouvainComputation.java
示例9: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void initialize(GraphState graphState, WorkerClientRequestProcessor<Text, Text, Text> workerClientRequestProcessor, GraphTaskManager<Text, Text, Text> graphTaskManager, WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager, workerGlobalCommUsage, workerContext);
DGALoggingUtil.setDGALogLevel(getConf());
}
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:6,代码来源:LeafCompressionComputation.java
示例10: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void initialize(GraphState graphState, WorkerClientRequestProcessor<Text, VertexData, Text> workerClientRequestProcessor, GraphTaskManager<Text, VertexData, Text> graphTaskManager, WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager, workerGlobalCommUsage, workerContext);
DGALoggingUtil.setDGALogLevel(this.getConf());
}
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:6,代码来源:HBSEComputation.java
示例11: initialize
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void initialize(GraphState graphState, WorkerClientRequestProcessor<Text, Text, Text> workerClientRequestProcessor, GraphTaskManager<Text, Text, Text> graphTaskManager, WorkerGlobalCommUsage workerGlobalCommUsage, WorkerContext workerContext) {
super.initialize(graphState, workerClientRequestProcessor, graphTaskManager, workerGlobalCommUsage, workerContext);
DGALoggingUtil.setDGALogLevel(this.getConf());
}
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:6,代码来源:WeaklyConnectedComponentComputation.java
示例12: getWorkerContext
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
public final WorkerContext getWorkerContext() {
return serviceWorker.getWorkerContext();
}
开发者ID:renato2099,项目名称:giraph-gora,代码行数:4,代码来源:GraphTaskManager.java
示例13: preSuperstep
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void preSuperstep(WorkerContext workerContext) {
counter =
((TestPartitionContextWorkerContext) workerContext).superstepCounter;
}
开发者ID:zfighter,项目名称:giraph-research,代码行数:6,代码来源:PartitionContextTestVertex.java
示例14: postSuperstep
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void postSuperstep(WorkerContext workerContext) {
((TestPartitionContextWorkerContext) workerContext).totalCounter +=
counter;
}
开发者ID:zfighter,项目名称:giraph-research,代码行数:6,代码来源:PartitionContextTestVertex.java
示例15: preSuperstep
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void preSuperstep(WorkerContext workerContext) {
}
开发者ID:zfighter,项目名称:giraph-research,代码行数:4,代码来源:DefaultPartitionContext.java
示例16: postSuperstep
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
@Override
public void postSuperstep(WorkerContext workerContext) {
}
开发者ID:zfighter,项目名称:giraph-research,代码行数:4,代码来源:DefaultPartitionContext.java
示例17: computePartition
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* Compute a single partition
*
* @param partition Partition to compute
* @return Partition stats for this computed partition
*/
private PartitionStats computePartition(Partition<I, V, E, M> partition)
throws IOException, InterruptedException {
PartitionStats partitionStats =
new PartitionStats(partition.getId(), 0, 0, 0, 0);
// Make sure this is thread-safe across runs
synchronized (partition) {
// Prepare Partition context
WorkerContext workerContext =
graphState.getGraphTaskManager().getWorkerContext();
PartitionContext partitionContext = partition.getPartitionContext();
synchronized (workerContext) {
partitionContext.preSuperstep(workerContext);
}
graphState.setPartitionContext(partition.getPartitionContext());
for (Vertex<I, V, E, M> vertex : partition) {
// Make sure every vertex has this thread's
// graphState before computing
vertex.setGraphState(graphState);
Iterable<M> messages = messageStore.getVertexMessages(vertex.getId());
if (vertex.isHalted() && !Iterables.isEmpty(messages)) {
vertex.wakeUp();
}
if (!vertex.isHalted()) {
context.progress();
TimerContext computeOneTimerContext = computeOneTimer.time();
try {
vertex.compute(messages);
} finally {
computeOneTimerContext.stop();
}
// Need to unwrap the mutated edges (possibly)
vertex.unwrapMutableEdges();
// Write vertex to superstep output (no-op if it is not used)
vertexWriter.writeVertex(vertex);
// Need to save the vertex changes (possibly)
partition.saveVertex(vertex);
}
//################## add by fidel
else{
if(GiraphConstants.MY_TEST.get(configuration))
TLOG.info("ht");
}
//##################
if (vertex.isHalted()) {
partitionStats.incrFinishedVertexCount();
}
// Remove the messages now that the vertex has finished computation
messageStore.clearVertexMessages(vertex.getId());
// Add statistics for this vertex
partitionStats.incrVertexCount();
partitionStats.addEdgeCount(vertex.getNumEdges());
}
messageStore.clearPartition(partition.getId());
synchronized (workerContext) {
partitionContext.postSuperstep(workerContext);
}
}
return partitionStats;
}
开发者ID:zfighter,项目名称:giraph-research,代码行数:70,代码来源:ComputeCallable.java
示例18: getWorkerContext
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* Get the worker context
*
* @param <W>
* WorkerContext class
* @return WorkerContext context
*/
@SuppressWarnings("unchecked")
public <W extends WorkerContext> W getWorkerContext() {
return (W) workerContext;
}
开发者ID:MarcoLotz,项目名称:dynamicGraph,代码行数:12,代码来源:Computation.java
示例19: getWorkerContext
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* Get the worker context
*
* @param <W> WorkerContext class
* @return WorkerContext context
*/
@SuppressWarnings("unchecked")
public <W extends WorkerContext> W getWorkerContext() {
return (W) giraphCompute.getWorkerContext();
}
开发者ID:renato2099,项目名称:giraph-gora,代码行数:11,代码来源:JythonComputation.java
示例20: getWorkerContext
import org.apache.giraph.worker.WorkerContext; //导入依赖的package包/类
/**
* Get the worker context.
*
* @return worker's WorkerContext
*/
WorkerContext getWorkerContext();
开发者ID:renato2099,项目名称:giraph-gora,代码行数:7,代码来源:CentralizedServiceWorker.java
注:本文中的org.apache.giraph.worker.WorkerContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论