@Override protected void updateResults( PooledTopNParams params, int[] positions, BufferAggregator[] theAggregators, TopNResultBuilder resultBuilder ) { if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality"); } final ByteBuffer resultsBuf = params.getResultsBuf(); final int[] aggregatorSizes = params.getAggregatorSizes(); final DimensionSelector dimSelector = params.getDimSelector(); for (int i = 0; i < positions.length; i++) { int position = positions[i]; if (position >= 0) { Object[] vals = new Object[theAggregators.length]; for (int j = 0; j < theAggregators.length; j++) { vals[j] = theAggregators[j].get(resultsBuf, position); position += aggregatorSizes[j]; } // Output type must be STRING in order for PooledTopNAlgorithm to make sense; so no need to convert value. resultBuilder.addEntry(dimSelector.lookupName(i), i, vals); } } }
if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality");
@Override protected void updateResults( PooledTopNParams params, int[] positions, BufferAggregator[] theAggregators, TopNResultBuilder resultBuilder ) { if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality"); } final ByteBuffer resultsBuf = params.getResultsBuf(); final int[] aggregatorSizes = params.getAggregatorSizes(); final DimensionSelector dimSelector = params.getDimSelector(); for (int i = 0; i < positions.length; i++) { int position = positions[i]; if (position >= 0) { Object[] vals = new Object[theAggregators.length]; for (int j = 0; j < theAggregators.length; j++) { vals[j] = theAggregators[j].get(resultsBuf, position); position += aggregatorSizes[j]; } // Output type must be STRING in order for PooledTopNAlgorithm to make sense; so no need to convert value. resultBuilder.addEntry(dimSelector.lookupName(i), i, vals); } } }
if (params.getCardinality() < 0) { throw new UnsupportedOperationException("Cannot operate on a dimension with unknown cardinality");