本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}