org.apache.giraph.graph.Vertex.wakeUp()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.apache.giraph.graph.Vertex.wakeUp()方法的一些代码示例,展示了Vertex.wakeUp()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.wakeUp()方法的具体详情如下:
包路径:org.apache.giraph.graph.Vertex
类名称:Vertex
方法名:wakeUp

Vertex.wakeUp介绍

[英]Re-activate vertex if halted.
[中]如果停止,请重新激活顶点。

代码示例

代码示例来源:origin: org.apache.giraph/giraph-core

  1. /**
  2. * Read vertex data from an input and initialize the vertex.
  3. *
  4. * @param in The input stream
  5. * @param vertex The vertex to initialize
  6. * @throws IOException
  7. */
  8. private void readVertexData(DataInput in, Vertex<I, V, E> vertex)
  9. throws IOException {
  10. I id = conf.createVertexId();
  11. id.readFields(in);
  12. V value = null;
  13. boolean hasNullValue = in.readBoolean();
  14. if (!hasNullValue) {
  15. value = conf.createVertexValue();
  16. value.readFields(in);
  17. }
  18. OutEdges<I, E> edges = conf.createAndInitializeOutEdges(0);
  19. vertex.initialize(id, value, edges);
  20. if (in.readBoolean()) {
  21. vertex.voteToHalt();
  22. } else {
  23. vertex.wakeUp();
  24. }
  25. }

代码示例来源:origin: org.apache.giraph/giraph-core

  1. /**
  2. * Reads data from input stream to inizialize Vertex. Assumes the vertex has
  3. * already been initialized and contains values for Id, value, and edges.
  4. *
  5. * @param input The input stream
  6. * @param vertex The vertex to initialize
  7. * @param conf Configuration
  8. * @param <I> Vertex id
  9. * @param <V> Vertex value
  10. * @param <E> Edge value
  11. * @throws IOException
  12. */
  13. @SuppressWarnings("unchecked")
  14. public static <I extends WritableComparable, V extends Writable,
  15. E extends Writable> void reinitializeVertexFromDataInput(
  16. DataInput input,
  17. Vertex<I, V, E> vertex,
  18. ImmutableClassesGiraphConfiguration<I, V, E> conf)
  19. throws IOException {
  20. vertex.getId().readFields(input);
  21. vertex.getValue().readFields(input);
  22. ((OutEdges<I, E>) vertex.getEdges()).readFields(input);
  23. if (input.readBoolean()) {
  24. vertex.voteToHalt();
  25. } else {
  26. vertex.wakeUp();
  27. }
  28. }

代码示例来源:origin: apache/giraph

  1. internalApi.takeMessages(vertex.getId());
  2. if (vertex.isHalted() && !Iterables.isEmpty(messages)) {
  3. vertex.wakeUp();

代码示例来源:origin: org.apache.giraph/giraph-core

  1. vertex.wakeUp();

相关文章