本文整理汇总了Java中org.apache.giraph.aggregators.LongSumAggregator类的典型用法代码示例。如果您正苦于以下问题:Java LongSumAggregator类的具体用法?Java LongSumAggregator怎么用?Java LongSumAggregator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LongSumAggregator类属于org.apache.giraph.aggregators包,在下文中一共展示了LongSumAggregator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
registerPersistentAggregator(
INPUT_VERTEX_PERSISTENT_AGG, LongSumAggregator.class);
registerPersistentAggregator(
INPUT_EDGE_PERSISTENT_AGG, LongSumAggregator.class);
registerAggregator(REGULAR_AGG, LongSumAggregator.class);
registerPersistentAggregator(PERSISTENT_AGG,
LongSumAggregator.class);
registerAggregator(MASTER_WRITE_AGG, LongSumAggregator.class);
for (int i = 0; i < NUM_OF_AGGREGATORS_IN_ARRAY; i++) {
registerAggregator(ARRAY_PREFIX_AGG + i, LongSumAggregator.class);
}
}
示例2: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
/**
* Creates capacity and demand aggregators for each partition.
*
* @throws IllegalAccessException
* @throws InstantiationException
*/
@Override
public void initialize() throws IllegalAccessException,
InstantiationException {
int k = getConf().getInt(ARPComputation.NUMBER_OF_PARTITIONS,
ARPComputation.DEFAULT_NUMBER_OF_PARTITIONS);
for (int i = 0; i < k; i++) {
registerAggregator(ARPComputation.DEMAND_AGGREGATOR_PREFIX + i, LongSumAggregator
.class);
registerPersistentAggregator(ARPComputation.CAPACITY_AGGREGATOR_PREFIX + i, LongSumAggregator.class);
}
}
示例3: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException, IllegalAccessException {
this.registerAggregator(LouvainComputation.CHANGE_AGG, LongSumAggregator.class);
this.registerPersistentAggregator(LouvainComputation.TOTAL_EDGE_WEIGHT_AGG, LongSumAggregator.class);
this.registerPersistentAggregator(LouvainComputation.ACTUAL_Q_AGG, DoubleSumAggregator.class);
DGALoggingUtil.setDGALogLevel(this.getConf());
}
示例4: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException, IllegalAccessException {
this.registerAggregator(LouvainVertex.CHANGE_AGG, LongSumAggregator.class);
this.registerPersistentAggregator(LouvainVertex.TOTAL_EDGE_WEIGHT_AGG, LongSumAggregator.class);
//for (int i =0; i < LouvainVertex.getNumQAggregators(getConf()); i++){
this.registerPersistentAggregator(LouvainVertex.ACTUAL_Q_AGG, DoubleSumAggregator.class);
//}
}
示例5: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
registerAggregator(RandomWalkComputation.NUM_DANGLING_VERTICES,
LongSumAggregator.class);
registerAggregator(RandomWalkComputation.CUMULATIVE_DANGLING_PROBABILITY,
DoubleSumAggregator.class);
registerAggregator(RandomWalkComputation.CUMULATIVE_PROBABILITY,
DoubleSumAggregator.class);
registerAggregator(RandomWalkComputation.L1_NORM_OF_PROBABILITY_DIFFERENCE,
DoubleSumAggregator.class);
}
示例6: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
registerAggregator(SUM_AGG, LongSumAggregator.class);
registerPersistentAggregator(MIN_AGG, DoubleMinAggregator.class);
registerPersistentAggregator(MAX_AGG, DoubleMaxAggregator.class);
}
示例7: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
int n = getNumAggregators(getConf());
for (int i = 0; i < n; i++) {
registerAggregator("w" + i, LongSumAggregator.class);
registerAggregator("m" + i, LongSumAggregator.class);
registerPersistentAggregator("p" + i, LongSumAggregator.class);
}
}
示例8: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
registerAggregator(AGG_SUPERSTEP_TOTAL_BYTES,
LongSumAggregator.class);
registerAggregator(AGG_SUPERSTEP_TOTAL_MESSAGES,
LongSumAggregator.class);
registerAggregator(AGG_SUPERSTEP_TOTAL_MILLIS,
LongSumAggregator.class);
registerAggregator(WORKERS_NUM,
LongSumAggregator.class);
}
示例9: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException, IllegalAccessException {
r = new Random();
registerPersistentAggregator(Constants.MIN, MinimumPointWritableAggregator.class);
registerPersistentAggregator(Constants.MAX, MaximumPointWritableAggregator.class);
registerAggregator(Constants.UPDATES, LongSumAggregator.class);
k = getConf().getInt(Constants.K, 0);
for(int i = 0; i < k; i++) {
registerAggregator(Constants.POINT_PREFIX + i, AveragePointWritableAggregator.class);
}
}
示例10: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
registerAggregator(RandomWalkVertex.NUM_DANGLING_VERTICES,
LongSumAggregator.class);
registerAggregator(RandomWalkVertex.CUMULATIVE_DANGLING_PROBABILITY,
DoubleSumAggregator.class);
registerAggregator(RandomWalkVertex.CUMULATIVE_PROBABILITY,
DoubleSumAggregator.class);
registerAggregator(RandomWalkVertex.L1_NORM_OF_PROBABILITY_DIFFERENCE,
DoubleSumAggregator.class);
}
示例11: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
registerAggregator(REGULAR_AGG, LongSumAggregator.class);
registerPersistentAggregator(PERSISTENT_AGG,
LongSumAggregator.class);
registerAggregator(MASTER_WRITE_AGG, LongSumAggregator.class);
for (int i = 0; i < NUM_OF_AGGREGATORS_IN_ARRAY; i++) {
registerAggregator(ARRAY_PREFIX_AGG + i, LongSumAggregator.class);
}
}
示例12: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException,
IllegalAccessException {
LOG.info("Registering aggregator: zombe.count");
registerAggregator("zombe.count", LongSumAggregator.class);
}
示例13: initialize
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void initialize() throws InstantiationException, IllegalAccessException {
registerPersistentAggregator(PageRankVertex.VERTEX_COUNT_AGG, LongSumAggregator.class);
//registerAggregator(PageRankVertex.VERTEX_VOTE,LongSumAggregator.class);
registerAggregator(PageRankVertex.MAX_EPSILON,DoubleMaxAggregator.class);
}
示例14: compute
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void compute(
Vertex<LongWritable, IntWritable, FloatWritable> vertex,
Iterable<FloatWritable> messages) throws IOException {
SimpleCheckpointVertexWorkerContext workerContext = getWorkerContext();
boolean enableFault = workerContext.getEnableFault();
int supersteps = workerContext.getSupersteps();
if (enableFault && (getSuperstep() == FAULTING_SUPERSTEP) &&
(getContext().getTaskAttemptID().getId() == 0) &&
(vertex.getId().get() == FAULTING_VERTEX_ID)) {
LOG.info("compute: Forced a fault on the first " +
"attempt of superstep " +
FAULTING_SUPERSTEP + " and vertex id " +
FAULTING_VERTEX_ID);
System.exit(-1);
}
if (getSuperstep() > supersteps) {
vertex.voteToHalt();
return;
}
long sumAgg = this.<LongWritable>getAggregatedValue(
LongSumAggregator.class.getName()).get();
LOG.info("compute: " + sumAgg);
aggregate(LongSumAggregator.class.getName(),
new LongWritable(vertex.getId().get()));
LOG.info("compute: sum = " + sumAgg +
" for vertex " + vertex.getId());
float msgValue = 0.0f;
for (FloatWritable message : messages) {
float curMsgValue = message.get();
msgValue += curMsgValue;
LOG.info("compute: got msgValue = " + curMsgValue +
" for vertex " + vertex.getId() +
" on superstep " + getSuperstep());
}
int vertexValue = vertex.getValue().get();
vertex.setValue(new IntWritable(vertexValue + (int) msgValue));
LOG.info("compute: vertex " + vertex.getId() +
" has value " + vertex.getValue() +
" on superstep " + getSuperstep());
for (Edge<LongWritable, FloatWritable> edge : vertex.getEdges()) {
FloatWritable newEdgeValue = new FloatWritable(edge.getValue().get() +
(float) vertexValue);
Edge<LongWritable, FloatWritable> newEdge =
EdgeFactory.create(edge.getTargetVertexId(), newEdgeValue);
LOG.info("compute: vertex " + vertex.getId() +
" sending edgeValue " + edge.getValue() +
" vertexValue " + vertexValue +
" total " + newEdgeValue +
" to vertex " + edge.getTargetVertexId() +
" on superstep " + getSuperstep());
vertex.addEdge(newEdge);
sendMessage(edge.getTargetVertexId(), newEdgeValue);
}
}
示例15: postApplication
import org.apache.giraph.aggregators.LongSumAggregator; //导入依赖的package包/类
@Override
public void postApplication() {
setFinalSum(this.<LongWritable>getAggregatedValue(
LongSumAggregator.class.getName()).get());
LOG.info("FINAL_SUM=" + FINAL_SUM);
}