Package io.pravega.connectors.flink
Class AbstractWriterBuilder<B extends AbstractWriterBuilder>
- java.lang.Object
-
- io.pravega.connectors.flink.AbstractWriterBuilder<B>
-
- Type Parameters:
B
- the builder class.
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AbstractStreamingWriterBuilder
,FlinkPravegaOutputFormat.Builder
@Internal public abstract class AbstractWriterBuilder<B extends AbstractWriterBuilder> extends java.lang.Object implements java.io.Serializable
A base builder for connectors that emit a Pravega stream.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractWriterBuilder()
-
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 writer metrics (default: enabled).B
forStream(io.pravega.client.stream.Stream stream)
Add a stream to be written to by the writer.B
forStream(java.lang.String streamSpec)
Add a stream to be written to by the writer.PravegaConfig
getPravegaConfig()
Gets the Pravega configuration.boolean
isMetricsEnabled()
getter to fetch the metrics flag.io.pravega.client.stream.Stream
resolveStream()
Resolves the stream to be provided to the writer, 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 from
PravegaConfig.fromDefaults()
.- Parameters:
pravegaConfig
- the configuration to use.- Returns:
- A builder to configure and create a writer.
-
forStream
public B forStream(java.lang.String streamSpec)
Add a stream to be written to by the writer.- Parameters:
streamSpec
- the unqualified or qualified name of the stream.- Returns:
- A builder to configure and create a writer.
-
forStream
public B forStream(io.pravega.client.stream.Stream stream)
Add a stream to be written to by the writer.- Parameters:
stream
- the stream.- Returns:
- A builder to configure and create a writer.
-
getPravegaConfig
public PravegaConfig getPravegaConfig()
Gets the Pravega configuration.- Returns:
- the instance of
PravegaConfig
.
-
resolveStream
public io.pravega.client.stream.Stream resolveStream()
Resolves the stream to be provided to the writer, based on the configured default scope.- Returns:
- the resolved stream instance.
-
enableMetrics
public B enableMetrics(boolean enable)
enable/disable pravega writer metrics (default: enabled).- Parameters:
enable
- boolean- Returns:
- A builder to configure and create a writer.
-
isMetricsEnabled
public boolean isMetricsEnabled()
getter to fetch the metrics flag.- Returns:
- A boolean if metrics is enabled
-
builder
protected abstract B builder()
-
-