Class AbstractWriterBuilder<B extends AbstractWriterBuilder>

  • Type Parameters:
    B - the builder class.
    All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    AbstractStreamingWriterBuilder, FlinkPravegaOutputFormat.Builder

    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
    • 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.
      protected PravegaConfig getPravegaConfig()
      Gets the Pravega configuration.
      protected boolean isMetricsEnabled()
      getter to fetch the metrics flag.
      protected 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractWriterBuilder

        public AbstractWriterBuilder()
    • 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.
      • 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

        protected PravegaConfig getPravegaConfig()
        Gets the Pravega configuration.
      • resolveStream

        protected io.pravega.client.stream.Stream resolveStream()
        Resolves the stream to be provided to the writer, based on the configured default scope.
      • 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

        protected boolean isMetricsEnabled()
        getter to fetch the metrics flag.
      • builder

        protected abstract B builder()