Class GenericDataSinkBase<IN>
- java.lang.Object
-
- org.apache.flink.api.common.operators.Operator<Nothing>
-
- org.apache.flink.api.common.operators.GenericDataSinkBase<IN>
-
-
Field Summary
Fields Modifier and Type Field Description protected UserCodeWrapper<? extends OutputFormat<IN>>
formatWrapper
protected Operator<IN>
input
-
Fields inherited from class org.apache.flink.api.common.operators.Operator
compilerHints, name, operatorInfo, parameters
-
-
Constructor Summary
Constructors Constructor Description GenericDataSinkBase(OutputFormat<IN> f, UnaryOperatorInformation<IN,Nothing> operatorInfo, String name)
Creates a GenericDataSink with the providedOutputFormat
implementation and the given name.GenericDataSinkBase(UserCodeWrapper<? extends OutputFormat<IN>> f, UnaryOperatorInformation<IN,Nothing> operatorInfo, String name)
Creates a GenericDataSink with the providedOutputFormat
implementation and the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor<Operator<?>> visitor)
Accepts the visitor and applies it this instance.protected void
executeOnCollections(List<IN> inputData, RuntimeContext ctx, ExecutionConfig executionConfig)
UserCodeWrapper<? extends OutputFormat<IN>>
getFormatWrapper()
Gets the class describing this sinks output format.Operator<IN>
getInput()
Returns this operator's input operator.Ordering
getLocalOrder()
Gets the order, in which the data sink writes its data locally.UserCodeWrapper<? extends OutputFormat<IN>>
getUserCodeWrapper()
Gets the class describing the output format.void
setInput(Operator<IN> input)
Sets the given operator as the input to this operator.void
setLocalOrder(Ordering localOrder)
Sets the order in which the sink must write its data within each fragment in the distributed file system.String
toString()
-
Methods inherited from class org.apache.flink.api.common.operators.Operator
createUnionCascade, createUnionCascade, createUnionCascade, getCompilerHints, getMinResources, getName, getOperatorInfo, getParallelism, getParameters, getPreferredResources, setName, setParallelism, setParameter, setResources
-
-
-
-
Field Detail
-
formatWrapper
protected final UserCodeWrapper<? extends OutputFormat<IN>> formatWrapper
-
-
Constructor Detail
-
GenericDataSinkBase
public GenericDataSinkBase(OutputFormat<IN> f, UnaryOperatorInformation<IN,Nothing> operatorInfo, String name)
Creates a GenericDataSink with the providedOutputFormat
implementation and the given name.- Parameters:
f
- TheOutputFormat
implementation used to sink the data.name
- The given name for the sink, used in plans, logs and progress messages.
-
GenericDataSinkBase
public GenericDataSinkBase(UserCodeWrapper<? extends OutputFormat<IN>> f, UnaryOperatorInformation<IN,Nothing> operatorInfo, String name)
Creates a GenericDataSink with the providedOutputFormat
implementation and the given name.- Parameters:
f
- TheOutputFormat
implementation used to sink the data.name
- The given name for the sink, used in plans, logs and progress messages.
-
-
Method Detail
-
getInput
public Operator<IN> getInput()
Returns this operator's input operator.- Returns:
- This operator's input.
-
setInput
public void setInput(Operator<IN> input)
Sets the given operator as the input to this operator.- Parameters:
input
- The operator to use as the input.
-
getLocalOrder
public Ordering getLocalOrder()
Gets the order, in which the data sink writes its data locally. Local order means that with in each fragment of the file inside the distributed file system, the data is ordered, but not across file fragments.- Returns:
- NONE, if the sink writes data in any order, or ASCENDING (resp. DESCENDING), if the sink writes it data with a local ascending (resp. descending) order.
-
setLocalOrder
public void setLocalOrder(Ordering localOrder)
Sets the order in which the sink must write its data within each fragment in the distributed file system. For any value other then NONE, this will cause the system to perform a local sort, or try to reuse an order from a previous operation.- Parameters:
localOrder
- The local order to write the data in.
-
getFormatWrapper
public UserCodeWrapper<? extends OutputFormat<IN>> getFormatWrapper()
Gets the class describing this sinks output format.- Returns:
- The output format class.
-
getUserCodeWrapper
public UserCodeWrapper<? extends OutputFormat<IN>> getUserCodeWrapper()
Gets the class describing the output format.This method is basically identical to
getFormatWrapper()
.- Overrides:
getUserCodeWrapper
in classOperator<Nothing>
- Returns:
- The class describing the output format.
- See Also:
Operator.getUserCodeWrapper()
-
accept
public void accept(Visitor<Operator<?>> visitor)
Accepts the visitor and applies it this instance. This method applies the visitor in a depth-first traversal. The visitors pre-visit method is called and, if returning true, the visitor is recursively applied on the single input. After the recursion returned, the post-visit method is called.- Parameters:
visitor
- The visitor.- See Also:
Visitable.accept(org.apache.flink.util.Visitor)
-
executeOnCollections
protected void executeOnCollections(List<IN> inputData, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception
- Throws:
Exception
-
-