}, null, new SpoolingResultIterator.SpoolingResultIteratorFactory(context.getConnection().getQueryServices()), context.getScan(), false, null, null); List<KeyRange> keyRanges = parallelIterators.getSplits(); return keyRanges;
@SuppressWarnings("deprecation") private static ParallelIteratorFactory buildResultIteratorFactory(StatementContext context, FilterableStatement statement, TableRef tableRef, OrderBy orderBy, Integer limit,Integer offset, boolean allowPageFilter) throws SQLException { if ((isSerial(context, statement, tableRef, orderBy, getEstimateOfDataSizeToScanIfWithinThreshold(context, tableRef.getTable(), QueryUtil.getOffsetLimit(limit, offset)) != null) || isRoundRobinPossible(orderBy, context) || isPacingScannersPossible(context))) { return ParallelIteratorFactory.NOOP_FACTORY; } ParallelIteratorFactory spoolingResultIteratorFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory( context.getConnection().getQueryServices()); // If we're doing an order by then we need the full result before we can do anything, // so we don't bother chunking it. If we're just doing a simple scan then we chunk // the scan to have a quicker initial response. if (!orderBy.getOrderByExpressions().isEmpty()) { return spoolingResultIteratorFactory; } else { return new ChunkedResultIterator.ChunkedResultIteratorFactory( spoolingResultIteratorFactory, context.getConnection().getMutationState(), tableRef); } }
@SuppressWarnings("deprecation") private static ParallelIteratorFactory buildResultIteratorFactory(StatementContext context, FilterableStatement statement, TableRef tableRef, OrderBy orderBy, Integer limit,Integer offset, boolean allowPageFilter) throws SQLException { if ((isSerial(context, statement, tableRef, orderBy, getEstimateOfDataSizeToScanIfWithinThreshold(context, tableRef.getTable(), QueryUtil.getOffsetLimit(limit, offset)) != null) || isRoundRobinPossible(orderBy, context) || isPacingScannersPossible(context))) { return ParallelIteratorFactory.NOOP_FACTORY; } ParallelIteratorFactory spoolingResultIteratorFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory( context.getConnection().getQueryServices()); // If we're doing an order by then we need the full result before we can do anything, // so we don't bother chunking it. If we're just doing a simple scan then we chunk // the scan to have a quicker initial response. if (!orderBy.getOrderByExpressions().isEmpty()) { return spoolingResultIteratorFactory; } else { return new ChunkedResultIterator.ChunkedResultIteratorFactory( spoolingResultIteratorFactory, context.getConnection().getMutationState(), tableRef); } }
private ParallelIteratorFactory wrapParallelIteratorFactory () { ParallelIteratorFactory innerFactory; QueryServices services = context.getConnection().getQueryServices(); if (groupBy.isEmpty() || groupBy.isOrderPreserving()) { if (ScanUtil.isPacingScannersPossible(context)) { innerFactory = ParallelIteratorFactory.NOOP_FACTORY; } else { innerFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory(services); } } else { innerFactory = new OrderingResultIteratorFactory(services,this.getOrderBy()); } if (parallelIteratorFactory == null) { return innerFactory; } // wrap any existing parallelIteratorFactory return new WrappingResultIteratorFactory(innerFactory, parallelIteratorFactory); }
private ParallelIteratorFactory wrapParallelIteratorFactory () { ParallelIteratorFactory innerFactory; QueryServices services = context.getConnection().getQueryServices(); if (groupBy.isEmpty() || groupBy.isOrderPreserving()) { if (ScanUtil.isPacingScannersPossible(context)) { innerFactory = ParallelIteratorFactory.NOOP_FACTORY; } else { innerFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory(services); } } else { innerFactory = new OrderingResultIteratorFactory(services,this.getOrderBy()); } if (parallelIteratorFactory == null) { return innerFactory; } // wrap any existing parallelIteratorFactory return new WrappingResultIteratorFactory(innerFactory, parallelIteratorFactory); }
@SuppressWarnings("deprecation") private static ParallelIteratorFactory buildResultIteratorFactory(StatementContext context, FilterableStatement statement, TableRef tableRef, OrderBy orderBy, Integer limit,Integer offset, boolean allowPageFilter) throws SQLException { if ((isSerial(context, statement, tableRef, orderBy, getEstimateOfDataSizeToScanIfWithinThreshold(context, tableRef.getTable(), QueryUtil.getOffsetLimit(limit, offset)) != null) || isRoundRobinPossible(orderBy, context) || isPacingScannersPossible(context))) { return ParallelIteratorFactory.NOOP_FACTORY; } ParallelIteratorFactory spoolingResultIteratorFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory( context.getConnection().getQueryServices()); // If we're doing an order by then we need the full result before we can do anything, // so we don't bother chunking it. If we're just doing a simple scan then we chunk // the scan to have a quicker initial response. if (!orderBy.getOrderByExpressions().isEmpty()) { return spoolingResultIteratorFactory; } else { return new ChunkedResultIterator.ChunkedResultIteratorFactory( spoolingResultIteratorFactory, context.getConnection().getMutationState(), tableRef); } }
private ParallelIteratorFactory wrapParallelIteratorFactory () { ParallelIteratorFactory innerFactory; QueryServices services = context.getConnection().getQueryServices(); if (groupBy.isEmpty() || groupBy.isOrderPreserving()) { if (ScanUtil.isPacingScannersPossible(context)) { innerFactory = ParallelIteratorFactory.NOOP_FACTORY; } else { innerFactory = new SpoolingResultIterator.SpoolingResultIteratorFactory(services); } } else { innerFactory = new OrderingResultIteratorFactory(services,this.getOrderBy()); } if (parallelIteratorFactory == null) { return innerFactory; } // wrap any existing parallelIteratorFactory return new WrappingResultIteratorFactory(innerFactory, parallelIteratorFactory); }