Created
March 17, 2014 15:36
-
-
Save okram/9601527 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Future<Graph> submit() { | |
try { | |
final FileSystem fs = FileSystem.get(this.hadoopConfiguration); | |
fs.delete(new Path("output"), true); | |
final FileSystem local = FileSystem.getLocal(this.hadoopConfiguration); | |
final Path vertexProgramPath = new Path("tmp/gremlin", UUID.randomUUID().toString()); | |
final ObjectOutputStream os = new ObjectOutputStream(fs.create(vertexProgramPath)); | |
os.writeObject(this.vertexProgram); | |
os.close(); | |
fs.deleteOnExit(vertexProgramPath); | |
DistributedCache.addCacheFile(new URI(vertexProgramPath + "#" + VERTEX_PROGRAM), this.hadoopConfiguration); | |
DistributedCache.createSymlink(this.hadoopConfiguration); | |
DistributedCache.addArchiveToClassPath( | |
new Path("/Users/marko/software/tinkerpop/tinkerpop3/giraph-gremlin/target/giraph-gremlin-3.0.0-SNAPSHOT-job.jar"), | |
this.hadoopConfiguration, | |
local); | |
DistributedCache.addArchiveToClassPath( | |
new Path("/usr/local/giraph-1.0.0/giraph-core/target/giraph-1.0.0-for-hadoop-1.2.1-jar-with-dependencies.jar"), | |
this.hadoopConfiguration, | |
local); | |
DistributedCache.addArchiveToClassPath( | |
new Path("/Users/marko/software/tinkerpop/tinkerpop3/gremlin/gremlin-core/target/gremlin-core-3.0.0-SNAPSHOT.jar"), | |
this.hadoopConfiguration, | |
local); | |
DistributedCache.addArchiveToClassPath( | |
new Path("/Users/marko/software/tinkerpop/tinkerpop3/tinkergraph/target/tinkergraph-3.0.0-SNAPSHOT.jar"), | |
this.hadoopConfiguration, | |
local); | |
ToolRunner.run(new GiraphGraphRunner(this.hadoopConfiguration), new String[]{}); | |
} catch (Exception e) { | |
java.lang.System.out.println(e.getMessage()); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment