use of org.apache.asterix.external.dataflow.FrameFullTupleForwarder in project asterixdb by apache.
the class DataflowUtils method getTupleForwarder.
public static ITupleForwarder getTupleForwarder(Map<String, String> configuration, FeedLogManager feedLogManager) throws HyracksDataException {
ITupleForwarder.TupleForwardPolicy policyType = null;
String propValue = configuration.get(ITupleForwarder.FORWARD_POLICY);
if (ExternalDataUtils.isFeed(configuration)) {
// TODO pass this value in the configuration and avoid this check for feeds
policyType = TupleForwardPolicy.FEED;
} else if (propValue == null) {
policyType = TupleForwardPolicy.FRAME_FULL;
} else {
policyType = TupleForwardPolicy.valueOf(propValue.trim().toUpperCase());
}
switch(policyType) {
case FEED:
return new FeedTupleForwarder(feedLogManager);
case FRAME_FULL:
return new FrameFullTupleForwarder();
case COUNTER_TIMER_EXPIRED:
return CounterTimerTupleForwarder.create(configuration);
case RATE_CONTROLLED:
return RateControlledTupleForwarder.create(configuration);
default:
throw new RuntimeDataException(ErrorCode.UTIL_DATAFLOW_UTILS_UNKNOWN_FORWARD_POLICY);
}
}
Aggregations