use of org.apache.hyracks.dataflow.std.base.AbstractUnaryOutputSourceOperatorNodePushable in project asterixdb by apache.
the class ExternalScanOperatorDescriptor method createPushRuntime.
@Override
public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx, IRecordDescriptorProvider recordDescProvider, final int partition, final int nPartitions) throws HyracksDataException {
return new AbstractUnaryOutputSourceOperatorNodePushable() {
@Override
public void initialize() throws HyracksDataException {
IDataSourceAdapter adapter = null;
try {
writer.open();
adapter = adapterFactory.createAdapter(ctx, partition);
adapter.start(partition, writer);
} catch (Exception e) {
writer.fail();
throw new HyracksDataException(e);
} finally {
writer.close();
}
}
};
}
use of org.apache.hyracks.dataflow.std.base.AbstractUnaryOutputSourceOperatorNodePushable in project asterixdb by apache.
the class AlgebricksMetaOperatorDescriptor method createSourceInputPushRuntime.
private IOperatorNodePushable createSourceInputPushRuntime(final IHyracksTaskContext ctx) {
return new AbstractUnaryOutputSourceOperatorNodePushable() {
@Override
public void initialize() throws HyracksDataException {
IFrameWriter startOfPipeline;
RecordDescriptor pipelineOutputRecordDescriptor = outputArity > 0 ? AlgebricksMetaOperatorDescriptor.this.outRecDescs[0] : null;
PipelineAssembler pa = new PipelineAssembler(pipeline, inputArity, outputArity, null, pipelineOutputRecordDescriptor);
startOfPipeline = pa.assemblePipeline(writer, ctx);
try {
startOfPipeline.open();
} catch (Exception e) {
startOfPipeline.fail();
throw e;
} finally {
startOfPipeline.close();
}
}
};
}
Aggregations