Class PravegaSinkBuilder<T>

    • Field Detail

      • DEFAULT_TXN_LEASE_RENEWAL_PERIOD_MILLIS

        protected static final long DEFAULT_TXN_LEASE_RENEWAL_PERIOD_MILLIS
        See Also:
        Constant Field Values
    • Method Detail

      • withPravegaConfig

        public PravegaSinkBuilder<T> 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 sink.
      • forStream

        public PravegaSinkBuilder<T> forStream​(java.lang.String streamSpec)
        Add a stream to be written to by the sink.
        Parameters:
        streamSpec - the unqualified or qualified name of the stream.
        Returns:
        A builder to configure and create a sink.
      • forStream

        public PravegaSinkBuilder<T> forStream​(io.pravega.client.stream.Stream stream)
        Add a stream to be written to by the sink.
        Parameters:
        stream - the stream.
        Returns:
        A builder to configure and create a sink.
      • withWriterMode

        public PravegaSinkBuilder<T> withWriterMode​(PravegaWriterMode writerMode)
        Sets the writer mode to provide at-least-once or exactly-once guarantees.
        Parameters:
        writerMode - The writer mode of BEST_EFFORT, ATLEAST_ONCE, or EXACTLY_ONCE.
        Returns:
        A builder to configure and create a sink.
      • withTxnLeaseRenewalPeriod

        public PravegaSinkBuilder<T> withTxnLeaseRenewalPeriod​(org.apache.flink.api.common.time.Time period)
        Sets the transaction lease renewal period. When the writer mode is set to EXACTLY_ONCE, transactions are used to persist events to the Pravega stream. The transaction interval corresponds to the Flink checkpoint interval. Throughout that interval, the transaction is kept alive with a lease that is periodically renewed. This configuration setting sets the lease renewal period. The default value is 30 seconds.
        Parameters:
        period - the lease renewal period
        Returns:
        A builder to configure and create a sink.
      • withSerializationSchema

        public PravegaSinkBuilder<T> withSerializationSchema​(org.apache.flink.api.common.serialization.SerializationSchema<T> serializationSchema)
        Sets the serialization schema.
        Parameters:
        serializationSchema - the deserialization schema to use.
        Returns:
        A builder to configure and create a sink.
      • withEventRouter

        public PravegaSinkBuilder<T> withEventRouter​(PravegaEventRouter<T> eventRouter)
        Sets the event router.
        Parameters:
        eventRouter - the event router which produces a key per event.
        Returns:
        A builder to configure and create a sink.
      • resolveStream

        public io.pravega.client.stream.Stream resolveStream()
        Resolves the stream to be provided to the sink, based on the configured default scope.
        Returns:
        the resolved stream instance.