public class ReplicatorConfig extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ReplicatorConfig.DataCallback
Callback interface for data dump events.
|
static interface |
ReplicatorConfig.StateCallback
Callback interface for connection state change events.
|
| Constructor and Description |
|---|
ReplicatorConfig()
Creates a new ReplicatorConfig with default values.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getBatchInterval() |
int |
getBatchSize() |
int[] |
getCompression() |
int |
getMaxRetry() |
ReplicatorConfig.StateCallback |
getOnConnectionStateChange() |
ReplicatorConfig.DataCallback |
getOnDataDump() |
long |
getRetryInterval() |
ReplicatorConfig |
onConnectionStateChange(ReplicatorConfig.StateCallback callback)
Sets the callback to be invoked when connection state changes.
|
ReplicatorConfig |
onDataDump(ReplicatorConfig.DataCallback callback)
Sets the callback to be invoked when data is dumped to a host.
|
ReplicatorConfig |
setBatching(int batchSize,
long batchInterval,
TimeUnit unit)
Sets the batching parameters.
|
ReplicatorConfig |
setCompression(int[] compressMethods)
Sets the compression methods to use for each column.
|
ReplicatorConfig |
setRetry(int maxRetry,
long retryInterval,
TimeUnit unit)
Sets the retry parameters for reconnection.
|
String |
toString() |
public ReplicatorConfig()
public ReplicatorConfig setBatching(int batchSize, long batchInterval, TimeUnit unit)
batchSize - The number of rows to accumulate before writing (must be greater than 0)batchInterval - The maximum time to wait before writing, regardless of batch size (0 means no timeout)unit - The time unit for batchIntervalpublic ReplicatorConfig setRetry(int maxRetry, long retryInterval, TimeUnit unit)
maxRetry - The maximum number of retry attempts (0 means no retry, -1 means infinite retry)retryInterval - The interval between retry attemptsunit - The time unit for retryIntervalpublic ReplicatorConfig setCompression(int[] compressMethods)
Vector: COMPRESS_LZ4, COMPRESS_DELTA.
Null or empty array means no compression.compressMethods - Array of compression method codes (one per column)public ReplicatorConfig onDataDump(ReplicatorConfig.DataCallback callback)
callback - The callback functionpublic ReplicatorConfig onConnectionStateChange(ReplicatorConfig.StateCallback callback)
callback - The callback functionpublic int getBatchSize()
public long getBatchInterval()
public int getMaxRetry()
public long getRetryInterval()
public int[] getCompression()
public ReplicatorConfig.DataCallback getOnDataDump()
public ReplicatorConfig.StateCallback getOnConnectionStateChange()
Copyright © 2026 DolphinDB. All rights reserved.