Skip to content

Instantly share code, notes, and snippets.

@okram
Created March 20, 2014 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okram/9669964 to your computer and use it in GitHub Desktop.
Save okram/9669964 to your computer and use it in GitHub Desktop.
public class TinkerGraphVertexWriter extends VertexWriter {
GraphWriter writer;
public void initialize(final TaskAttemptContext context) {
this.writer = new GraphSONWriter.Builder().build();
}
public void writeVertex(final Vertex giraphVertex) throws IOException {
//this.writer.writeVertex(System.out, ((GiraphVertex) giraphVertex).getGremlinVertex());
System.out.println(((GiraphVertex) giraphVertex).getGremlinVertex() + ":" + ((GiraphVertex) giraphVertex).getGremlinVertex().<TraversalCounters>getProperty(TraversalVertexProgram.TRAVERSAL_TRACKER).get().getDoneObjectTracks());
}
public void close(final TaskAttemptContext context) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment