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

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

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

Vertex.setValue介绍

暂无

代码示例

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

/**
 * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex.
 *
 * <p>This should be called at most once per updateVertex.
 *
 * @param newValue The new vertex value.
 */
public void setNewVertexValue(VV newValue) {
  if (setNewVertexValueCalled) {
    throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex");
  }
  setNewVertexValueCalled = true;
  if (isOptDegrees()) {
    outValWithDegrees.f1.f0 = newValue;
    outWithDegrees.collect(outValWithDegrees);
  } else {
    outVal.setValue(newValue);
    out.collect(outVal);
  }
}

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

@Override
  public void sendMessages(Vertex<K, Double> vertex) {
    if (getSuperstepNumber() == 1) {
      // initialize vertex ranks
      vertex.setValue(1.0 / this.getNumberOfVertices());
    }
    for (Edge<K, Double> edge : getEdges()) {
      sendMessageTo(edge.getTarget(), vertex.getValue() * edge.getValue());
    }
  }
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
  * Map function to create gelly vertices with long key and long value.
  *
  * @param tuple given unique vertex id
  * @return gelly vertex
  */
 @Override
 public Vertex<Long, Long> map(Tuple2<Long, GradoopId> tuple) {
  vertex.setId(tuple.f0);
  vertex.setValue(tuple.f0);
  return vertex;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

/**
  * Map function to create gelly vertices with long key and long value.
  *
  * @param tuple given unique vertex id
  * @return gelly vertex
  */
 @Override
 public Vertex<Long, Long> map(Tuple2<Long, GradoopId> tuple) {
  vertex.setId(tuple.f0);
  vertex.setValue(tuple.f0);
  return vertex;
 }
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
 * Constructor.
 */
public VertexToGellyVertexWithNullValue() {
 reuseVertex = new org.apache.flink.graph.Vertex<>();
 reuseVertex.setValue(NullValue.getInstance());
}

代码示例来源:origin: org.gradoop/gradoop-flink

@Override
 public org.apache.flink.graph.Vertex<GradoopId, GradoopId> map(Vertex epgmVertex) {
  GradoopId id = epgmVertex.getId();
  reuseVertex.setId(id);
  reuseVertex.setValue(id);
  return reuseVertex;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

/**
 * Constructor.
 */
public VertexToGellyVertexWithNullValue() {
 reuseVertex = new org.apache.flink.graph.Vertex<>();
 reuseVertex.setValue(NullValue.getInstance());
}

代码示例来源:origin: dbs-leipzig/gradoop

@Override
 public org.apache.flink.graph.Vertex<GradoopId, GradoopId> map(Vertex epgmVertex) {
  GradoopId id = epgmVertex.getId();
  reuseVertex.setId(id);
  reuseVertex.setValue(id);
  return reuseVertex;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

@Override
 public org.apache.flink.graph.Vertex<GradoopId, PropertyValue> map(
  Vertex epgmVertex) throws Exception {
  reuseVertex.setId(epgmVertex.getId());
  reuseVertex.setValue(epgmVertex.getPropertyValue(propertyKey));
  return reuseVertex;
 }
}

代码示例来源:origin: org.gradoop/gradoop-flink

@Override
 public org.apache.flink.graph.Vertex<GradoopId, PropertyValue> map(
  Vertex epgmVertex) throws Exception {
  reuseVertex.setId(epgmVertex.getId());
  reuseVertex.setValue(epgmVertex.getPropertyValue(propertyKey));
  return reuseVertex;
 }
}

代码示例来源:origin: org.apache.flink/flink-gelly_2.10

/**
 * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex.
 *
 * This should be called at most once per updateVertex.
 * 
 * @param newValue The new vertex value.
 */
public void setNewVertexValue(VV newValue) {
  if(setNewVertexValueCalled) {
    throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex");
  }
  setNewVertexValueCalled = true;
  if(isOptDegrees()) {
    outValWithDegrees.f1.f0 = newValue;
    outWithDegrees.collect(outValWithDegrees);
  } else {
    outVal.setValue(newValue);
    out.collect(outVal);
  }
}

代码示例来源:origin: org.apache.flink/flink-gelly_2.11

/**
 * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex.
 *
 * <p>This should be called at most once per updateVertex.
 *
 * @param newValue The new vertex value.
 */
public void setNewVertexValue(VV newValue) {
  if (setNewVertexValueCalled) {
    throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex");
  }
  setNewVertexValueCalled = true;
  if (isOptDegrees()) {
    outValWithDegrees.f1.f0 = newValue;
    outWithDegrees.collect(outValWithDegrees);
  } else {
    outVal.setValue(newValue);
    out.collect(outVal);
  }
}

代码示例来源:origin: com.alibaba.blink/flink-gelly

/**
 * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex.
 *
 * <p>This should be called at most once per updateVertex.
 *
 * @param newValue The new vertex value.
 */
public void setNewVertexValue(VV newValue) {
  if (setNewVertexValueCalled) {
    throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex");
  }
  setNewVertexValueCalled = true;
  if (isOptDegrees()) {
    outValWithDegrees.f1.f0 = newValue;
    outWithDegrees.collect(outValWithDegrees);
  } else {
    outVal.setValue(newValue);
    out.collect(outVal);
  }
}

相关文章