Class RepeatOperator<Type>
java.lang.Object
org.apache.wayang.core.plan.wayangplan.OperatorBase
org.apache.wayang.basic.operators.RepeatOperator<Type>
- All Implemented Interfaces:
Serializable,ActualOperator,ElementaryOperator,LoopHeadOperator,Operator
- Direct Known Subclasses:
FlinkRepeatExpandedOperator,FlinkRepeatOperator,JavaRepeatOperator,SparkRepeatOperator
public class RepeatOperator<Type>
extends OperatorBase
implements ElementaryOperator, LoopHeadOperator
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wayang.core.plan.wayangplan.OperatorBase
OperatorBase.GsonSerializerNested classes/interfaces inherited from interface org.apache.wayang.core.plan.wayangplan.LoopHeadOperator
LoopHeadOperator.State -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields inherited from class org.apache.wayang.core.plan.wayangplan.OperatorBase
inputSlots, outputSlots, STANDARD_OPERATOR_ARGSFields inherited from interface org.apache.wayang.core.plan.wayangplan.Operator
FIRST_EPOCH -
Constructor Summary
ConstructorsConstructorDescriptionRepeatOperator(Integer numIterations, Class<Type> typeClass) Creates a new instance.RepeatOperator(Integer numIterations, DataSetType<Type> type) Creates a new instance.RepeatOperator(RepeatOperator<Type> that) Creates a copy of the givenRepeatOperator. -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginIteration(Operator beginOperator, int beginInputIndex) voidconnectFinalOutputTo(Operator outputOperator, int thatInputIndex) createCardinalityEstimator(int outputIndex, Configuration configuration) voidendIteration(Operator endOperator, int endOpOutputIndex) Collection<InputSlot<?>>Retrieve thoseInputSlots that are required to evaluate the loop condition.Collection<OutputSlot<?>>Retrieve thoseOutputSlots that forward theLoopHeadOperator.getConditionInputSlots().Collection<OutputSlot<?>>If this instance is the head of a loop, then return theseOutputSlots that form the final result of the iteration.Collection<OutputSlot<?>>getForwards(InputSlot<?> input) Declare forward rules.Collection<InputSlot<?>>Collection<OutputSlot<?>>If this instance is the head of a loop, then return theseOutputSlots that go into the loop body (as opposed to theOutputSlots that form the final result of the iteration).Collection<InputSlot<?>>If this instance is the head of a loop, then return theseInputSlots that initialize the loop.intintgetState()Optional operation.getType()voidinitialize(Operator initOperator, int initOpOutputIndex) booleanTells whether the giveninputis read by this operator.voidsetState(LoopHeadOperator.State state) Optional operation.Methods inherited from class org.apache.wayang.core.plan.wayangplan.OperatorBase
accept, addBroadcastInput, addTargetPlatform, at, collectMappedInputSlots, collectMappedOutputSlots, copy, createCopy, getAllInputs, getAllOutputs, getCardinalityEstimator, getContainer, getEpoch, getName, getOriginal, getSimpleClassName, getTargetPlatforms, isAuxiliary, isSupportingBroadcastInputs, propagateInputCardinality, propagateOutputCardinality, setAuxiliary, setCardinalityEstimator, setContainer, setEpoch, setName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.wayang.core.plan.wayangplan.ActualOperator
acceptMethods inherited from interface org.apache.wayang.core.plan.wayangplan.ElementaryOperator
getCardinalityEstimator, isAuxiliary, setAuxiliary, setCardinalityEstimatorMethods inherited from interface org.apache.wayang.core.plan.wayangplan.LoopHeadOperator
getCardinalityPusher, getFinalizationPusher, getInitializationPusherMethods inherited from interface org.apache.wayang.core.plan.wayangplan.Operator
addBroadcastInput, addTargetPlatform, broadcastTo, broadcastTo, collectMappedInputSlots, collectMappedOutputSlots, connectTo, connectTo, getAllInputs, getAllOutputs, getContainer, getEffectiveOccupant, getEffectiveOccupant, getEpoch, getEstimationContextProperties, getInnermostLoop, getInput, getInput, getLoopStack, getName, getNumBroadcastInputs, getNumInputs, getNumOutputs, getNumRegularInputs, getOuterInputSlot, getOutermostInputSlot, getOutermostOutputSlots, getOutput, getOutput, getParent, getTargetPlatforms, isAlternative, isConversion, isElementary, isExecutionOperator, isFeedbackInput, isFeedforwardOutput, isLoopHead, isLoopSubplan, isOwnerOf, isSink, isSource, isSubplan, isSupportingBroadcastInputs, isUnconnected, propagateInputCardinality, propagateOutputCardinality, propagateOutputCardinality, replaceWith, setContainer, setEpoch, setInput, setName, setOutput
-
Field Details
-
INITIAL_INPUT_INDEX
public static final int INITIAL_INPUT_INDEX- See Also:
-
ITERATION_INPUT_INDEX
public static final int ITERATION_INPUT_INDEX- See Also:
-
ITERATION_OUTPUT_INDEX
public static final int ITERATION_OUTPUT_INDEX- See Also:
-
FINAL_OUTPUT_INDEX
public static final int FINAL_OUTPUT_INDEX- See Also:
-
-
Constructor Details
-
RepeatOperator
Creates a new instance.- Parameters:
numIterations- number of iterations to be performedtypeClass- of the "circulated" dataset
-
RepeatOperator
Creates a new instance.- Parameters:
numIterations- number of iterations to be performedtype- of the "circulated" dataset
-
RepeatOperator
Creates a copy of the givenRepeatOperator.- Parameters:
that- should be copied
-
-
Method Details
-
getState
Description copied from interface:LoopHeadOperatorOptional operation. OnlyExecutionOperators need to implement this method.- Specified by:
getStatein interfaceLoopHeadOperator- Returns:
- the current
LoopHeadOperator.Stateof this instance
-
setState
Description copied from interface:LoopHeadOperatorOptional operation. OnlyExecutionOperators need to implement this method. Sets theLoopHeadOperator.Stateof this instance.- Specified by:
setStatein interfaceLoopHeadOperator
-
getType
-
initialize
-
beginIteration
-
endIteration
-
connectFinalOutputTo
-
getForwards
Description copied from interface:OperatorDeclare forward rules. Execution engines may take the chance to optimize the executed plans by having forwarded data by-pass this instance. However, note the specific semantics of a forward rule: If anOperatorserves anOutputSlotthat is involved in a foward rule, it will do so by forwarding. If theOutputSlotis not served, then the forwarding does not apply.- Specified by:
getForwardsin interfaceOperator- Returns:
OutputSlots to which this instance forwards the giveninput.- See Also:
-
isReading
Description copied from interface:OperatorTells whether the giveninputis read by this operator. If not, the optimizer can make use of this insight. -
createCardinalityEstimator
public Optional<CardinalityEstimator> createCardinalityEstimator(int outputIndex, Configuration configuration) Description copied from interface:ElementaryOperator- Specified by:
createCardinalityEstimatorin interfaceElementaryOperator- Parameters:
outputIndex- index of theOutputSlotfor that theCardinalityEstimatoris requestedconfiguration- if theCardinalityEstimatordepends on further ones, use this to obtain the latter- Returns:
- an
Optionalthat might provide the requested instance
-
getLoopBodyOutputs
Description copied from interface:LoopHeadOperatorIf this instance is the head of a loop, then return theseOutputSlots that go into the loop body (as opposed to theOutputSlots that form the final result of the iteration).- Specified by:
getLoopBodyOutputsin interfaceLoopHeadOperator- Returns:
- the loop body-bound
OutputSlots
-
getFinalLoopOutputs
Description copied from interface:LoopHeadOperatorIf this instance is the head of a loop, then return theseOutputSlots that form the final result of the iteration.- Specified by:
getFinalLoopOutputsin interfaceLoopHeadOperator- Returns:
- the loop-terminal
OutputSlots
-
getLoopBodyInputs
Description copied from interface:LoopHeadOperatorIf this instance is the head of a loop, then return theseInputSlots that are fed from the loop body (as opposed to theInputSlots that initialize the loop).- Specified by:
getLoopBodyInputsin interfaceLoopHeadOperator- Returns:
- the loop body-bound
InputSlots
-
getLoopInitializationInputs
Description copied from interface:LoopHeadOperatorIf this instance is the head of a loop, then return theseInputSlots that initialize the loop.- Specified by:
getLoopInitializationInputsin interfaceLoopHeadOperator- Returns:
- the initialization
InputSlots
-
getConditionInputSlots
Description copied from interface:LoopHeadOperatorRetrieve thoseInputSlots that are required to evaluate the loop condition.- Specified by:
getConditionInputSlotsin interfaceLoopHeadOperator- Returns:
- the condition
InputSlots
-
getConditionOutputSlots
Description copied from interface:LoopHeadOperatorRetrieve thoseOutputSlots that forward theLoopHeadOperator.getConditionInputSlots().- Specified by:
getConditionOutputSlotsin interfaceLoopHeadOperator- Returns:
- the condition
OutputSlots
-
getNumIterations
public int getNumIterations() -
getNumExpectedIterations
public int getNumExpectedIterations()- Specified by:
getNumExpectedIterationsin interfaceLoopHeadOperator- Returns:
- a number of expected iterations; not necessarily the actual value
-