use of org.apache.hyracks.api.comm.VSizeFrame in project asterixdb by apache.
the class SortMergeFrameReader method open.
@Override
public void open() throws HyracksDataException {
if (maxConcurrentMerges >= nSenders) {
List<IFrame> inFrames = new ArrayList<>(nSenders);
for (int i = 0; i < nSenders; ++i) {
inFrames.add(new VSizeFrame(ctx));
}
List<IFrameReader> batch = new ArrayList<IFrameReader>(nSenders);
pbm.getNextBatch(batch, nSenders);
merger = new RunMergingFrameReader(ctx, batch, inFrames, sortFields, comparators, nmkComputer, recordDescriptor);
} else {
// multi level merge.
throw new HyracksDataException("Not yet supported");
}
merger.open();
}
use of org.apache.hyracks.api.comm.VSizeFrame 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);
}
use of org.apache.hyracks.api.comm.VSizeFrame 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;
}
Aggregations