StateReducer(Windowing windowing, StateFactory<?, ?, State<?, ?>> stateFactory, StateMerger<?, ?, State<?, ?>> stateCombiner, StateContext stateContext, LazyAccumulatorProvider accumulators) { this.windowing = windowing; this.trigger = windowing.getTrigger(); this.stateFactory = stateFactory; this.stateCombiner = stateCombiner; this.stateContext = stateContext; this.accumulators = accumulators; }
public AbstractWindowOperator(Windowing<?, WID> windowing, StateFactory<?, ?, State<?, ?>> stateFactory, StateMerger<?, ?, State<?, ?>> stateCombiner, boolean localMode, int descriptorsCacheMaxSize, boolean allowEarlyEmitting, FlinkAccumulatorFactory accumulatorFactory, Settings settings) { this.windowing = Objects.requireNonNull(windowing); this.trigger = windowing.getTrigger(); this.stateFactory = Objects.requireNonNull(stateFactory); this.stateCombiner = Objects.requireNonNull(stateCombiner); this.localMode = localMode; this.descriptorsCacheMaxSize = descriptorsCacheMaxSize; this.allowEarlyEmitting = allowEarlyEmitting; this.accumulatorFactory = Objects.requireNonNull(accumulatorFactory); this.settings = Objects.requireNonNull(settings); }
@SuppressWarnings("unchecked") RSBKReducer( ReduceStateByKey operator, StateContext stateContext, Windowing windowing, FlinkAccumulatorFactory accumulatorFactory, Settings settings) { this.stateFactory = operator.getStateFactory(); this.stateCombiner = operator.getStateMerger(); this.stateContext = stateContext; this.windowing = windowing; this.trigger = windowing.getTrigger(); this.accumulatorFactory = accumulatorFactory; this.settings = settings; }
this.valueExtractor = requireNonNull(valueExtractor); this.watermarkStrategy = requireNonNull(watermarkStrategy); this.trigger = requireNonNull(windowing.getTrigger()); this.scheduler = requireNonNull(scheduler); this.accumulatorFactory = requireNonNull(accumulatorFactory);
this.valueExtractor = requireNonNull(valueExtractor); this.watermarkStrategy = requireNonNull(watermarkStrategy); this.trigger = requireNonNull(windowing.getTrigger()); this.scheduler = requireNonNull(scheduler); this.accumulatorFactory = requireNonNull(accumulatorFactory);
static boolean wantTranslate(ReduceByKey operator) { boolean b = operator.isCombinable() && (operator.getWindowing() == null || (!(operator.getWindowing() instanceof MergingWindowing) && !operator.getWindowing().getTrigger().isStateful())); return b; }
static boolean wantTranslate(ReduceByKey operator, SparkFlowTranslator.AcceptorContext context) { return (operator.getValueComparator() == null || ClassUtils.isComparable(operator.getKeyClass())) && (operator.getWindowing() == null || (!(operator.getWindowing() instanceof MergingWindowing) && !operator.getWindowing().getTrigger().isStateful())); }
!(windowing instanceof MergingWindowing), "MergingWindowing not supported!"); Preconditions.checkState(!windowing.getTrigger().isStateful(), "Stateful triggers not supported!");
!(windowing instanceof MergingWindowing), "MergingWindowing not supported!"); Preconditions.checkState( !windowing.getTrigger().isStateful(), "Stateful triggers not supported!");