Class GenericDataSinkBase<IN>
- java.lang.Object
-
- org.apache.flink.api.common.operators.Operator<Nothing>
-
- org.apache.flink.api.common.operators.GenericDataSinkBase<IN>
-
@Internal public class GenericDataSinkBase<IN> extends Operator<Nothing>
Operator for nodes that act as data sinks, storing the data they receive. The way the data is stored is handled by theOutputFormat.
-
-
Field Summary
Fields Modifier and Type Field Description protected UserCodeWrapper<? extends OutputFormat<IN>>formatWrapperprotected 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 providedOutputFormatimplementation and the given name.GenericDataSinkBase(UserCodeWrapper<? extends OutputFormat<IN>> f, UnaryOperatorInformation<IN,Nothing> operatorInfo, String name)Creates a GenericDataSink with the providedOutputFormatimplementation and the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(Visitor<Operator<?>> visitor)Accepts the visitor and applies it this instance.voidaddInput(Operator<IN>... inputs)Deprecated.This method will be removed in future versions.voidaddInputs(List<? extends Operator<IN>> inputs)Deprecated.This method will be removed in future versions.protected voidexecuteOnCollections(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.OrderinggetLocalOrder()Gets the order, in which the data sink writes its data locally.UserCodeWrapper<? extends OutputFormat<IN>>getUserCodeWrapper()Gets the class describing the output format.voidsetInput(Operator<IN> input)Sets the given operator as the input to this operator.voidsetInputs(List<Operator<IN>> inputs)Deprecated.This method will be removed in future versions.voidsetInputs(Operator<IN>... inputs)Deprecated.This method will be removed in future versions.voidsetLocalOrder(Ordering localOrder)Sets the order in which the sink must write its data within each fragment in the distributed file system.StringtoString()-
Methods inherited from class org.apache.flink.api.common.operators.Operator
createUnionCascade, createUnionCascade, createUnionCascade, getCompilerHints, getMinResources, getName, getOperatorInfo, getParallelism, getParameters, getPreferredResources, setName, setParallelism, setParameter, setParameter, 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 providedOutputFormatimplementation and the given name.- Parameters:
f- TheOutputFormatimplementation 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 providedOutputFormatimplementation and the given name.- Parameters:
f- TheOutputFormatimplementation 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.
-
setInputs
@Deprecated public void setInputs(Operator<IN>... inputs)
Deprecated.This method will be removed in future versions. Use theUnionoperator instead.Sets the input to the union of the given operators.- Parameters:
inputs- The operator(s) that form the input.
-
setInputs
@Deprecated public void setInputs(List<Operator<IN>> inputs)
Deprecated.This method will be removed in future versions. Use theUnionoperator instead.Sets the input to the union of the given operators.- Parameters:
inputs- The operator(s) that form the input.
-
addInput
@Deprecated public void addInput(Operator<IN>... inputs)
Deprecated.This method will be removed in future versions. Use theUnionoperator instead.Adds to the input the union of the given operators.- Parameters:
inputs- The operator(s) to be unioned with the input.
-
addInputs
@Deprecated public void addInputs(List<? extends Operator<IN>> inputs)
Deprecated.This method will be removed in future versions. Use theUnionoperator instead.Adds to the input the union of the given operators.- Parameters:
inputs- The operator(s) to be unioned with 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:
getUserCodeWrapperin 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
-
-