@Override public void close() throws IOException { decorateScanner.close(); }
@Override public Iterator<GTRecord> iterator() { return delegated.iterator(); } }
@Override public GTInfo getInfo() { return rawScanner.getInfo(); }
public boolean fetchNext() throws IOException { if (recordIterator == null) { currentCuboidId = splitResult.cuboidId; scanner = splitResult.table.scan(new GTScanRequestBuilder().setInfo(splitResult.table.getInfo()) .setRanges(null).setDimensions(null).setFilterPushDown(null).createGTScanRequest()); recordIterator = scanner.iterator(); } if (recordIterator.hasNext()) { currentRecord = recordIterator.next(); return true; } else { scanner.close(); recordIterator = null; return false; } }
public boolean fetchNext() throws IOException { if (recordIterator == null) { if (cuboidIterator.hasNext()) { CuboidResult cuboid = cuboidIterator.next(); currentCuboidId = cuboid.cuboidId; scanner = cuboid.table.scan(new GTScanRequestBuilder().setInfo(cuboid.table.getInfo()).setRanges(null).setDimensions(null).setFilterPushDown(null).createGTScanRequest()); recordIterator = scanner.iterator(); } else { return false; } } if (recordIterator.hasNext()) { currentRecord = recordIterator.next(); return true; } else { scanner.close(); recordIterator = null; return fetchNext(); } }
public void close() throws IOException { internal.close(); } }
public boolean fetchNext() throws IOException { if (recordIterator == null) { currentCuboidId = splitResult.cuboidId; scanner = splitResult.table.scan(new GTScanRequestBuilder().setInfo(splitResult.table.getInfo()) .setRanges(null).setDimensions(null).setFilterPushDown(null).createGTScanRequest()); recordIterator = scanner.iterator(); } if (recordIterator.hasNext()) { currentRecord = recordIterator.next(); return true; } else { scanner.close(); recordIterator = null; return false; } }
@Override public Iterator<GTRecord> iterator() { return new Iterator<GTRecord>() { private Iterator<GTRecord> inputIterator = rawScanner.iterator();
@Override public GTInfo getInfo() { return delegated.getInfo(); }
@Override public void close() throws IOException { rawScanner.close(); }
public boolean fetchNext() throws IOException { if (recordIterator == null) { if (cuboidIterator.hasNext()) { CuboidResult cuboid = cuboidIterator.next(); currentCuboidId = cuboid.cuboidId; scanner = cuboid.table.scan(new GTScanRequestBuilder().setInfo(cuboid.table.getInfo()).setRanges(null).setDimensions(null).setFilterPushDown(null).createGTScanRequest()); recordIterator = scanner.iterator(); } else { return false; } } if (recordIterator.hasNext()) { currentRecord = recordIterator.next(); return true; } else { scanner.close(); recordIterator = null; return fetchNext(); } }
public Iterator<GTRecord> iterator() { // to troubleshoot a myth NPE on line: return internal.iterator() checkNPE(); return internal.iterator(); }
public GTAggregateScanner(IGTScanner input, GTScanRequest req, boolean spillEnabled) { if (!req.hasAggregation()) throw new IllegalStateException(); if (input instanceof GTFilterScanner) { logger.info("setting IGTBypassChecker of child"); ((GTFilterScanner) input).setChecker(this); } else { logger.info("applying a GTFilterScanner with IGTBypassChecker on top child"); input = new GTFilterScanner(input, null, this); } this.inputScanner = input; this.info = this.inputScanner.getInfo(); this.dimensions = req.getDimensions(); this.groupBy = req.getAggrGroupBy(); this.metrics = req.getAggrMetrics(); this.metricsAggrFuncs = req.getAggrMetricsFuncs(); this.measureCodec = req.createMeasureCodec(); this.spillThreshold = (long) (req.getAggCacheMemThreshold() * MemoryBudgetController.ONE_GB); this.aggrMask = new boolean[metricsAggrFuncs.length]; this.storagePushDownLimit = req.getStoragePushDownLimit(); this.storageLimitLevel = req.getStorageLimitLevel(); this.spillEnabled = spillEnabled; this.havingFilter = req.getHavingFilterPushDown(); this.aggrCache = new AggregationCache(); Arrays.fill(aggrMask, true); }
@Override public void close() throws IOException { delegated.close(); }
@Override public Iterator<GTRecord> iterator() { return new StreamMergeGTRecordIterator(delegated.iterator()); }
@Override public GTInfo getInfo() { return delegated.getInfo(); }
@Override public void close() throws IOException { inputScanner.close(); aggrCache.close(); }
public Iterator<Object[]> valuesIterator(int[] gtDimsIdx, int[] gtMetricsIdx) { return new StreamMergeValuesIterator(delegated.iterator(), gtDimsIdx, gtMetricsIdx); }
@Override public GTInfo getInfo() { return rawScanner.getInfo(); }
@SuppressWarnings("unused") private void testScanRecords(String msg) throws IOException { long t = System.currentTimeMillis(); IGTScanner scan = simpleStore.scan(new GTScanRequestBuilder().setInfo(info).setRanges(null).setDimensions(null).setFilterPushDown(null).createGTScanRequest()); int count = 0; for (GTRecord rec : scan) { count++; } scan.close(); t = System.currentTimeMillis() - t; logger.info(msg + ", " + count + " records, " + speed(t) + "K rec/sec"); }