use of uk.gov.gchq.gaffer.traffic.generator.RoadTrafficStringElementGenerator in project Gaffer by gchq.
the class Queries method createGraph.
private Graph createGraph(final User user) throws IOException, OperationException {
final Graph graph = new Builder().config(new GraphConfig.Builder().graphId("roadTraffic").build()).addSchemas(StreamUtil.openStreams(ElementGroup.class, "schema")).storeProperties(StreamUtil.openStream(getClass(), "accumulo/store.properties")).build();
final OperationChain<Void> populateChain = new OperationChain.Builder().first(new GenerateElements.Builder<String>().input(IOUtils.readLines(StreamUtil.openStream(getClass(), "roadTrafficSampleData.csv"))).generator(new RoadTrafficStringElementGenerator()).build()).then(new AddElements.Builder().skipInvalidElements(false).build()).build();
graph.execute(populateChain, user);
return graph;
}
Aggregations