本文整理了Java中org.apache.giraph.graph.Vertex.getMutableEdges()
方法的一些代码示例,展示了Vertex.getMutableEdges()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.getMutableEdges()
方法的具体详情如下:
包路径:org.apache.giraph.graph.Vertex
类名称:Vertex
方法名:getMutableEdges
[英]Get an iterable of out-edges that can be modified in-place. This can mean changing the current edge value or removing the current edge (by using the iterator version). Note: accessing the edges with other methods (e.g., addEdge()) during iteration leads to undefined behavior.
[中]获取一个可在适当位置修改的可编辑的输出边。这可能意味着更改当前边值或删除当前边(通过使用迭代器版本)。注意:在迭代过程中,使用其他方法(例如addEdge())访问边会导致未定义的行为。
代码示例来源:origin: grafos-ml/okapi
@Override
public void compute(
Vertex<LongWritable, NullWritable, NullWritable> vertex,
Iterable<LongWritable> messages) throws IOException {
HashSet<LongWritable> toDelete = new HashSet<LongWritable>();
for (LongWritable id : messages) {
toDelete.add(new LongWritable(id.get()));
}
Iterator<MutableEdge<LongWritable,NullWritable>> edgeIterator =
vertex.getMutableEdges().iterator();
while (edgeIterator.hasNext()) {
if (toDelete.contains(edgeIterator.next().getTargetVertexId())) {
edgeIterator.remove();
}
}
if (vertex.getNumEdges()<getConf().getInt(K_VALUE, K_VALUE_DEFAULT)) {
sendMessageToAllEdges(vertex, vertex.getId());
removeVertexRequest(vertex.getId());
}
vertex.voteToHalt();
}
}
代码示例来源:origin: org.apache.giraph/giraph-core
vertex.getMutableEdges()) {
edge.setValue(new DoubleWritable(edge.getValue().get() / outEdgeSum));
内容来源于网络,如有侵权,请联系作者删除!