Skip to content

Commit

Permalink
Remove gremlin.hadoop.outputLocation in CassandraInputFormat test setup
Browse files Browse the repository at this point in the history
Signed-off-by: sjudeng <sjudeng@users.noreply.github.com>
  • Loading branch information
sjudeng committed Feb 3, 2017
1 parent 2f9be6a commit f615d2a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,28 @@

package org.janusgraph.hadoop;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.janusgraph.CassandraStorageSetup;
import org.janusgraph.diskstorage.configuration.ModifiableConfiguration;
import org.janusgraph.diskstorage.configuration.WriteConfiguration;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class CassandraInputFormatIT extends AbstractInputFormatIT {

protected Graph getGraph() {
return GraphFactory.open("target/test-classes/cassandra-read.properties");
protected Graph getGraph() throws ConfigurationException, IOException {
final PropertiesConfiguration config = new PropertiesConfiguration("target/test-classes/cassandra-read.properties");
Path baseOutDir = Paths.get((String) config.getProperty("gremlin.hadoop.outputLocation"));
baseOutDir.toFile().mkdirs();
String outDir = Files.createTempDirectory(baseOutDir, null).toAbsolutePath().toString();
config.setProperty("gremlin.hadoop.outputLocation", outDir);
return GraphFactory.open(config);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gremlin.hadoop.graphOutputFormat=org.apache.hadoop.mapreduce.lib.output.NullOutp

gremlin.hadoop.jarsInDistributedCache=true
gremlin.hadoop.inputLocation=none
gremlin.hadoop.outputLocation=output
gremlin.hadoop.outputLocation=target/output
janusgraphmr.ioformat.conf.storage.backend=cassandrathrift
janusgraphmr.ioformat.conf.storage.cassandra.keyspace=CassandraInputFormatIT
janusgraphmr.ioformat.conf.storage.hostname=localhost
Expand Down

0 comments on commit f615d2a

Please sign in to comment.