.build()) .then(new AddElements()) .build();
@Override public void runExamples() { try { final OperationChain<JobDetail> opChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToGafferResultCache()) .then(new GetJobDetails()) .build(); final JobDetail jobDetails = getGraph().execute(opChain, new User("user01")); jobId = jobDetails.getJobId(); } catch (final OperationException e) { throw new RuntimeException(e); } getJobResults(); }
.build()) .then(new AddElements()) .build();
.build()) .then(new AddElements()) .build();
.build()) .then(new AddElements()) .build(); .build()) .then(new ExportToSet()) .then(new GenerateObjects<Edge, EntitySeed>(destVerticesExtractor)) .then(new GetEdges.Builder<EntitySeed>() .inOutType(IncludeIncomingOutgoingType.OUTGOING) .build()) .then(new ExportToSet()) .then(new GetSetExport()) .build();
.then(new AddElements.Builder() .build()) .build();
.build()) .then(new AddElements()) .build(); graph.execute(addOpChain, user);
.build()) .then(new AddElements()) .build();
.build()) .then(new AddElements()) .build();
.build()) .then(new AddElements()) .build();
.build()) .then(new AddElements()) .build();
public Map<String, CloseableIterable<?>> exportMultipleResultsToGafferResultCacheAndGetAllResults() { // --------------------------------------------------------- final OperationChain<Map<String, CloseableIterable<?>>> opChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToGafferResultCache.Builder() .key("edges") .build()) .then(new GetAllEntities()) .then(new ExportToGafferResultCache.Builder() .key("entities") .build()) .then(new GetExports.Builder() .exports(new GetGafferResultCacheExport.Builder() .key("edges") .build(), new GetGafferResultCacheExport.Builder() .key("entities") .build()) .build()) .build(); // --------------------------------------------------------- return runExample(opChain); } }
protected Graph createExampleGraph() { final Graph graph = new Graph.Builder() .addSchemas(StreamUtil.openStreams(getClass(), "/example/operation/schema")) .storeProperties(StreamUtil.openStream(getClass(), "/example/operation/mockaccumulostore.properties")) .build(); // Create data generator final DataGenerator dataGenerator = new DataGenerator(); // Load data into memory final List<String> data = DataUtils.loadData(StreamUtil.openStream(getClass(), "/example/operation/data.txt", true)); //add the edges to the graph using an operation chain consisting of: //generateElements - generating edges from the data (note these are directed edges) //addElements - add the edges to the graph final OperationChain addOpChain = new OperationChain.Builder() .first(new GenerateElements.Builder<String>() .generator(dataGenerator) .objects(data) .build()) .then(new AddElements()) .build(); try { graph.execute(addOpChain, new User()); } catch (OperationException e) { throw new RuntimeException(e); } return graph; }
public Map<String, CloseableIterable<?>> exportMultipleResultsToGafferResultCacheAndGetAllResults() { // --------------------------------------------------------- final OperationChain<Map<String, CloseableIterable<?>>> opChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToGafferResultCache.Builder() .key("edges") .build()) .then(new GetAllEntities()) .then(new ExportToGafferResultCache.Builder() .key("entities") .build()) .then(new GetExports.Builder() .exports(new GetGafferResultCacheExport.Builder() .key("edges") .build(), new GetGafferResultCacheExport.Builder() .key("entities") .build()) .build()) .build(); // --------------------------------------------------------- return runExample(opChain); } }
public Map<String, CloseableIterable<?>> exportMultipleResultsToSetAndGetAllResults() { // --------------------------------------------------------- final OperationChain<Map<String, CloseableIterable<?>>> opChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToSet.Builder() .key("edges") .build()) .then(new GetAllEntities()) .then(new ExportToSet.Builder() .key("entities") .build()) .then(new GetExports.Builder() .exports(new GetSetExport.Builder() .key("edges") .build(), new GetSetExport.Builder() .key("entities") .build()) .build()) .build(); // --------------------------------------------------------- return runExample(opChain); } }
public Map<String, CloseableIterable<?>> exportMultipleResultsToSetAndGetAllResults() { // --------------------------------------------------------- final OperationChain<Map<String, CloseableIterable<?>>> opChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToSet.Builder() .key("edges") .build()) .then(new GetAllEntities()) .then(new ExportToSet.Builder() .key("entities") .build()) .then(new GetExports.Builder() .exports(new GetSetExport.Builder() .key("edges") .build(), new GetSetExport.Builder() .key("entities") .build()) .build()) .build(); // --------------------------------------------------------- return runExample(opChain); } }
public CloseableIterable<?> simpleExportAndGetWithPagination() { // --------------------------------------------------------- final OperationChain<CloseableIterable<?>> opChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToSet()) .then(new GetSetExport.Builder() .start(2) .end(4) .build()) .build(); // --------------------------------------------------------- return runExample(opChain); }
public JobDetail exportAndGetJobDetails() { // --------------------------------------------------------- final OperationChain<JobDetail> exportOpChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToGafferResultCache()) .then(new GetJobDetails()) .build(); // --------------------------------------------------------- jobDetail = runExample(exportOpChain); return jobDetail; }
public JobDetail exportAndGetJobDetails() { // --------------------------------------------------------- final OperationChain<JobDetail> exportOpChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToGafferResultCache()) .then(new GetJobDetails()) .build(); // --------------------------------------------------------- jobDetail = runExample(exportOpChain); return jobDetail; }
public CloseableIterable<?> simpleExportAndGetWithPagination() { // --------------------------------------------------------- final OperationChain<CloseableIterable<?>> opChain = new OperationChain.Builder() .first(new GetAllEdges()) .then(new ExportToSet()) .then(new GetSetExport.Builder() .start(2) .end(4) .build()) .build(); // --------------------------------------------------------- return runExample(opChain); }