当前位置: 首页>>代码示例>>Java>>正文


Java WritableUtils.readVertexFromDataInput方法代码示例

本文整理汇总了Java中org.apache.giraph.utils.WritableUtils.readVertexFromDataInput方法的典型用法代码示例。如果您正苦于以下问题:Java WritableUtils.readVertexFromDataInput方法的具体用法?Java WritableUtils.readVertexFromDataInput怎么用?Java WritableUtils.readVertexFromDataInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.giraph.utils.WritableUtils的用法示例。


在下文中一共展示了WritableUtils.readVertexFromDataInput方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readFields

import org.apache.giraph.utils.WritableUtils; //导入方法依赖的package包/类
@Override
public void readFields(DataInput input) throws IOException {
  super.readFields(input);
  if (USE_OUT_OF_CORE_MESSAGES.get(getConf())) {
    vertexMap = new ConcurrentSkipListMap<I, Vertex<I, V, E>>();
  } else {
    vertexMap = Maps.newConcurrentMap();
  }
  int vertices = input.readInt();
  for (int i = 0; i < vertices; ++i) {
    progress();
    Vertex<I, V, E> vertex =
        WritableUtils.readVertexFromDataInput(input, getConf());
    if (vertexMap.put(vertex.getId(), vertex) != null) {
      throw new IllegalStateException(
          "readFields: " + this +
          " already has same id " + vertex);
    }
  }
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:21,代码来源:SimplePartition.java

示例2: readFields

import org.apache.giraph.utils.WritableUtils; //导入方法依赖的package包/类
@Override
public void readFields(DataInput input) throws IOException {
  addedVertexList.clear();
  addedEdgeList.clear();
  removedEdgeList.clear();

  int addedVertexListSize = input.readInt();
  for (int i = 0; i < addedVertexListSize; ++i) {
    Vertex<I, V, E> vertex =
        WritableUtils.readVertexFromDataInput(input, getConf());
    addedVertexList.add(vertex);
  }
  removedVertexCount = input.readInt();
  int addedEdgeListSize = input.readInt();
  for (int i = 0; i < addedEdgeListSize; ++i) {
    Edge<I, E> edge = conf.createEdge();
    WritableUtils.readEdge(input, edge);
    addedEdgeList.add(edge);
  }
  int removedEdgeListSize = input.readInt();
  for (int i = 0; i < removedEdgeListSize; ++i) {
    I removedEdge = conf.createVertexId();
    removedEdge.readFields(input);
    removedEdgeList.add(removedEdge);
  }
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:27,代码来源:VertexMutations.java

示例3: readFields

import org.apache.giraph.utils.WritableUtils; //导入方法依赖的package包/类
@Override
public void readFields(DataInput input) throws IOException {
  super.readFields(input);
  if (USE_OUT_OF_CORE_MESSAGES.get(getConf())) {
    vertexMap = new ConcurrentSkipListMap<I, Vertex<I, V, E, M>>();
  } else {
    vertexMap = Maps.newConcurrentMap();
  }
  int vertices = input.readInt();
  for (int i = 0; i < vertices; ++i) {
    progress();
    Vertex<I, V, E, M> vertex =
        WritableUtils.readVertexFromDataInput(input, getConf());
    if (vertexMap.put(vertex.getId(), vertex) != null) {
      throw new IllegalStateException(
          "readFields: " + this +
          " already has same id " + vertex);
    }
  }
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:21,代码来源:SimplePartition.java

示例4: readFields

import org.apache.giraph.utils.WritableUtils; //导入方法依赖的package包/类
@Override
public void readFields(DataInput input) throws IOException {
  addedVertexList.clear();
  addedEdgeList.clear();
  removedEdgeList.clear();

  int addedVertexListSize = input.readInt();
  for (int i = 0; i < addedVertexListSize; ++i) {
    Vertex<I, V, E, M> vertex =
        WritableUtils.readVertexFromDataInput(input, getConf());
    addedVertexList.add(vertex);
  }
  removedVertexCount = input.readInt();
  int addedEdgeListSize = input.readInt();
  for (int i = 0; i < addedEdgeListSize; ++i) {
    Edge<I, E> edge = conf.createEdge();
    WritableUtils.readEdge(input, edge);
    addedEdgeList.add(edge);
  }
  int removedEdgeListSize = input.readInt();
  for (int i = 0; i < removedEdgeListSize; ++i) {
    I removedEdge = conf.createVertexId();
    removedEdge.readFields(input);
    removedEdgeList.add(removedEdge);
  }
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:27,代码来源:VertexMutations.java


注:本文中的org.apache.giraph.utils.WritableUtils.readVertexFromDataInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。