@Override protected Map<Comparable, Aggregator[]> makeDimValAggregateStore(TopNParams params) { final ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); return selectorPlus.getColumnSelectorStrategy().makeDimExtractionAggregateStore(); }
@Override protected void updateResults( TopNParams params, Aggregator[][] rowSelector, Map<Comparable, Aggregator[]> aggregatesStore, TopNResultBuilder resultBuilder ) { final ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); selectorPlus.getColumnSelectorStrategy().updateDimExtractionResults( aggregatesStore, resultBuilder ); }
@Override protected Aggregator[][] makeDimValSelector(TopNParams params, int numProcessed, int numToProcess) { if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality"); } ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); return selectorPlus.getColumnSelectorStrategy().getDimExtractionRowSelector(query, params, storageAdapter); }
@Override public Aggregator[][] getDimExtractionRowSelector(TopNQuery query, TopNParams params, StorageAdapter storageAdapter) { if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality"); } // This method is used for the DimExtractionTopNAlgorithm only. // Unlike regular topN we cannot rely on ordering to optimize. // Optimization possibly requires a reverse lookup from value to ID, which is // not possible when applying an extraction function final BaseTopNAlgorithm.AggregatorArrayProvider provider = new BaseTopNAlgorithm.AggregatorArrayProvider( (DimensionSelector) params.getSelectorPlus().getSelector(), query, params.getCardinality(), storageAdapter ); return provider.build(); }
@Override public long scanAndAggregate( TopNParams params, Aggregator[][] rowSelector, Map<Comparable, Aggregator[]> aggregatesStore ) { final Cursor cursor = params.getCursor(); final ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); return selectorPlus.getColumnSelectorStrategy().dimExtractionScanAndAggregate( query, selectorPlus.getSelector(), cursor, rowSelector, aggregatesStore ); }
int[] dimValSelector; try { singleMetricParam = singleMetricAlgo.makeInitParams(params.getSelectorPlus(), params.getCursor()); singleMetricAlgo.run( singleMetricParam, try { allMetricsParam = allMetricAlgo.makeInitParams(params.getSelectorPlus(), params.getCursor()); allMetricAlgo.run( allMetricsParam,
@Override protected Map<Comparable, Aggregator[]> makeDimValAggregateStore(TopNParams params) { final ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); return selectorPlus.getColumnSelectorStrategy().makeDimExtractionAggregateStore(); }
@Override protected void updateResults( TopNParams params, Aggregator[][] rowSelector, Map<Comparable, Aggregator[]> aggregatesStore, TopNResultBuilder resultBuilder ) { final ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); selectorPlus.getColumnSelectorStrategy().updateDimExtractionResults( aggregatesStore, resultBuilder ); }
@Override protected Aggregator[][] makeDimValSelector(TopNParams params, int numProcessed, int numToProcess) { if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality"); } ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); return selectorPlus.getColumnSelectorStrategy().getDimExtractionRowSelector(query, params, storageAdapter); }
@Override public Aggregator[][] getDimExtractionRowSelector(TopNQuery query, TopNParams params, StorageAdapter storageAdapter) { if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality"); } // This method is used for the DimExtractionTopNAlgorithm only. // Unlike regular topN we cannot rely on ordering to optimize. // Optimization possibly requires a reverse lookup from value to ID, which is // not possible when applying an extraction function final BaseTopNAlgorithm.AggregatorArrayProvider provider = new BaseTopNAlgorithm.AggregatorArrayProvider( (DimensionSelector) params.getSelectorPlus().getSelector(), query, params.getCardinality(), storageAdapter ); return provider.build(); }
@Override public long scanAndAggregate( TopNParams params, Aggregator[][] rowSelector, Map<Comparable, Aggregator[]> aggregatesStore ) { final Cursor cursor = params.getCursor(); final ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus(); return selectorPlus.getColumnSelectorStrategy().dimExtractionScanAndAggregate( query, selectorPlus.getSelector(), cursor, rowSelector, aggregatesStore ); }
int[] dimValSelector = null; try { singleMetricParam = singleMetricAlgo.makeInitParams(params.getSelectorPlus(), params.getCursor()); singleMetricAlgo.run( singleMetricParam, try { allMetricsParam = allMetricAlgo.makeInitParams(params.getSelectorPlus(), params.getCursor()); allMetricAlgo.run( allMetricsParam,