default Sequence<T> withBaggage(Closeable baggage) { return Sequences.withBaggage(this, baggage); } }
@Override public Sequence<T> run(QueryPlus<T> queryPlus, Map<String, Object> responseContext) { return Sequences.withBaggage(runner.run(queryPlus, responseContext), closeable); } };
private Sequence<Row> initAndMergeGroupByResults( final GroupByQuery query, QueryRunner<Row> runner, Map<String, Object> context ) { final GroupByStrategy groupByStrategy = strategySelector.strategize(query); final GroupByQueryResource resource = groupByStrategy.prepareResource(query, false); return Sequences.withBaggage(mergeGroupByResults(groupByStrategy, query, resource, runner, context), resource); }
public TestSequence(final Iterable<T> iterable) { base = Sequences.withBaggage( Sequences.simple(iterable), new Closeable() { @Override public void close() { closed.set(true); } } ); }
return Sequences.withBaggage( mergeResults(new QueryRunner<Row>()
@Override public Sequence<T> run(final QueryPlus<T> queryPlus, Map<String, Object> responseContext) { if (adapter.increment()) { try { final Sequence<T> baseSequence = factory.createRunner(adapter).run(queryPlus, responseContext); return Sequences.withBaggage(baseSequence, adapter.decrementOnceCloseable()); } catch (Throwable t) { try { adapter.decrement(); } catch (Exception e) { t.addSuppressed(e); } throw t; } } else { // Segment was closed before we had a chance to increment the reference count return new ReportTimelineMissingSegmentQueryRunner<T>(descriptor).run(queryPlus, responseContext); } } }
return Sequences.withBaggage( Sequences.concat(subtotalsResults), () -> Lists.reverse(closeOnExit).forEach(closeable -> CloseQuietly.close(closeable))
return Sequences.withBaggage( Sequences.map( Sequences.simple(iterable),
); return Sequences.withBaggage(GroupByQueryHelper.postAggregate(query, index), index);
return Sequences.withBaggage( Sequences.simple( Iterables.transform(
return Sequences.withBaggage( outerQuery.postProcess(GroupByQueryHelper.postAggregate(query, outerQueryResultIndex)), outerQueryResultIndex
Sequences.withBaggage( Sequences.map( cursors,
final Enumerable enumerable = theRel.bind(dataContext); final Enumerator enumerator = enumerable.enumerator(); return Sequences.withBaggage(new BaseSequence<>( new BaseSequence.IteratorMaker<Object[], EnumeratorIterator<Object[]>>()
default Sequence<T> withBaggage(Closeable baggage) { return Sequences.withBaggage(this, baggage); } }
@Override public Sequence<T> run(QueryPlus<T> queryPlus, Map<String, Object> responseContext) { return Sequences.withBaggage(runner.run(queryPlus, responseContext), closeable); } };
private Sequence<Row> initAndMergeGroupByResults( final GroupByQuery query, QueryRunner<Row> runner, Map<String, Object> context ) { final GroupByStrategy groupByStrategy = strategySelector.strategize(query); final GroupByQueryResource resource = groupByStrategy.prepareResource(query, false); return Sequences.withBaggage(mergeGroupByResults(groupByStrategy, query, resource, runner, context), resource); }
return Sequences.withBaggage( mergeResults(new QueryRunner<Row>()
@Override public Sequence<T> run(final QueryPlus<T> queryPlus, Map<String, Object> responseContext) { if (adapter.increment()) { try { final Sequence<T> baseSequence = factory.createRunner(adapter).run(queryPlus, responseContext); return Sequences.withBaggage(baseSequence, adapter.decrementOnceCloseable()); } catch (Throwable t) { try { adapter.decrement(); } catch (Exception e) { t.addSuppressed(e); } throw t; } } else { // Segment was closed before we had a chance to increment the reference count return new ReportTimelineMissingSegmentQueryRunner<T>(descriptor).run(queryPlus, responseContext); } } }
); return Sequences.withBaggage(GroupByQueryHelper.postAggregate(query, index), index);
Sequences.withBaggage( Sequences.map( cursors,