public class AggregatorAdapters extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
aggregateBuffered(ByteBuffer buf,
int position)
Call
BufferAggregator.aggregate(ByteBuffer, int) on all of our aggregators. |
void |
aggregateVector(ByteBuffer buf,
int numRows,
int[] positions,
int[] rows)
Call
VectorAggregator.aggregate(ByteBuffer, int, int[], int[], int) on all of our aggregators. |
void |
aggregateVector(ByteBuffer buf,
int position,
int start,
int end)
Call
VectorAggregator.aggregate(ByteBuffer, int, int, int) on all of our aggregators. |
int[] |
aggregatorPositions()
Return the individual positions of each aggregator within a hypothetical buffer of size
spaceNeeded(). |
void |
close()
Close all of our aggregators.
|
List<AggregatorFactory> |
factories()
Return the
AggregatorFactory objects that were used to create this object. |
static AggregatorAdapters |
factorizeBuffered(ColumnSelectorFactory columnSelectorFactory,
List<AggregatorFactory> aggregatorFactories)
Create an adapters object based on
BufferAggregator. |
static AggregatorAdapters |
factorizeVector(VectorColumnSelectorFactory columnSelectorFactory,
List<AggregatorFactory> aggregatorFactories)
Create an adapters object based on
VectorAggregator. |
Object |
get(ByteBuffer buf,
int position,
int aggregatorNumber)
Retrieve aggregation state from one of our aggregators.
|
void |
init(ByteBuffer buf,
int position)
Initialize all aggregators.
|
void |
relocate(int oldPosition,
int newPosition,
ByteBuffer oldBuffer,
ByteBuffer newBuffer)
Inform all of our aggregators that they are being relocated.
|
int |
size()
Return the number of aggregators in this object.
|
int |
spaceNeeded()
Return the amount of buffer bytes needed by all aggregators wrapped up in this object.
|
public static AggregatorAdapters factorizeVector(VectorColumnSelectorFactory columnSelectorFactory, List<AggregatorFactory> aggregatorFactories)
VectorAggregator.public static AggregatorAdapters factorizeBuffered(ColumnSelectorFactory columnSelectorFactory, List<AggregatorFactory> aggregatorFactories)
BufferAggregator.public int spaceNeeded()
public List<AggregatorFactory> factories()
AggregatorFactory objects that were used to create this object.public int[] aggregatorPositions()
spaceNeeded().public int size()
public void init(ByteBuffer buf, int position)
buf - aggregation bufferposition - position in buffer where our block of size spaceNeeded() startspublic void aggregateBuffered(ByteBuffer buf, int position)
BufferAggregator.aggregate(ByteBuffer, int) on all of our aggregators.
This method is only valid if the underlying aggregators are BufferAggregator.public void aggregateVector(ByteBuffer buf, int position, int start, int end)
VectorAggregator.aggregate(ByteBuffer, int, int, int) on all of our aggregators.
This method is only valid if the underlying aggregators are VectorAggregator.public void aggregateVector(ByteBuffer buf, int numRows, int[] positions, @Nullable int[] rows)
VectorAggregator.aggregate(ByteBuffer, int, int[], int[], int) on all of our aggregators.
This method is only valid if the underlying aggregators are VectorAggregator.@Nullable public Object get(ByteBuffer buf, int position, int aggregatorNumber)
buf - aggregation bufferposition - position in buffer where our block of size spaceNeeded() startsaggregatorNumber - which aggregator to retrieve state, from 0 to size() - 1public void relocate(int oldPosition,
int newPosition,
ByteBuffer oldBuffer,
ByteBuffer newBuffer)
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.