public CloseableIterable<? extends Element> getAllElements() { // --------------------------------------------------------- final GetAllElements operation = new GetAllElements(); // --------------------------------------------------------- return runExample(operation, null); }
public CloseableIterable<Element> getAllElements() { // --------------------------------------------------------- final GetAllElements<Element> operation = new GetAllElements<>(); // --------------------------------------------------------- return runExample(operation); }
public GroupCounts countAllElementGroups() { // --------------------------------------------------------- final OperationChain<GroupCounts> opChain = new OperationChain.Builder() .first(new GetAllElements<>()) .then(new CountGroups()) .build(); // --------------------------------------------------------- return runExample(opChain); }
public GroupCounts countAllElementGroups() { // --------------------------------------------------------- final OperationChain<GroupCounts> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new CountGroups()) .build(); // --------------------------------------------------------- return runExample(opChain, null); }
public GroupCounts countAllElementGroupsWithLimit() { // --------------------------------------------------------- final OperationChain<GroupCounts> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new CountGroups(5)) .build(); // --------------------------------------------------------- return runExample(opChain, null); } }
public GroupCounts countAllElementGroupsWithLimit() { // --------------------------------------------------------- final OperationChain<GroupCounts> opChain = new OperationChain.Builder() .first(new GetAllElements<>()) .then(new CountGroups(5)) .build(); // --------------------------------------------------------- return runExample(opChain); } }
public Iterable<? extends Element> limitElementsTo3() { // --------------------------------------------------------- final OperationChain<Iterable<? extends Element>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new Limit<>(3)) .build(); // --------------------------------------------------------- return runExample(opChain, null); }
public void limitElementsTo3WithoutTruncation() { // --------------------------------------------------------- final OperationChain<Iterable<? extends Element>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new Limit<>(3, false)) .build(); // --------------------------------------------------------- showExample(opChain, "Setting this flag to false will " + "throw an error instead of truncating the iterable. " + "In this case there are more than 3 elements, so " + "when executed a LimitExceededException would be thrown."); }
public Iterable<Element> limitElementsTo3InChain() { // --------------------------------------------------------- final OperationChain<CloseableIterable<Element>> opChain = new OperationChain.Builder() .first(new GetAllElements<>()) .then(new Limit.Builder<Element>() .limitResults(3) .build()) .build(); // --------------------------------------------------------- return runExample(opChain); } }
public JobDetail getJobDetailsInOperationChain() { // --------------------------------------------------------- final OperationChain<JobDetail> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new DiscardOutput()) .then(new GetJobDetails()) .build(); // --------------------------------------------------------- final JobDetail jobDetail = runExample(opChain, null); jobId = jobDetail.getJobId(); return jobDetail; } }
public JobDetail exportAndGetJobDetails() { // --------------------------------------------------------- final OperationChain<JobDetail> exportOpChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToGafferResultCache<>()) .then(new DiscardOutput()) .then(new GetJobDetails()) .build(); // --------------------------------------------------------- jobDetail = runExample(exportOpChain, null); return jobDetail; }
public JobDetail exportAndGetJobDetails() { // --------------------------------------------------------- final OperationChain<JobDetail> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToGafferResultCache<>()) .then(new DiscardOutput()) .then(new GetJobDetails()) .build(); // ---------------------------------------------- ----------- jobDetail = runExample(opChain, null); return jobDetail; }
public Iterable<? extends Element> limitElementsTo3WithBuilder() { // --------------------------------------------------------- final OperationChain<Iterable<? extends Element>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new Limit.Builder<Element>() .resultLimit(3) .truncate(true) .build()) .build(); // --------------------------------------------------------- return runExample(opChain, "A builder can also be used to create the limit -" + " note that truncate is set to true by default, so in this case it" + " is redundant, but simply shown for demonstration."); } }
public Iterable<?> simpleExportAndGet() { // --------------------------------------------------------- final OperationChain<Iterable<?>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToSet<>()) .then(new DiscardOutput()) .then(new GetSetExport()) .build(); // --------------------------------------------------------- return runExample(opChain, null); }
public Iterable<?> simpleExportAndGet() { // --------------------------------------------------------- final OperationChain<Iterable<?>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToSet<>()) .then(new DiscardOutput()) .then(new GetSetExport()) .build(); // --------------------------------------------------------- return runExample(opChain, null); }
public CloseableIterable<?> simpleExportAndGet() { // --------------------------------------------------------- final OperationChain<CloseableIterable<?>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToGafferResultCache<>()) .then(new DiscardOutput()) .then(new GetGafferResultCacheExport()) .build(); // --------------------------------------------------------- return runExample(opChain, null); }
public CloseableIterable<?> simpleExportAndGet() { // --------------------------------------------------------- final OperationChain<CloseableIterable<?>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToGafferResultCache<>()) .then(new DiscardOutput()) .then(new GetGafferResultCacheExport()) .build(); // --------------------------------------------------------- return runExample(opChain, null); }
@Override public void runExamples() { try { final OperationChain<JobDetail> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToGafferResultCache<>()) .then(new DiscardOutput()) .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(); }
public Iterable<?> simpleExportAndGetWithPagination() { // --------------------------------------------------------- final OperationChain<Iterable<?>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToSet<>()) .then(new DiscardOutput()) .then(new GetSetExport.Builder() .start(2) .end(4) .build()) .build(); // --------------------------------------------------------- return runExample(opChain, null); }
public Iterable<?> simpleExportAndGetWithPagination() { // --------------------------------------------------------- final OperationChain<Iterable<?>> opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new ExportToSet<>()) .then(new DiscardOutput()) .then(new GetSetExport.Builder() .start(2) .end(4) .build()) .build(); // --------------------------------------------------------- return runExample(opChain, null); }