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


Java WritableUtils.readEdge方法代码示例

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


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

示例1: 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

示例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, 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

示例3: next

import org.apache.giraph.utils.WritableUtils; //导入方法依赖的package包/类
@Override
public Edge<I, E> next() {
  try {
    WritableUtils.readEdge(extendedDataInput, representativeEdge);
  } catch (IOException e) {
    throw new IllegalStateException("next: Failed on pos " +
        extendedDataInput.getPos() + " edge " + representativeEdge);
  }
  return representativeEdge;
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:11,代码来源:ByteArrayEdges.java

示例4: readFields

import org.apache.giraph.utils.WritableUtils; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  int numEdges = in.readInt();
  initialize(numEdges);
  for (int i = 0; i < numEdges; ++i) {
    Edge<I, E> edge = getConf().createEdge();
    WritableUtils.readEdge(in, edge);
    edgeList.add(edge);
  }
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:11,代码来源:ArrayListEdges.java

示例5: readFields

import org.apache.giraph.utils.WritableUtils; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  int numEdges = in.readInt();
  initialize(numEdges);
  for (int i = 0; i < numEdges; ++i) {
    Edge<LongWritable, DoubleWritable> edge = EdgeFactory.createReusable(
        new LongWritable(), new DoubleWritable());
    WritableUtils.readEdge(in, edge);
    edgeList.add(edge);
  }
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:12,代码来源:TestVertexAndEdges.java


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