Package io.pravega.client.stream
Class EventWriterConfig.EventWriterConfigBuilder
- java.lang.Object
-
- io.pravega.client.stream.EventWriterConfig.EventWriterConfigBuilder
-
- All Implemented Interfaces:
io.pravega.common.ObjectBuilder<EventWriterConfig>
- Enclosing class:
- EventWriterConfig
public static final class EventWriterConfig.EventWriterConfigBuilder extends java.lang.Object implements io.pravega.common.ObjectBuilder<EventWriterConfig>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventWriterConfig.EventWriterConfigBuilder
automaticallyNoteTime(boolean automaticallyNoteTime)
Automatically invokeEventStreamWriter.noteTime(long)
passingSystem.currentTimeMillis()
on a regular interval.EventWriterConfig.EventWriterConfigBuilder
backoffMultiple(int backoffMultiple)
Backoff multiplier used in the retry logic of the writer.EventWriterConfig
build()
EventWriterConfig.EventWriterConfigBuilder
enableConnectionPooling(boolean enableConnectionPooling)
Enable or disable connection pooling for writer.EventWriterConfig.EventWriterConfigBuilder
enableLargeEvents(boolean enableLargeEvents)
Enable or disable whether LargeEvent writes should be processed and sent to the SegmentStore.EventWriterConfig.EventWriterConfigBuilder
initialBackoffMillis(int initialBackoffMillis)
Initial backoff in milli seconds used in the retry logic of the writer.EventWriterConfig.EventWriterConfigBuilder
maxBackoffMillis(int maxBackoffMillis)
Maximum backoff in milli seconds used in the retry logic of the writer.EventWriterConfig.EventWriterConfigBuilder
retryAttempts(int retryAttempts)
Maximum retry attempts performed by the writer before throwing aRetriesExhaustedException
.java.lang.String
toString()
EventWriterConfig.EventWriterConfigBuilder
transactionTimeoutTime(long transactionTimeoutTime)
The transaction timeout parameter corresponds to the lease renewal period.
-
-
-
Method Detail
-
build
public EventWriterConfig build()
- Specified by:
build
in interfaceio.pravega.common.ObjectBuilder<EventWriterConfig>
-
initialBackoffMillis
public EventWriterConfig.EventWriterConfigBuilder initialBackoffMillis(int initialBackoffMillis)
Initial backoff in milli seconds used in the retry logic of the writer. The default value is 1ms.- Parameters:
initialBackoffMillis
- Initial backoff in milli seconds in the retry logic of the writer.- Returns:
this
.
-
maxBackoffMillis
public EventWriterConfig.EventWriterConfigBuilder maxBackoffMillis(int maxBackoffMillis)
Maximum backoff in milli seconds used in the retry logic of the writer. The default value is 20000.- Parameters:
maxBackoffMillis
- Maximum backoff in milli seconds used in the retry logic of the writer.- Returns:
this
.
-
retryAttempts
public EventWriterConfig.EventWriterConfigBuilder retryAttempts(int retryAttempts)
Maximum retry attempts performed by the writer before throwing aRetriesExhaustedException
. The default value is 10.- Parameters:
retryAttempts
- Maximum retry attempts performed by the writer before throwing aRetriesExhaustedException
.- Returns:
this
.
-
backoffMultiple
public EventWriterConfig.EventWriterConfigBuilder backoffMultiple(int backoffMultiple)
Backoff multiplier used in the retry logic of the writer. The default value is 10.- Parameters:
backoffMultiple
- Backoff multiplier used in the retry logic of the writer.- Returns:
this
.
-
enableConnectionPooling
public EventWriterConfig.EventWriterConfigBuilder enableConnectionPooling(boolean enableConnectionPooling)
Enable or disable connection pooling for writer. The default value is false.- Parameters:
enableConnectionPooling
- Enable or disable connection pooling for writer.- Returns:
this
.
-
transactionTimeoutTime
public EventWriterConfig.EventWriterConfigBuilder transactionTimeoutTime(long transactionTimeoutTime)
The transaction timeout parameter corresponds to the lease renewal period. In every period, the client must send at least one ping to keep the txn alive. If the client fails to do so, then Pravega aborts the txn automatically. The client sends pings internally and requires no application intervention, only that it sets this parameter accordingly. This parameter is additionally used to determine the total amount of time that a txn can remain open. Currently, we set the maximum amount of time for a txn to remain open to be the minimum between 1 day and 1,000 times the value of the lease renewal period. The 1,000 is hardcoded and has been chosen arbitrarily to be a large enough value. The maximum allowed lease time by default is 600s, see: io.pravega.controller.util.Config.PROPERTY_TXN_MAX_LEASE The maximum allowed lease time is a configuration parameter of the controller and can be changed accordingly. Note that being a controller-wide parameter, it affects all transactions.- Parameters:
transactionTimeoutTime
- Transaction timeout parameter- Returns:
this
.
-
automaticallyNoteTime
public EventWriterConfig.EventWriterConfigBuilder automaticallyNoteTime(boolean automaticallyNoteTime)
Automatically invokeEventStreamWriter.noteTime(long)
passingSystem.currentTimeMillis()
on a regular interval.- Parameters:
automaticallyNoteTime
- Interval to regularly invokeEventStreamWriter.noteTime(long)
.- Returns:
this
.
-
enableLargeEvents
public EventWriterConfig.EventWriterConfigBuilder enableLargeEvents(boolean enableLargeEvents)
Enable or disable whether LargeEvent writes should be processed and sent to the SegmentStore. A LargeEvent is defined as any event containing a number of bytes greater thanSerializer.MAX_EVENT_SIZE
.- Parameters:
enableLargeEvents
- Enable or disables LargeEvent processing.- Returns:
this
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-