Package org.apache.druid.query.topn
Class HistoricalSingleValueDimSelector1SimpleDoubleAggPooledTopNScannerPrototype
java.lang.Object
org.apache.druid.query.topn.HistoricalSingleValueDimSelector1SimpleDoubleAggPooledTopNScannerPrototype
- All Implemented Interfaces:
Historical1AggPooledTopNScanner<SingleValueHistoricalDimensionSelector,HistoricalColumnSelector, SimpleDoubleBufferAggregator>
public class HistoricalSingleValueDimSelector1SimpleDoubleAggPooledTopNScannerPrototype
extends Object
implements Historical1AggPooledTopNScanner<SingleValueHistoricalDimensionSelector,HistoricalColumnSelector,SimpleDoubleBufferAggregator>
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionlongscanAndAggregate(SingleValueHistoricalDimensionSelector dimensionSelector, HistoricalColumnSelector metricSelector, SimpleDoubleBufferAggregator aggregator, int aggregatorSize, HistoricalCursor cursor, int[] positions, ByteBuffer resultsBuffer) Any changes to this method should be coordinated withTopNUtils,PooledTopNAlgorithm.computeSpecializedScanAndAggregateImplementations()and downstream methods.
-
Constructor Details
-
HistoricalSingleValueDimSelector1SimpleDoubleAggPooledTopNScannerPrototype
public HistoricalSingleValueDimSelector1SimpleDoubleAggPooledTopNScannerPrototype()
-
-
Method Details
-
scanAndAggregate
public long scanAndAggregate(SingleValueHistoricalDimensionSelector dimensionSelector, HistoricalColumnSelector metricSelector, SimpleDoubleBufferAggregator aggregator, int aggregatorSize, HistoricalCursor cursor, int[] positions, ByteBuffer resultsBuffer) Any changes to this method should be coordinated withTopNUtils,PooledTopNAlgorithm.computeSpecializedScanAndAggregateImplementations()and downstream methods. It should be checked with a tool like https://github.com/AdoptOpenJDK/jitwatch that C2 compiler output for this method doesn't have any method calls in the while loop, i. e. all method calls are inlined. To be able to see assembly of this method in JITWatch and other similar tools,PooledTopNAlgorithm.SPECIALIZE_HISTORICAL_SINGLE_VALUE_DIM_SELECTOR_ONE_SIMPLE_DOUBLE_AGG_POOLED_TOPNshould be turned off. Note that in this case the benchmark should be "naturally monomorphic", i. e. execute this method always with the same runtime shape. If the while loop contains not inlined method calls, it should be considered as a performance bug.- Specified by:
scanAndAggregatein interfaceHistorical1AggPooledTopNScanner<SingleValueHistoricalDimensionSelector,HistoricalColumnSelector, SimpleDoubleBufferAggregator> - Parameters:
aggregatorSize- number of bytes required by aggregator for a single aggregationpositions- a cache for positions in resultsBuffer, where specific (indexed) dimension values are aggregated- Returns:
- number of scanned rows, i. e. number of steps made with the given cursor
-