use of org.apache.hyracks.algebricks.runtime.operators.base.AbstractOneInputSourcePushRuntime in project asterixdb by apache.
the class EmptyTupleSourceRuntimeFactory method createPushRuntime.
@Override
public IPushRuntime createPushRuntime(final IHyracksTaskContext ctx) throws HyracksDataException {
return new AbstractOneInputSourcePushRuntime() {
private final ArrayTupleBuilder tb = new ArrayTupleBuilder(0);
private final FrameTupleAppender appender = new FrameTupleAppender(new VSizeFrame(ctx));
@Override
public void open() throws HyracksDataException {
writer.open();
if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
throw new IllegalStateException();
}
appender.write(writer, true);
}
@Override
public void close() throws HyracksDataException {
writer.close();
}
@Override
public void flush() throws HyracksDataException {
appender.flush(writer);
}
};
}
Aggregations