Search in sources :

Example 11 with Aggregator

use of org.apache.phoenix.expression.aggregator.Aggregator in project phoenix by apache.

the class SpillManager method toCacheEntry.

/**
 * Helper function to deserialize a byte array into a CacheEntry
 * @param <K>
 * @param bytes
 * @throws IOException
 */
@SuppressWarnings("unchecked")
public <K extends ImmutableBytesWritable> CacheEntry<K> toCacheEntry(byte[] bytes) throws IOException {
    ImmutableBytesPtr key = SpillManager.getKey(bytes);
    Aggregator[] aggs = getAggregators(bytes);
    return new CacheEntry<K>((K) key, aggs);
}
Also used : ImmutableBytesPtr(org.apache.phoenix.hbase.index.util.ImmutableBytesPtr) Aggregator(org.apache.phoenix.expression.aggregator.Aggregator)

Aggregations

Aggregator (org.apache.phoenix.expression.aggregator.Aggregator)11 Tuple (org.apache.phoenix.schema.tuple.Tuple)6 ImmutableBytesPtr (org.apache.phoenix.hbase.index.util.ImmutableBytesPtr)5 List (java.util.List)3 Cell (org.apache.hadoop.hbase.Cell)3 KeyValue (org.apache.hadoop.hbase.KeyValue)3 Region (org.apache.hadoop.hbase.regionserver.Region)3 EncodedColumnQualiferCellsList (org.apache.phoenix.schema.tuple.EncodedColumnQualiferCellsList)3 MultiKeyValueTuple (org.apache.phoenix.schema.tuple.MultiKeyValueTuple)3 PositionBasedMultiKeyValueTuple (org.apache.phoenix.schema.tuple.PositionBasedMultiKeyValueTuple)3 IOException (java.io.IOException)2 SQLException (java.sql.SQLException)2 ArrayList (java.util.ArrayList)2 Configuration (org.apache.hadoop.conf.Configuration)2 RegionCoprocessorEnvironment (org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment)2 ImmutableBytesWritable (org.apache.hadoop.hbase.io.ImmutableBytesWritable)2 RegionScanner (org.apache.hadoop.hbase.regionserver.RegionScanner)2 ServerAggregators (org.apache.phoenix.expression.aggregator.ServerAggregators)2 SingleKeyValueTuple (org.apache.phoenix.schema.tuple.SingleKeyValueTuple)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1