Search in sources :

Example 1 with ActiveRuntimeId

use of org.apache.asterix.active.ActiveRuntimeId in project asterixdb by apache.

the class FeedCollectOperatorNodePushable method initialize.

@Override
public void initialize() throws HyracksDataException {
    try {
        ActiveRuntimeId runtimeId = new ActiveRuntimeId(connectionId.getFeedId(), FeedRuntimeType.COLLECT.toString(), partition);
        FrameTupleAccessor tAccessor = new FrameTupleAccessor(recordDesc);
        if (policyAccessor.flowControlEnabled()) {
            writer = new FeedRuntimeInputHandler(ctx, connectionId, runtimeId, writer, policyAccessor, tAccessor, activeManager.getFramePool());
        } else {
            writer = new SyncFeedRuntimeInputHandler(ctx, writer, tAccessor);
        }
    } catch (Exception e) {
        throw new HyracksDataException(e);
    }
}
Also used : SyncFeedRuntimeInputHandler(org.apache.asterix.external.feed.dataflow.SyncFeedRuntimeInputHandler) FeedRuntimeInputHandler(org.apache.asterix.external.feed.dataflow.FeedRuntimeInputHandler) ActiveRuntimeId(org.apache.asterix.active.ActiveRuntimeId) SyncFeedRuntimeInputHandler(org.apache.asterix.external.feed.dataflow.SyncFeedRuntimeInputHandler) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) FrameTupleAccessor(org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)

Example 2 with ActiveRuntimeId

use of org.apache.asterix.active.ActiveRuntimeId in project asterixdb by apache.

the class FeedMetaComputeNodePushable method open.

@Override
public void open() throws HyracksDataException {
    ActiveRuntimeId runtimeId = new ActiveRuntimeId(connectionId.getFeedId(), runtimeType.toString(), partition);
    try {
        initializeNewFeedRuntime(runtimeId);
        opened = true;
        writer.open();
    } catch (Exception e) {
        e.printStackTrace();
        throw new HyracksDataException(e);
    }
}
Also used : ActiveRuntimeId(org.apache.asterix.active.ActiveRuntimeId) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException)

Example 3 with ActiveRuntimeId

use of org.apache.asterix.active.ActiveRuntimeId in project asterixdb by apache.

the class FeedMetaStoreNodePushable method open.

@Override
public void open() throws HyracksDataException {
    ActiveRuntimeId runtimeId = new ActiveRuntimeId(connectionId.getFeedId(), runtimeType.toString() + "." + connectionId.getDatasetName(), partition);
    try {
        initializeNewFeedRuntime(runtimeId);
        insertOperator.open();
    } catch (Exception e) {
        LOGGER.log(Level.WARNING, "Failed to open feed store operator", e);
        throw new HyracksDataException(e);
    }
}
Also used : ActiveRuntimeId(org.apache.asterix.active.ActiveRuntimeId) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException)

Example 4 with ActiveRuntimeId

use of org.apache.asterix.active.ActiveRuntimeId in project asterixdb by apache.

the class FeedOperations method SendStopMessageToNode.

public static void SendStopMessageToNode(ICcApplicationContext appCtx, EntityId feedId, String intakeNodeLocation, Integer partition) throws Exception {
    ActiveManagerMessage stopFeedMessage = new ActiveManagerMessage(ActiveManagerMessage.STOP_ACTIVITY, "SRC", new ActiveRuntimeId(feedId, FeedIntakeOperatorNodePushable.class.getSimpleName(), partition));
    SendActiveMessage(appCtx, stopFeedMessage, intakeNodeLocation);
}
Also used : ActiveRuntimeId(org.apache.asterix.active.ActiveRuntimeId) ActiveManagerMessage(org.apache.asterix.active.message.ActiveManagerMessage)

Example 5 with ActiveRuntimeId

use of org.apache.asterix.active.ActiveRuntimeId in project asterixdb by apache.

the class InputHandlerTest method createInputHandler.

private FeedRuntimeInputHandler createInputHandler(IHyracksTaskContext ctx, IFrameWriter writer, FeedPolicyAccessor fpa, ConcurrentFramePool framePool) throws HyracksDataException {
    FrameTupleAccessor fta = Mockito.mock(FrameTupleAccessor.class);
    EntityId feedId = new EntityId(FeedUtils.FEED_EXTENSION_NAME, DATAVERSE, FEED);
    FeedConnectionId connectionId = new FeedConnectionId(feedId, DATASET);
    ActiveRuntimeId runtimeId = new ActiveRuntimeId(feedId, FeedRuntimeType.COLLECT.toString(), 0);
    return new FeedRuntimeInputHandler(ctx, connectionId, runtimeId, writer, fpa, fta, framePool);
}
Also used : EntityId(org.apache.asterix.active.EntityId) FeedRuntimeInputHandler(org.apache.asterix.external.feed.dataflow.FeedRuntimeInputHandler) ActiveRuntimeId(org.apache.asterix.active.ActiveRuntimeId) FeedConnectionId(org.apache.asterix.external.feed.management.FeedConnectionId) FrameTupleAccessor(org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)

Aggregations

ActiveRuntimeId (org.apache.asterix.active.ActiveRuntimeId)5 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)3 FeedRuntimeInputHandler (org.apache.asterix.external.feed.dataflow.FeedRuntimeInputHandler)2 FrameTupleAccessor (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)2 EntityId (org.apache.asterix.active.EntityId)1 ActiveManagerMessage (org.apache.asterix.active.message.ActiveManagerMessage)1 SyncFeedRuntimeInputHandler (org.apache.asterix.external.feed.dataflow.SyncFeedRuntimeInputHandler)1 FeedConnectionId (org.apache.asterix.external.feed.management.FeedConnectionId)1