Class AsyncDynamicTableSinkBuilder<RequestEntryT extends Serializable,ConcreteBuilderT extends AsyncDynamicTableSinkBuilder<?,?>>
- java.lang.Object
-
- org.apache.flink.connector.base.table.sink.AsyncDynamicTableSinkBuilder<RequestEntryT,ConcreteBuilderT>
-
- Type Parameters:
RequestEntryT
- Request entry type forAsyncDynamicTableSink
.ConcreteBuilderT
- Builder Implementation type.
@PublicEvolving public abstract class AsyncDynamicTableSinkBuilder<RequestEntryT extends Serializable,ConcreteBuilderT extends AsyncDynamicTableSinkBuilder<?,?>> extends Object
Builder class forAsyncDynamicTableSink
.
-
-
Constructor Summary
Constructors Constructor Description AsyncDynamicTableSinkBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AsyncDynamicTableSink<RequestEntryT>
build()
protected Integer
getMaxBatchSize()
protected Integer
getMaxBufferedRequests()
protected Long
getMaxBufferSizeInBytes()
protected Integer
getMaxInFlightRequests()
protected Long
getMaxTimeInBufferMS()
ConcreteBuilderT
setMaxBatchSize(int maxBatchSize)
ConcreteBuilderT
setMaxBufferedRequests(int maxBufferedRequests)
ConcreteBuilderT
setMaxBufferSizeInBytes(long maxBufferSizeInBytes)
ConcreteBuilderT
setMaxInFlightRequests(int maxInFlightRequests)
ConcreteBuilderT
setMaxTimeInBufferMS(long maxTimeInBufferMS)
-
-
-
Method Detail
-
setMaxBatchSize
public ConcreteBuilderT setMaxBatchSize(int maxBatchSize)
- Parameters:
maxBatchSize
- maximum number of elements that may be passed in a list to be written downstream.- Returns:
AsyncDynamicTableSinkBuilder
itself
-
setMaxInFlightRequests
public ConcreteBuilderT setMaxInFlightRequests(int maxInFlightRequests)
- Parameters:
maxInFlightRequests
- maximum number of uncompleted calls to submitRequestEntries that the SinkWriter will allow at any given point. Once this point has reached, writes and callbacks to add elements to the buffer may block until one or more requests to submitRequestEntries completes.- Returns:
AsyncDynamicTableSinkBuilder
itself
-
setMaxBufferedRequests
public ConcreteBuilderT setMaxBufferedRequests(int maxBufferedRequests)
- Parameters:
maxBufferedRequests
- the maximum buffer length. Callbacks to add elements to the buffer and calls to write will block if this length has been reached and will only unblock if elements from the buffer have been removed for flushing.- Returns:
AsyncDynamicTableSinkBuilder
itself
-
setMaxBufferSizeInBytes
public ConcreteBuilderT setMaxBufferSizeInBytes(long maxBufferSizeInBytes)
- Parameters:
maxBufferSizeInBytes
- a flush will be attempted if the most recent call to write introduces an element to the buffer such that the total size of the buffer is greater than or equal to this threshold value.- Returns:
AsyncDynamicTableSinkBuilder
itself
-
setMaxTimeInBufferMS
public ConcreteBuilderT setMaxTimeInBufferMS(long maxTimeInBufferMS)
- Parameters:
maxTimeInBufferMS
- the maximum amount of time an element may remain in the buffer. In most cases elements are flushed as a result of the batch size (in bytes or number) being reached or during a snapshot. However, there are scenarios where an element may remain in the buffer forever or a long period of time. To mitigate this, a timer is constantly active in the buffer such that: while the buffer is not empty, it will flush every maxTimeInBufferMS milliseconds.- Returns:
AsyncDynamicTableSinkBuilder
itself
-
build
public abstract AsyncDynamicTableSink<RequestEntryT> build()
-
getMaxBatchSize
protected Integer getMaxBatchSize()
-
getMaxInFlightRequests
protected Integer getMaxInFlightRequests()
-
getMaxBufferedRequests
protected Integer getMaxBufferedRequests()
-
getMaxBufferSizeInBytes
protected Long getMaxBufferSizeInBytes()
-
getMaxTimeInBufferMS
protected Long getMaxTimeInBufferMS()
-
-