Search in sources :

Example 16 with FeedRuntimeInputHandler

use of org.apache.asterix.external.feed.dataflow.FeedRuntimeInputHandler in project asterixdb by apache.

the class FeedMetaStoreNodePushable method initializeNewFeedRuntime.

private void initializeNewFeedRuntime(ActiveRuntimeId runtimeId) throws Exception {
    fta = new FrameTupleAccessor(recordDescProvider.getInputRecordDescriptor(opDesc.getActivityId(), 0));
    insertOperator.setOutputFrameWriter(0, writer, recordDesc);
    if (insertOperator instanceof LSMInsertDeleteOperatorNodePushable) {
        LSMInsertDeleteOperatorNodePushable indexOp = (LSMInsertDeleteOperatorNodePushable) insertOperator;
        if (!indexOp.isPrimary()) {
            writer = insertOperator;
            return;
        }
    }
    if (policyAccessor.flowControlEnabled()) {
        writer = new FeedRuntimeInputHandler(ctx, connectionId, runtimeId, insertOperator, policyAccessor, fta, feedManager.getFramePool());
    } else {
        writer = new SyncFeedRuntimeInputHandler(ctx, insertOperator, fta);
    }
}
Also used : LSMInsertDeleteOperatorNodePushable(org.apache.asterix.common.dataflow.LSMInsertDeleteOperatorNodePushable) SyncFeedRuntimeInputHandler(org.apache.asterix.external.feed.dataflow.SyncFeedRuntimeInputHandler) FeedRuntimeInputHandler(org.apache.asterix.external.feed.dataflow.FeedRuntimeInputHandler) SyncFeedRuntimeInputHandler(org.apache.asterix.external.feed.dataflow.SyncFeedRuntimeInputHandler) FrameTupleAccessor(org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)

Aggregations

FeedRuntimeInputHandler (org.apache.asterix.external.feed.dataflow.FeedRuntimeInputHandler)16 FeedPolicyAccessor (org.apache.asterix.external.feed.policy.FeedPolicyAccessor)13 ConcurrentFramePool (org.apache.asterix.common.memory.ConcurrentFramePool)12 IHyracksTaskContext (org.apache.hyracks.api.context.IHyracksTaskContext)12 Test (org.junit.Test)12 TestControlledFrameWriter (org.apache.hyracks.api.test.TestControlledFrameWriter)8 VSizeFrame (org.apache.hyracks.api.comm.VSizeFrame)7 ByteBuffer (java.nio.ByteBuffer)5 Random (java.util.Random)4 TestFrameWriter (org.apache.hyracks.api.test.TestFrameWriter)4 FrameTupleAccessor (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)4 SyncFeedRuntimeInputHandler (org.apache.asterix.external.feed.dataflow.SyncFeedRuntimeInputHandler)3 ActiveRuntimeId (org.apache.asterix.active.ActiveRuntimeId)2 EntityId (org.apache.asterix.active.EntityId)1 LSMInsertDeleteOperatorNodePushable (org.apache.asterix.common.dataflow.LSMInsertDeleteOperatorNodePushable)1 FeedConnectionId (org.apache.asterix.external.feed.management.FeedConnectionId)1 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1