/** * Builds a {@link GraphCollection} from the graph referenced by the given * graph variables. * * @param variables graph variables used in GDL script * @return GraphCollection */ public GraphCollection getGraphCollectionByVariables(String... variables) { Collection<GraphHead> graphHeads = getGraphHeadsByVariables(variables); Collection<Vertex> vertices = getVerticesByGraphVariables(variables); Collection<Edge> edges = getEdgesByGraphVariables(variables); return config.getGraphCollectionFactory().fromCollections(graphHeads, vertices, edges); }
/** * Builds a {@link GraphCollection} from the graph referenced by the given * graph variables. * * @param variables graph variables used in GDL script * @return GraphCollection */ public GraphCollection getGraphCollectionByVariables(String... variables) { Collection<GraphHead> graphHeads = getGraphHeadsByVariables(variables); Collection<Vertex> vertices = getVerticesByGraphVariables(variables); Collection<Edge> edges = getEdgesByGraphVariables(variables); return config.getGraphCollectionFactory().fromCollections(graphHeads, vertices, edges); }
@Test public void write() throws Exception { AccumuloEPGMStore accumuloStore = new AccumuloEPGMStore(AccumuloTestSuite.getAcConfig(TEST_02)); FlinkAsciiGraphLoader loader = new FlinkAsciiGraphLoader( GradoopFlinkConfig.createConfig(getExecutionEnvironment())); InputStream inputStream = getClass().getResourceAsStream( GradoopTestUtils.SOCIAL_NETWORK_GDL_FILE); loader.initDatabaseFromStream(inputStream); GradoopFlinkConfig flinkConfig = GradoopFlinkConfig.createConfig(getExecutionEnvironment()); new AccumuloDataSink(accumuloStore, flinkConfig) .write(flinkConfig.getGraphCollectionFactory() .fromCollections( loader.getGraphHeads(), loader.getVertices(), loader.getEdges())); getExecutionEnvironment().execute(); accumuloStore.flush(); validateEPGMElementCollections(loader.getGraphHeads(), accumuloStore.getGraphSpace().readRemainsAndClose()); validateEPGMElementCollections(loader.getVertices(), accumuloStore.getVertexSpace().readRemainsAndClose()); validateEPGMGraphElementCollections(loader.getVertices(), accumuloStore.getVertexSpace().readRemainsAndClose()); validateEPGMElementCollections(loader.getEdges(), accumuloStore.getEdgeSpace().readRemainsAndClose()); validateEPGMGraphElementCollections(loader.getEdges(), accumuloStore.getEdgeSpace().readRemainsAndClose()); accumuloStore.close(); }
.fromCollections( loader.getGraphHeads(), loader.getVertices(),