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