@Override public RecordReader<GeoWaveInputKey, ?> createRecordReader( final CommonQueryOptions commonOptions, final DataTypeQueryOptions<?> typeOptions, final IndexQueryOptions indexOptions, final QueryConstraints constraints, final TransientAdapterStore adapterStore, final InternalAdapterStore internalAdapterStore, final AdapterIndexMappingStore aimStore, final DataStatisticsStore statsStore, final IndexStore indexStore, final boolean isOutputWritable, final InputSplit inputSplit) throws IOException, InterruptedException { return new GeoWaveRecordReader( commonOptions, typeOptions, indexOptions, constraints, isOutputWritable, adapterStore, internalAdapterStore, aimStore, indexStore, (MapReduceDataStoreOperations) baseOperations, baseOptions.getDataIndexBatchSize()); }
@Override public float getProgress() throws IOException { if ((numKeysRead > 0) && (currentGeoWaveKey == null)) { return 1.0f; } if (currentGeoWaveRangeIndexPair == null) { return 0.0f; } final ProgressPerRange progress = progressPerRange.get(currentGeoWaveRangeIndexPair); if (progress == null) { return Math.min( 1, Math.max( 0, getProgressForRange(currentGeoWaveRangeIndexPair.getRange(), currentGeoWaveKey))); } return Math.min( 1, Math.max( 0, getOverallProgress( currentGeoWaveRangeIndexPair.getRange(), currentGeoWaveKey, progress))); }
private static float getOverallProgress( final GeoWaveRowRange range, final GeoWaveInputKey currentKey, final ProgressPerRange progress) { final float rangeProgress = getProgressForRange(range, currentKey); return progress.getOverallProgress(rangeProgress); }
/** Mostly guava's concatenate method, but there is a need for a callback between iterators */ protected CloseableIterator<Pair<GeoWaveInputKey, T>> concatenateWithCallback( final List<Pair<RangeLocationPair, RowReader<GeoWaveRow>>> inputs, final NextRangeCallback nextRangeCallback, final Index index, final QueryFilter[] filters, final DataIndexRetrieval dataIndexRetrieval) { Preconditions.checkNotNull(inputs); return new CloseableIteratorWrapper<>(new Closeable() { @Override public void close() { for (final Pair<RangeLocationPair, RowReader<GeoWaveRow>> input : inputs) { input.getRight().close(); } } }, rowReaderToKeyValues( index, filters, dataIndexRetrieval, new ConcatenatedIteratorWithCallback(nextRangeCallback, inputs.iterator()))); }
splitInfo.getIndex()).createFilters(splitInfo.getIndex()); sanitizedQueryOptions.setAdapterId(adapterId); fillIterators( allIterators, splitInfo, fillIterators(allIterators, splitInfo, queryFilters, sum, incrementalRangeSums, callback);
concatenateWithCallback( indexReaders, callback,
private static float getProgressForRange( final GeoWaveRowRange range, final GeoWaveInputKey currentKey) { if (currentKey == null) { return 0f; } if ((range != null) && (range.getStartSortKey() != null) && (range.getEndSortKey() != null) && (currentKey.getGeoWaveKey() != null)) { // TODO GEOWAVE-1018 this doesn't account for partition keys at all // just look at the row progress return getProgressForRange( range.getStartSortKey(), range.getEndSortKey(), GeoWaveKey.getCompositeId(currentKey.getGeoWaveKey())); } // if we can't figure it out, then claim no progress return 0f; }