org.apache.flink.streaming.api.scala
Adds a new Kryo default serializer to the Runtime.
Adds a new Kryo default serializer to the Runtime.
The class of the types serialized with the given serializer.
The class of the serializer to use.
Adds a new Kryo default serializer to the Runtime.
Adds a new Kryo default serializer to the Runtime.
Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization.
The class of the types serialized with the given serializer.
The serializer to use.
Create a DataStream using a user defined source function for arbitrary source functionality.
Create a DataStream using a user defined source function for arbitrary source functionality.
Create a DataStream using a user defined source function for arbitrary source functionality. By default sources have a parallelism of 1. To enable parallel execution, the user defined source should implement ParallelSourceFunction or extend RichParallelSourceFunction. In these cases the resulting source will have the parallelism of the environment. To change this afterwards call DataStreamSource.setParallelism(int)
Create a DataStream using a user defined source function v2 for arbitrary source functionality.
Create a DataStream using a user defined source function v2 for arbitrary source functionality. By default sources have a parallelism of 1. To enable parallel execution, the user defined source should implement ParallelSourceFunction or extend RichParallelSourceFunction. In these cases the resulting source will have the parallelism of the environment. To change this afterwards call DataStreamSource.setParallelism(int)
Generic method to create an input data stream with a specific input format.
Generic method to create an input data stream with a specific input format. Since all data streams need specific information about their types, this method needs to determine the type of the data produced by the input format. It will attempt to determine the data type by reflection, unless the input format implements the ResultTypeQueryable interface.
Generic method to create an input data stream with a specific input format.
Generic method to create an input data stream with a specific input format. Since all data streams need specific information about their types, this method needs to determine the type of the data produced by the input format. It will attempt to determine the data type by reflection, unless the input format implements the ResultTypeQueryable interface.
Disables operator chaining for streaming operators.
Disables operator chaining for streaming operators. Operator chaining allows non-shuffle operations to be co-located in the same thread fully avoiding serialization and de-serialization.
Enables checkpointing for the streaming job.
Enables checkpointing for the streaming job. The distributed state of the streaming dataflow will be periodically snapshotted. In case of a failure, the streaming dataflow will be restarted from the latest completed checkpoint.
The job draws checkpoints periodically, in the given interval. The program will use CheckpointingMode.EXACTLY_ONCE mode. The state will be stored in the configured state backend.
NOTE: Checkpointing iterative streaming dataflows in not properly supported at the moment. For that reason, iterative jobs will not be started if used with enabled checkpointing. To override this mechanism, use the CheckpointingMode, boolean) method.
Time interval between state checkpoints in milliseconds.
Enables checkpointing for the streaming job.
Enables checkpointing for the streaming job. The distributed state of the streaming dataflow will be periodically snapshotted. In case of a failure, the streaming dataflow will be restarted from the latest completed checkpoint.
The job draws checkpoints periodically, in the given interval. The system uses the given CheckpointingMode for the checkpointing ("exactly once" vs "at least once"). The state will be stored in the configured state backend.
NOTE: Checkpointing iterative streaming dataflows in not properly supported at the moment. For that reason, iterative jobs will not be started if used with enabled checkpointing. To override this mechanism, use the CheckpointingMode, boolean) method.
Time interval between state checkpoints in milliseconds.
The checkpointing mode, selecting between "exactly once" and "at least once" guarantees.
Triggers the program execution.
Triggers the program execution. The environment will execute all parts of the program that have resulted in a "sink" operation. Sink operations are for example printing results or forwarding them to a message queue.
The program execution will be logged and displayed with the provided name.
Triggers the program execution.
Triggers the program execution. The environment will execute all parts of the program that have resulted in a "sink" operation. Sink operations are for example printing results or forwarding them to a message queue.
The program execution will be logged and displayed with a generated default name.
Creates a DataStream from the given Iterator.
Creates a DataStream from the given Iterator.
Note that this operation will result in a non-parallel data source, i.e. a data source with a parallelism of one.
Creates a DataStream from the given non-empty Seq.
Creates a DataStream from the given non-empty Seq. The elements need to be serializable because the framework may move the elements into the cluster if needed.
Note that this operation will result in a non-parallel data source, i.e. a data source with a parallelism of one.
Creates a DataStream from the given non-empty Seq.
Creates a DataStream from the given non-empty Seq. The elements need to be serializable because the framework may move the elements into the cluster if needed.
Note that this operation will result in a non-parallel data source v2, i.e. a data source with a parallelism of one.
Creates a DataStream that contains the given elements.
Creates a DataStream that contains the given elements. The elements must all be of the same type.
Note that this operation will result in a non-parallel data source, i.e. a data source with a parallelism of one.
Creates a DataStream that contains the given elements.
Creates a DataStream that contains the given elements. The elements must all be of the same type.
Note that this operation will result in a non-parallel data source v2, i.e. a data source with a parallelism of one.
Creates a DataStream from the given SplittableIterator.
Creates a new DataStream that contains a sequence of numbers.
Creates a new DataStream that contains a sequence of numbers. This source is a parallel source.
If you manually set the parallelism to 1
the emitted elements are in order.
Gets the default buffer timeout set for this environment
Gets cache files.
Gets the checkpoint config, which defines values like checkpoint interval, delay between checkpoints, etc.
Gets the config object.
Returns the custom configuration for the environment.
Creates the plan with which the system will execute the program, and returns it as a String using a JSON representation of the execution data flow graph.
Creates the plan with which the system will execute the program, and returns it as a String using a JSON representation of the execution data flow graph. Note that this needs to be called, before the plan is executed.
the wrapped Java environment
Returns the maximum degree of parallelism defined for the program.
Returns the maximum degree of parallelism defined for the program.
The maximum degree of parallelism specifies the upper limit for dynamic scaling. It also defines the number of key groups used for partitioned state.
Returns the default parallelism for this execution environment.
Returns the default parallelism for this execution environment. Note that this value can be overridden by individual operations using DataStream#setParallelism(int)
Returns the specified restart strategy configuration.
Returns the specified restart strategy configuration.
The restart strategy configuration to be used
Returns the state backend that defines how to store and checkpoint state.
Returns the state backend that defines how to store and checkpoint state.
Getter of the org.apache.flink.streaming.api.graph.StreamGraph of the streaming job.
Getter of the org.apache.flink.streaming.api.graph.StreamGraph of the streaming job.
The StreamGraph representing the transformations
Gets the time characteristic/
Gets the time characteristic/
The time characteristic.
#setStreamTimeCharacteristic
Getter of the wrapped org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
Getter of the wrapped org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
The encased ExecutionEnvironment
Reads the contents of the user-specified path based on the given FileInputFormat.
Reads the contents of the user-specified path based on the given FileInputFormat.
Depending on the provided FileProcessingMode, the source
may periodically monitor (every interval
ms) the path for new data
(FileProcessingMode.PROCESS_CONTINUOUSLY), or process
once the data currently in the path and exit
(FileProcessingMode.PROCESS_ONCE). In addition,
if the path contains files not to be processed, the user can specify a custom
FilePathFilter. As a default implementation you can use
FilePathFilter.createDefaultFilter().
** NOTES ON CHECKPOINTING: ** If the watchType
is set to
FileProcessingMode#PROCESS_ONCE, the source monitors the path ** once **,
creates the FileInputSplits
to be processed, forwards them to the downstream
readers to read the actual data,
and exits, without waiting for the readers to finish reading. This
implies that no more checkpoint barriers are going to be forwarded
after the source exits, thus having no checkpoints after that point.
The input format used to create the data stream
The path of the file, as a URI (e.g., "file:///some/local/file" or "hdfs://host:port/file/path")
The mode in which the source should operate, i.e. monitor path and react to new data, or process once and exit
In the case of periodic path monitoring, this specifies the interval (in millis) between consecutive path scans
The data stream that represents the data read from the given file
Reads the given file with the given input format.
Reads the given file with the given input format. The file path should be passed as a URI (e.g., "file:///some/local/file" or "hdfs://host:port/file/path").
Creates a DataStream that contains the contents of file created while system watches the given path.
Creates a DataStream that contains the contents of file created while system watches the given path. The file will be read with the system's default character set. The user can check the monitoring interval in milliseconds, and the way file modifications are handled. By default it checks for only new files every 100 milliseconds.
Creates a data stream that represents the Strings produced by reading the given file line wise.
Creates a data stream that represents the Strings produced by reading the given file line wise. The character set with the given name will be used to read the files.
Creates a DataStream that represents the Strings produced by reading the given file line wise.
Creates a DataStream that represents the Strings produced by reading the given file line wise. The file will be read with the system's default character set.
Registers a file at the distributed cache under the given name.
Registers a file at the distributed cache under the given name. The file will be accessible from any user-defined function in the (distributed) runtime under a local path. Files may be local files (as long as all relevant workers have access to it), or files in a distributed file system. The runtime will copy the files temporarily to a local cache, if needed.
The org.apache.flink.api.common.functions.RuntimeContext
can be obtained inside UDFs
via org.apache.flink.api.common.functions.RichFunction#getRuntimeContext()
and
provides access org.apache.flink.api.common.cache.DistributedCache
via
org.apache.flink.api.common.functions.RuntimeContext#getDistributedCache()
.
The path of the file, as a URI (e.g. "file:///some/path" or "hdfs://host:port/and/path")
The name under which the file is registered.
flag indicating whether the file should be executable
Registers a file at the distributed cache under the given name.
Registers a file at the distributed cache under the given name. The file will be accessible from any user-defined function in the (distributed) runtime under a local path. Files may be local files (as long as all relevant workers have access to it), or files in a distributed file system. The runtime will copy the files temporarily to a local cache, if needed.
The org.apache.flink.api.common.functions.RuntimeContext
can be obtained inside UDFs
via org.apache.flink.api.common.functions.RichFunction#getRuntimeContext()
and
provides access org.apache.flink.api.common.cache.DistributedCache
via
org.apache.flink.api.common.functions.RuntimeContext#getDistributedCache()
.
The path of the file, as a URI (e.g. "file:///some/path" or "hdfs://host:port/and/path")
The name under which the file is registered.
Registers the given type with the serialization stack.
Registers the given type with the serialization stack. If the type is eventually serialized as a POJO, then the type is registered with the POJO serializer. If the type ends up being serialized with Kryo, then it will be registered at Kryo to make sure that only tags are written.
Registers the given type with the serializer at the KryoSerializer.
Registers the given type with the serializer at the KryoSerializer.
Registers the given type with the serializer at the KryoSerializer.
Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization.
Sets the maximum time frequency (milliseconds) for the flushing of the output buffers.
Sets the maximum time frequency (milliseconds) for the flushing of the output buffers. By default the output buffers flush frequently to provide low latency and to aid smooth developer experience. Setting the parameter can result in three logical modes:
Sets the maximum degree of parallelism defined for the program.
Sets the maximum degree of parallelism defined for the program. The maximum degree of parallelism specifies the upper limit for dynamic scaling. It also defines the number of key groups used for partitioned state.
Sets the parallelism for operations executed through this environment.
Sets the parallelism for operations executed through this environment. Setting a parallelism of x here will cause all operators (such as join, map, reduce) to run with x parallel instances. This value can be overridden by specific operations using DataStream#setParallelism(int).
Sets the restart strategy configuration.
Sets the restart strategy configuration. The configuration specifies which restart strategy will be used for the execution graph in case of a restart.
Restart strategy configuration to be set
Sets the state backend that describes how to store and checkpoint operator state.
Sets the state backend that describes how to store and checkpoint operator state. It defines both which data structures hold state during execution (for example hash tables, RockDB, or other data stores) as well as where checkpointed data will be persisted.
State managed by the state backend includes both keyed state that is accessible on keyed streams, as well as state maintained directly by the user code that implements CheckpointedFunction.
The org.apache.flink.runtime.state.memory.MemoryStateBackend, for example, maintains the state in heap memory, as objects. It is lightweight without extra dependencies, but can checkpoint only small states (some counters).
In contrast, the org.apache.flink.runtime.state.filesystem.FsStateBackend stores checkpoints of the state (also maintained as heap objects) in files. When using a replicated file system (like HDFS, S3, MapR FS, Tachyon, etc) this will guarantee that state is not lost upon failures of individual nodes and that streaming program can be executed highly available and strongly consistent.
Sets the time characteristic for all streams create from this environment, e.g., processing time, event time, or ingestion time.
Sets the time characteristic for all streams create from this environment, e.g., processing time, event time, or ingestion time.
If you set the characteristic to IngestionTime of EventTime this will set a default watermark update interval of 200 ms. If this is not applicable for your application you should change it using org.apache.flink.api.common.ExecutionConfig#setAutoWatermarkInterval(long)
The time characteristic.
Creates a new DataStream that contains the strings received infinitely from socket.
Creates a new DataStream that contains the strings received infinitely from socket. Received strings are decoded by the system's default character set. The maximum retry interval is specified in seconds, in case of temporary service outage reconnection is initiated every second.
Stop a submitted job with JobID.
Method for enabling fault-tolerance.
Method for enabling fault-tolerance. Activates monitoring and backup of streaming operator states. Time interval between state checkpoints is specified in in millis.
Setting this option assumes that the job is used in production and thus if not stated explicitly otherwise with calling the setRestartStrategy method in case of failure the job will be resubmitted to the cluster indefinitely.
Enables checkpointing for the streaming job.
Enables checkpointing for the streaming job. The distributed state of the streaming dataflow will be periodically snapshotted. In case of a failure, the streaming dataflow will be restarted from the latest completed checkpoint.
The job draws checkpoints periodically, in the given interval. The state will be stored in the configured state backend.
NOTE: Checkpointing iterative streaming dataflows in not properly supported at the moment. If the "force" parameter is set to true, the system will execute the job nonetheless.
Time interval between state checkpoints in millis.
The checkpointing mode, selecting between "exactly once" and "at least once" guarantees.
If true checkpointing will be enabled for iterative jobs as well.
Gets the number of times the system will try to re-execute failed tasks.
Gets the number of times the system will try to re-execute failed tasks. A value of "-1" indicates that the system default value (as defined in the configuration) should be used.
This method will be replaced by getRestartStrategy. The FixedDelayRestartStrategyConfiguration contains the number of execution retries.
Reads the contents of the user-specified path based on the given FileInputFormat.
Reads the contents of the user-specified path based on the given FileInputFormat. Depending on the provided FileProcessingMode.
The input format used to create the data stream
The path of the file, as a URI (e.g., "file:///some/local/file" or "hdfs://host:port/file/path")
The mode in which the source should operate, i.e. monitor path and react to new data, or process once and exit
In the case of periodic path monitoring, this specifies the interval (in millis) between consecutive path scans
The files to be excluded from the processing
The data stream that represents the data read from the given file
Use FileInputFormat#setFilesFilter(FilePathFilter) to set a filter and String, FileProcessingMode, long)
Sets the number of times that failed tasks are re-executed.
Sets the number of times that failed tasks are re-executed. A value of zero effectively disables fault tolerance. A value of "-1" indicates that the system default value (as defined in the configuration) should be used.
This method will be replaced by setRestartStrategy(). The FixedDelayRestartStrategyConfiguration contains the number of execution retries.
Use StreamExecutionEnvironment.setStateBackend(StateBackend) instead.