Skip to content

Commit

Permalink
[#827] add indexed to readLogicalGraph (#828)
Browse files Browse the repository at this point in the history
fixes #827
  • Loading branch information
Kevin Gómez authored and ChrizZz110 committed Jun 22, 2018
1 parent 6f4f5c9 commit f600c16
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -23,6 +23,7 @@
import org.apache.flink.api.java.ExecutionEnvironment;
import org.gradoop.flink.io.impl.csv.CSVDataSink;
import org.gradoop.flink.io.impl.csv.CSVDataSource;
import org.gradoop.flink.io.impl.csv.indexed.IndexedCSVDataSource;
import org.gradoop.flink.io.impl.json.JSONDataSink;
import org.gradoop.flink.io.impl.json.JSONDataSource;
import org.gradoop.flink.model.api.epgm.GraphCollection;
Expand Down Expand Up @@ -70,7 +71,7 @@ protected static CommandLine parseArguments(String[] args, String className)
* @return EPGM logical graph
*/
@SuppressWarnings("unchecked")
protected static LogicalGraph readLogicalGraph(String directory) {
protected static LogicalGraph readLogicalGraph(String directory) throws IOException {
return readLogicalGraph(directory, "json");
}

Expand All @@ -82,7 +83,8 @@ protected static LogicalGraph readLogicalGraph(String directory) {
* @return EPGM logical graph
*/
@SuppressWarnings("unchecked")
protected static LogicalGraph readLogicalGraph(String directory, String format) {
protected static LogicalGraph readLogicalGraph(String directory, String format)
throws IOException {
directory = appendSeparator(directory);

GradoopFlinkConfig config = GradoopFlinkConfig.createConfig(getExecutionEnvironment());
Expand All @@ -92,6 +94,8 @@ protected static LogicalGraph readLogicalGraph(String directory, String format)
return new JSONDataSource(directory, config).getLogicalGraph();
} else if (format.equals("csv")) {
return new CSVDataSource(directory, config).getLogicalGraph();
} else if (format.equals("indexed")) {
return new IndexedCSVDataSource(directory, config).getLogicalGraph();
} else {
throw new IllegalArgumentException("Unsupported format: " + format);
}
Expand Down

0 comments on commit f600c16

Please sign in to comment.