use of org.apache.giraph.edge.Edge in project incubator-rya by apache.
the class RyaVertexReader method getCurrentVertex.
@Override
public Vertex<Text, RyaTypeWritable, RyaStatementWritable> getCurrentVertex() throws IOException, InterruptedException {
RyaStatementWritable currentStatement = reader.getCurrentValue();
RyaStatement ryaStatement = currentStatement.getRyaStatement();
RyaTypeWritable vertexWritable = new RyaTypeWritable();
vertexWritable.setRyaType(ryaStatement.getSubject());
Text vertexId = new Text(ryaStatement.getSubject().getData());
Vertex<Text, RyaTypeWritable, RyaStatementWritable> vertex = classesConfiguration.createVertex();
Edge<Text, RyaStatementWritable> edge = EdgeFactory.create(new Text(ryaStatement.toString()), currentStatement);
List<Edge<Text, RyaStatementWritable>> edges = new ArrayList<Edge<Text, RyaStatementWritable>>();
edges.add(edge);
vertex.initialize(vertexId, vertexWritable, edges);
return vertex;
}
Aggregations