Search in sources :

Example 6 with FrameManager

use of org.apache.hyracks.control.nc.resources.memory.FrameManager in project asterixdb by apache.

the class FrameFixedFieldTupleAppenderTest method createAppender.

@Before
public void createAppender() throws HyracksDataException {
    appender = new FrameFixedFieldAppender(fields.length);
    FrameManager manager = new FrameManager(TEST_FRAME_SIZE);
    IFrame frame = new VSizeFrame(manager);
    appender.reset(frame, true);
}
Also used : IFrame(org.apache.hyracks.api.comm.IFrame) FrameFixedFieldAppender(org.apache.hyracks.dataflow.common.comm.io.FrameFixedFieldAppender) FrameManager(org.apache.hyracks.control.nc.resources.memory.FrameManager) VSizeFrame(org.apache.hyracks.api.comm.VSizeFrame) Before(org.junit.Before)

Example 7 with FrameManager

use of org.apache.hyracks.control.nc.resources.memory.FrameManager in project asterixdb by apache.

the class FrameFixedFieldTupleAppenderTest method prepareData.

private IFrameTupleAccessor prepareData(DATA_TYPE type) throws HyracksDataException {
    IFrameTupleAccessor accessor = new FrameTupleAccessor(recordDescriptor);
    IFrameTupleAppender appender = new FrameTupleAppender(new VSizeFrame(new FrameManager(INPUT_BUFFER_SIZE)), true);
    int i = 0;
    do {
        switch(type) {
            case NORMAL_RECORD:
                makeATuple(tupleBuilder, i++);
                break;
            case ONE_FIELD_LONG:
                makeASizeUpTuple(tupleBuilder, i++);
                break;
            case ONE_RECORD_LONG:
                makeABigObjectTuple(tupleBuilder, i++);
                break;
        }
    } while (appender.append(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray(), 0, tupleBuilder.getSize()));
    accessor.reset(appender.getBuffer());
    return accessor;
}
Also used : IFrameTupleAccessor(org.apache.hyracks.api.comm.IFrameTupleAccessor) FrameTupleAppender(org.apache.hyracks.dataflow.common.comm.io.FrameTupleAppender) IFrameTupleAppender(org.apache.hyracks.api.comm.IFrameTupleAppender) FrameManager(org.apache.hyracks.control.nc.resources.memory.FrameManager) IFrameTupleAppender(org.apache.hyracks.api.comm.IFrameTupleAppender) VSizeFrame(org.apache.hyracks.api.comm.VSizeFrame) FrameTupleAccessor(org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor) IFrameTupleAccessor(org.apache.hyracks.api.comm.IFrameTupleAccessor)

Aggregations

FrameManager (org.apache.hyracks.control.nc.resources.memory.FrameManager)7 VSizeFrame (org.apache.hyracks.api.comm.VSizeFrame)5 IFrameTupleAccessor (org.apache.hyracks.api.comm.IFrameTupleAccessor)3 Before (org.junit.Before)3 IHyracksDataset (org.apache.hyracks.api.dataset.IHyracksDataset)2 IHyracksDatasetReader (org.apache.hyracks.api.dataset.IHyracksDatasetReader)2 HyracksDataset (org.apache.hyracks.client.dataset.HyracksDataset)2 ResultFrameTupleAccessor (org.apache.hyracks.dataflow.common.comm.io.ResultFrameTupleAccessor)2 ByteBufferInputStream (org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 IFrame (org.apache.hyracks.api.comm.IFrame)1 IFrameTupleAppender (org.apache.hyracks.api.comm.IFrameTupleAppender)1 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1 JobId (org.apache.hyracks.api.job.JobId)1 FrameFixedFieldAppender (org.apache.hyracks.dataflow.common.comm.io.FrameFixedFieldAppender)1 FrameTupleAccessor (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)1 FrameTupleAppender (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAppender)1