Search in sources :

Example 31 with IFrameTupleAccessor

use of org.apache.hyracks.api.comm.IFrameTupleAccessor in project asterixdb by apache.

the class VPartitionTupleBufferManager method getTuplePointerAccessor.

@Override
public ITuplePointerAccessor getTuplePointerAccessor(final RecordDescriptor recordDescriptor) {
    return new AbstractTuplePointerAccessor() {

        FrameTupleAccessor innerAccessor = new FrameTupleAccessor(recordDescriptor);

        @Override
        IFrameTupleAccessor getInnerAccessor() {
            return innerAccessor;
        }

        @Override
        void resetInnerAccessor(TuplePointer tuplePointer) {
            partitionArray[parsePartitionId(tuplePointer.getFrameIndex())].getFrame(parseFrameIdInPartition(tuplePointer.getFrameIndex()), tempInfo);
            innerAccessor.reset(tempInfo.getBuffer(), tempInfo.getStartOffset(), tempInfo.getLength());
        }
    };
}
Also used : TuplePointer(org.apache.hyracks.dataflow.std.structures.TuplePointer) FrameTupleAccessor(org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor) IFrameTupleAccessor(org.apache.hyracks.api.comm.IFrameTupleAccessor)

Aggregations

IFrameTupleAccessor (org.apache.hyracks.api.comm.IFrameTupleAccessor)31 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)12 AggregateState (org.apache.hyracks.dataflow.std.group.AggregateState)11 DataOutput (java.io.DataOutput)10 ArrayTupleBuilder (org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder)10 IOException (java.io.IOException)8 ByteBuffer (java.nio.ByteBuffer)8 VSizeFrame (org.apache.hyracks.api.comm.VSizeFrame)7 IFieldAggregateDescriptor (org.apache.hyracks.dataflow.std.group.IFieldAggregateDescriptor)7 FrameTupleReference (org.apache.hyracks.dataflow.common.data.accessors.FrameTupleReference)6 IAggregatorDescriptor (org.apache.hyracks.dataflow.std.group.IAggregatorDescriptor)5 FrameTupleAccessor (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)4 FrameTupleAppender (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAppender)4 IFrame (org.apache.hyracks.api.comm.IFrame)3 ITuplePartitionComputer (org.apache.hyracks.api.dataflow.value.ITuplePartitionComputer)3 RecordDescriptor (org.apache.hyracks.api.dataflow.value.RecordDescriptor)3 FrameManager (org.apache.hyracks.control.nc.resources.memory.FrameManager)3 IPointable (org.apache.hyracks.data.std.api.IPointable)3 ByteBufferInputStream (org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream)3 Test (org.junit.Test)3