@Override public CloseableIterator<Element> iterator() { Stream<Element> elements = mapImpl.getAllElements(getAllElements.getView().getGroups()); elements = GetElementsUtil.applyDirectedTypeFilter(elements, getAllElements.getView().hasEdges(), getAllElements.getDirectedType()); elements = GetElementsUtil.applyView(elements, schema, getAllElements.getView()); elements = elements.map(element -> mapImpl.cloneElement(element, schema)); elements = elements.map(element -> { ViewUtil.removeProperties(getAllElements.getView(), element); return element; }); return new WrappedCloseableIterator<>(elements.iterator()); } }
public CloseableIterable<? extends Element> getAllElements() { // --------------------------------------------------------- final GetAllElements operation = new GetAllElements(); // --------------------------------------------------------- return runExample(operation, null); }
public AccumuloAllElementsRetriever(final AccumuloStore store, final GetAllElements operation, final User user) throws IteratorSettingException, StoreException { super(store, operation, user, false, store.getKeyPackage().getIteratorFactory().getElementPropertyRangeQueryFilter(operation), store.getKeyPackage().getIteratorFactory().getElementPreAggregationFilterIteratorSetting(operation.getView(), store), store.getKeyPackage().getIteratorFactory().getElementPostAggregationFilterIteratorSetting(operation.getView(), store), store.getKeyPackage().getIteratorFactory().getEdgeEntityDirectionFilterIteratorSetting(operation), store.getKeyPackage().getIteratorFactory().getQueryTimeAggregatorIteratorSetting(operation.getView(), store)); }
public CloseableIterable<Element> getAllElements() { // --------------------------------------------------------- final GetAllElements<Element> operation = new GetAllElements<>(); // --------------------------------------------------------- return runExample(operation); }
private CloseableIterable<Element> doOperation(final GetAllElements operation, final ParquetStore store, final User user) throws OperationException { try { return new ParquetElementRetriever(operation.getView(), store, operation.getDirectedType(), null, null, null, user); } catch (final StoreException e) { throw new OperationException("Failed to get elements", e); } } }
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 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 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); }
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<?> 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); }