Package io.pravega.connectors.flink
Class AbstractReaderBuilder<B extends AbstractReaderBuilder>
- java.lang.Object
-
- io.pravega.connectors.flink.AbstractReaderBuilder<B>
-
- Type Parameters:
B
- the builder class.
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AbstractStreamingReaderBuilder
,FlinkPravegaInputFormat.Builder
@Internal public abstract class AbstractReaderBuilder<B extends AbstractReaderBuilder> extends java.lang.Object implements java.io.Serializable
A base builder for connectors that consume a Pravega stream.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReaderBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract B
builder()
B
enableMetrics(boolean enable)
enable/disable pravega reader metrics (default: enabled).B
forStream(io.pravega.client.stream.Stream stream)
Add a stream to be read by the source, from the earliest available position in the stream.B
forStream(io.pravega.client.stream.Stream stream, io.pravega.client.stream.StreamCut startStreamCut)
Add a stream to be read by the source, from the given start position in the stream.B
forStream(io.pravega.client.stream.Stream stream, io.pravega.client.stream.StreamCut startStreamCut, io.pravega.client.stream.StreamCut endStreamCut)
Add a stream to be read by the source, from the given start position in the stream to the given end position.B
forStream(java.lang.String streamSpec)
Add a stream to be read by the source, from the earliest available position in the stream.B
forStream(java.lang.String streamSpec, io.pravega.client.stream.StreamCut startStreamCut)
Add a stream to be read by the source, from the given start position in the stream.B
forStream(java.lang.String streamSpec, io.pravega.client.stream.StreamCut startStreamCut, io.pravega.client.stream.StreamCut endStreamCut)
Add a stream to be read by the source, from the given start position in the stream.PravegaConfig
getPravegaConfig()
Gets the Pravega configuration.boolean
isMetricsEnabled()
getter to fetch the metrics flag.protected java.util.List<StreamWithBoundaries>
resolveStreams()
Resolves the streams to be provided to the reader, based on the configured default scope.B
withPravegaConfig(PravegaConfig pravegaConfig)
Set the Pravega client configuration, which includes connection info, security info, and a default scope.
-
-
-
Method Detail
-
withPravegaConfig
public B withPravegaConfig(PravegaConfig pravegaConfig)
Set the Pravega client configuration, which includes connection info, security info, and a default scope. The default client configuration is obtained fromPravegaConfig.fromDefaults()
.- Parameters:
pravegaConfig
- the configuration to use.- Returns:
- A builder to configure and create a reader.
-
forStream
public B forStream(java.lang.String streamSpec, io.pravega.client.stream.StreamCut startStreamCut)
Add a stream to be read by the source, from the given start position in the stream.- Parameters:
streamSpec
- the unqualified or qualified name of the stream.startStreamCut
- StartStreamCut
- Returns:
- A builder to configure and create a reader.
-
forStream
public B forStream(java.lang.String streamSpec, io.pravega.client.stream.StreamCut startStreamCut, io.pravega.client.stream.StreamCut endStreamCut)
Add a stream to be read by the source, from the given start position in the stream.- Parameters:
streamSpec
- the unqualified or qualified name of the stream.startStreamCut
- StartStreamCut
endStreamCut
- EndStreamCut
- Returns:
- A builder to configure and create a reader.
-
forStream
public B forStream(java.lang.String streamSpec)
Add a stream to be read by the source, from the earliest available position in the stream.- Parameters:
streamSpec
- the unqualified or qualified name of the stream.- Returns:
- A builder to configure and create a reader.
-
forStream
public B forStream(io.pravega.client.stream.Stream stream, io.pravega.client.stream.StreamCut startStreamCut)
Add a stream to be read by the source, from the given start position in the stream.- Parameters:
stream
- Stream.startStreamCut
- StartStreamCut
- Returns:
- A builder to configure and create a reader.
-
forStream
public B forStream(io.pravega.client.stream.Stream stream, io.pravega.client.stream.StreamCut startStreamCut, io.pravega.client.stream.StreamCut endStreamCut)
Add a stream to be read by the source, from the given start position in the stream to the given end position.- Parameters:
stream
- Stream.startStreamCut
- StartStreamCut
endStreamCut
- EndStreamCut
- Returns:
- A builder to configure and create a reader.
-
forStream
public B forStream(io.pravega.client.stream.Stream stream)
Add a stream to be read by the source, from the earliest available position in the stream.- Parameters:
stream
- Stream.- Returns:
- A builder to configure and create a reader.
-
getPravegaConfig
public PravegaConfig getPravegaConfig()
Gets the Pravega configuration.- Returns:
- the instance of
PravegaConfig
.
-
resolveStreams
protected java.util.List<StreamWithBoundaries> resolveStreams()
Resolves the streams to be provided to the reader, based on the configured default scope.- Returns:
- A list of
StreamWithBoundaries
that is ready to be read
-
enableMetrics
public B enableMetrics(boolean enable)
enable/disable pravega reader metrics (default: enabled).- Parameters:
enable
- boolean- Returns:
- A builder to configure and create a reader.
-
isMetricsEnabled
public boolean isMetricsEnabled()
getter to fetch the metrics flag.- Returns:
- A boolean if metrics is enabled
-
builder
protected abstract B builder()
-
-