1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.giraph.io;
20
21 import org.apache.giraph.graph.Vertex;
22 import org.apache.hadoop.io.Writable;
23 import org.apache.hadoop.io.WritableComparable;
24 import org.apache.hadoop.mapreduce.InputSplit;
25 import org.apache.hadoop.mapreduce.TaskAttemptContext;
26
27 import java.io.IOException;
28
29
30
31
32
33
34
35 public abstract class VertexValueReader<I extends WritableComparable,
36 V extends Writable> extends BasicVertexValueReader<I, V> {
37 @Override
38 public void initialize(InputSplit inputSplit, TaskAttemptContext context)
39 throws IOException, InterruptedException {
40 }
41
42 @Override
43 public final Vertex<I, V, Writable> getCurrentVertex() throws IOException,
44 InterruptedException {
45 Vertex<I, V, Writable> vertex = getConf().createVertex();
46 vertex.initialize(getCurrentVertexId(), getCurrentVertexValue());
47 return vertex;
48 }
49 }