Class RepeatOperator<Type>
- java.lang.Object
-
- org.apache.wayang.core.plan.wayangplan.OperatorBase
-
- org.apache.wayang.basic.operators.RepeatOperator<Type>
-
- All Implemented Interfaces:
java.io.Serializable
,ActualOperator
,ElementaryOperator
,LoopHeadOperator
,Operator
- Direct Known Subclasses:
FlinkRepeatExpandedOperator
,FlinkRepeatOperator
,JavaRepeatOperator
,SparkRepeatOperator
public class RepeatOperator<Type> extends OperatorBase implements ElementaryOperator, LoopHeadOperator
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wayang.core.plan.wayangplan.OperatorBase
OperatorBase.GsonSerializer
-
Nested classes/interfaces inherited from interface org.apache.wayang.core.plan.wayangplan.LoopHeadOperator
LoopHeadOperator.State
-
-
Field Summary
Fields Modifier and Type Field Description static int
FINAL_OUTPUT_INDEX
static int
INITIAL_INPUT_INDEX
static int
ITERATION_INPUT_INDEX
static int
ITERATION_OUTPUT_INDEX
-
Fields inherited from class org.apache.wayang.core.plan.wayangplan.OperatorBase
inputSlots, outputSlots, STANDARD_OPERATOR_ARGS
-
Fields inherited from interface org.apache.wayang.core.plan.wayangplan.Operator
FIRST_EPOCH
-
-
Constructor Summary
Constructors Constructor Description RepeatOperator(java.lang.Integer numIterations, java.lang.Class<Type> typeClass)
Creates a new instance.RepeatOperator(java.lang.Integer numIterations, DataSetType<Type> type)
Creates a new instance.RepeatOperator(RepeatOperator<Type> that)
Creates a copy of the givenRepeatOperator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginIteration(Operator beginOperator, int beginInputIndex)
void
connectFinalOutputTo(Operator outputOperator, int thatInputIndex)
java.util.Optional<CardinalityEstimator>
createCardinalityEstimator(int outputIndex, Configuration configuration)
void
endIteration(Operator endOperator, int endOpOutputIndex)
java.util.Collection<InputSlot<?>>
getConditionInputSlots()
Retrieve thoseInputSlot
s that are required to evaluate the loop condition.java.util.Collection<OutputSlot<?>>
getConditionOutputSlots()
Retrieve thoseOutputSlot
s that forward theLoopHeadOperator.getConditionInputSlots()
.java.util.Collection<OutputSlot<?>>
getFinalLoopOutputs()
If this instance is the head of a loop, then return theseOutputSlot
s that form the final result of the iteration.java.util.Collection<OutputSlot<?>>
getForwards(InputSlot<?> input)
Declare forward rules.java.util.Collection<InputSlot<?>>
getLoopBodyInputs()
java.util.Collection<OutputSlot<?>>
getLoopBodyOutputs()
If this instance is the head of a loop, then return theseOutputSlot
s that go into the loop body (as opposed to theOutputSlot
s that form the final result of the iteration).java.util.Collection<InputSlot<?>>
getLoopInitializationInputs()
If this instance is the head of a loop, then return theseInputSlot
s that initialize the loop.int
getNumExpectedIterations()
int
getNumIterations()
LoopHeadOperator.State
getState()
Optional operation.DataSetType<Type>
getType()
void
initialize(Operator initOperator, int initOpOutputIndex)
boolean
isReading(InputSlot<?> input)
Tells whether the giveninput
is read by this operator.void
setState(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, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.wayang.core.plan.wayangplan.ActualOperator
accept
-
Methods inherited from interface org.apache.wayang.core.plan.wayangplan.ElementaryOperator
getCardinalityEstimator, isAuxiliary, setAuxiliary, setCardinalityEstimator
-
Methods inherited from interface org.apache.wayang.core.plan.wayangplan.LoopHeadOperator
getCardinalityPusher, getFinalizationPusher, getInitializationPusher
-
Methods 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, isElementary, isExecutionOperator, isFeedbackInput, isFeedforwardOutput, isLoopHead, isLoopSubplan, isOwnerOf, isSink, isSource, isSubplan, isSupportingBroadcastInputs, isUnconnected, propagateInputCardinality, propagateOutputCardinality, propagateOutputCardinality, setContainer, setEpoch, setInput, setName, setOutput
-
-
-
-
Field Detail
-
INITIAL_INPUT_INDEX
public static final int INITIAL_INPUT_INDEX
- See Also:
- Constant Field Values
-
ITERATION_INPUT_INDEX
public static final int ITERATION_INPUT_INDEX
- See Also:
- Constant Field Values
-
ITERATION_OUTPUT_INDEX
public static final int ITERATION_OUTPUT_INDEX
- See Also:
- Constant Field Values
-
FINAL_OUTPUT_INDEX
public static final int FINAL_OUTPUT_INDEX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RepeatOperator
public RepeatOperator(java.lang.Integer numIterations, java.lang.Class<Type> typeClass)
Creates a new instance.- Parameters:
numIterations
- number of iterations to be performedtypeClass
- of the "circulated" dataset
-
RepeatOperator
public RepeatOperator(java.lang.Integer numIterations, DataSetType<Type> type)
Creates a new instance.- Parameters:
numIterations
- number of iterations to be performedtype
- of the "circulated" dataset
-
RepeatOperator
public RepeatOperator(RepeatOperator<Type> that)
Creates a copy of the givenRepeatOperator
.- Parameters:
that
- should be copied
-
-
Method Detail
-
getState
public LoopHeadOperator.State getState()
Description copied from interface:LoopHeadOperator
Optional operation. OnlyExecutionOperator
s need to implement this method.- Specified by:
getState
in interfaceLoopHeadOperator
- Returns:
- the current
LoopHeadOperator.State
of this instance
-
setState
public void setState(LoopHeadOperator.State state)
Description copied from interface:LoopHeadOperator
Optional operation. OnlyExecutionOperator
s need to implement this method. Sets theLoopHeadOperator.State
of this instance.- Specified by:
setState
in interfaceLoopHeadOperator
-
getType
public DataSetType<Type> getType()
-
initialize
public void initialize(Operator initOperator, int initOpOutputIndex)
-
beginIteration
public void beginIteration(Operator beginOperator, int beginInputIndex)
-
endIteration
public void endIteration(Operator endOperator, int endOpOutputIndex)
-
connectFinalOutputTo
public void connectFinalOutputTo(Operator outputOperator, int thatInputIndex)
-
getForwards
public java.util.Collection<OutputSlot<?>> getForwards(InputSlot<?> input)
Description copied from interface:Operator
Declare 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 anOperator
serves anOutputSlot
that is involved in a foward rule, it will do so by forwarding. If theOutputSlot
is not served, then the forwarding does not apply.- Specified by:
getForwards
in interfaceOperator
- Returns:
OutputSlot
s to which this instance forwards the giveninput
.- See Also:
Operator.isReading(InputSlot)
-
isReading
public boolean isReading(InputSlot<?> input)
Description copied from interface:Operator
Tells whether the giveninput
is read by this operator. If not, the optimizer can make use of this insight.- Specified by:
isReading
in interfaceOperator
- See Also:
Operator.getForwards(InputSlot)
-
createCardinalityEstimator
public java.util.Optional<CardinalityEstimator> createCardinalityEstimator(int outputIndex, Configuration configuration)
Description copied from interface:ElementaryOperator
- Specified by:
createCardinalityEstimator
in interfaceElementaryOperator
- Parameters:
outputIndex
- index of theOutputSlot
for that theCardinalityEstimator
is requestedconfiguration
- if theCardinalityEstimator
depends on further ones, use this to obtain the latter- Returns:
- an
Optional
that might provide the requested instance
-
getLoopBodyOutputs
public java.util.Collection<OutputSlot<?>> getLoopBodyOutputs()
Description copied from interface:LoopHeadOperator
If this instance is the head of a loop, then return theseOutputSlot
s that go into the loop body (as opposed to theOutputSlot
s that form the final result of the iteration).- Specified by:
getLoopBodyOutputs
in interfaceLoopHeadOperator
- Returns:
- the loop body-bound
OutputSlot
s
-
getFinalLoopOutputs
public java.util.Collection<OutputSlot<?>> getFinalLoopOutputs()
Description copied from interface:LoopHeadOperator
If this instance is the head of a loop, then return theseOutputSlot
s that form the final result of the iteration.- Specified by:
getFinalLoopOutputs
in interfaceLoopHeadOperator
- Returns:
- the loop-terminal
OutputSlot
s
-
getLoopBodyInputs
public java.util.Collection<InputSlot<?>> getLoopBodyInputs()
Description copied from interface:LoopHeadOperator
If this instance is the head of a loop, then return theseInputSlot
s that are fed from the loop body (as opposed to theInputSlot
s that initialize the loop).- Specified by:
getLoopBodyInputs
in interfaceLoopHeadOperator
- Returns:
- the loop body-bound
InputSlot
s
-
getLoopInitializationInputs
public java.util.Collection<InputSlot<?>> getLoopInitializationInputs()
Description copied from interface:LoopHeadOperator
If this instance is the head of a loop, then return theseInputSlot
s that initialize the loop.- Specified by:
getLoopInitializationInputs
in interfaceLoopHeadOperator
- Returns:
- the initialization
InputSlot
s
-
getConditionInputSlots
public java.util.Collection<InputSlot<?>> getConditionInputSlots()
Description copied from interface:LoopHeadOperator
Retrieve thoseInputSlot
s that are required to evaluate the loop condition.- Specified by:
getConditionInputSlots
in interfaceLoopHeadOperator
- Returns:
- the condition
InputSlot
s
-
getConditionOutputSlots
public java.util.Collection<OutputSlot<?>> getConditionOutputSlots()
Description copied from interface:LoopHeadOperator
Retrieve thoseOutputSlot
s that forward theLoopHeadOperator.getConditionInputSlots()
.- Specified by:
getConditionOutputSlots
in interfaceLoopHeadOperator
- Returns:
- the condition
OutputSlot
s
-
getNumIterations
public int getNumIterations()
-
getNumExpectedIterations
public int getNumExpectedIterations()
- Specified by:
getNumExpectedIterations
in interfaceLoopHeadOperator
- Returns:
- a number of expected iterations; not necessarily the actual value
-
-