Class WanBatchPublisherConfig
- java.lang.Object
-
- com.hazelcast.config.AbstractWanPublisherConfig
-
- com.hazelcast.config.WanBatchPublisherConfig
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public class WanBatchPublisherConfig extends AbstractWanPublisherConfig
Configuration object for the built-in WAN publisher (available in Hazelcast Enterprise). The publisher sends events to another Hazelcast cluster in batches, sending when either when enough events are enqueued or enqueued events have waited for enough time. The publisher can be a different cluster defined by static IP's or discovered using a cloud discovery mechanism.- See Also:
DiscoveryConfig
,AwsConfig
-
-
Field Summary
Fields Modifier and Type Field Description static WanAcknowledgeType
DEFAULT_ACKNOWLEDGE_TYPE
static int
DEFAULT_BATCH_MAX_DELAY_MILLIS
static int
DEFAULT_BATCH_SIZE
static java.lang.String
DEFAULT_CLUSTER_NAME
static int
DEFAULT_DISCOVERY_PERIOD_SECONDS
static long
DEFAULT_IDLE_MAX_PARK_NS
static long
DEFAULT_IDLE_MIN_PARK_NS
static WanPublisherState
DEFAULT_INITIAL_PUBLISHER_STATE
static int
DEFAULT_MAX_CONCURRENT_INVOCATIONS
static int
DEFAULT_MAX_TARGET_ENDPOINTS
static int
DEFAULT_QUEUE_CAPACITY
static WanQueueFullBehavior
DEFAULT_QUEUE_FULL_BEHAVIOUR
static int
DEFAULT_RESPONSE_TIMEOUT_MILLIS
static boolean
DEFAULT_SNAPSHOT_ENABLED
static java.lang.String
DEFAULT_TARGET_ENDPOINTS
static boolean
DEFAULT_USE_ENDPOINT_PRIVATE_ADDRESS
-
Fields inherited from class com.hazelcast.config.AbstractWanPublisherConfig
className, implementation, properties, publisherId
-
-
Constructor Summary
Constructors Constructor Description WanBatchPublisherConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WanAcknowledgeType
getAcknowledgeType()
Returns the strategy for when the target cluster should acknowledge that a WAN event batch has been processed.AwsConfig
getAwsConfig()
Returns theAwsConfig
used by the discovery mechanism for this WAN publisher.AzureConfig
getAzureConfig()
Returns theAzureConfig
used by the discovery mechanism for this WAN publisher.int
getBatchMaxDelayMillis()
Returns the maximum amount of time in milliseconds to wait before sending a batch of events to target cluster, ifgetBatchSize()
of events have not arrived within this duration.int
getBatchSize()
Returns the maximum batch size that can be sent to target cluster.int
getClassId()
Returns type identifier for this class.java.lang.String
getClusterName()
Returns the cluster name used as a publisher cluster name for authentication on the target endpoint.DiscoveryConfig
getDiscoveryConfig()
Returns the currently definedDiscoveryConfig
used by the discovery mechanism for this WAN publisher.int
getDiscoveryPeriodSeconds()
Returns the period in seconds in which WAN tries to discover new target endpoints and reestablish connections to failed endpoints.java.lang.String
getEndpoint()
Returns the WAN endpoint configuration qualifier.EurekaConfig
getEurekaConfig()
Returns theEurekaConfig
used by the discovery mechanism for this WAN publisher.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.GcpConfig
getGcpConfig()
Returns theGcpConfig
used by the discovery mechanism for this WAN publisher.long
getIdleMaxParkNs()
Returns the maximum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.long
getIdleMinParkNs()
Returns the minimum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.WanPublisher
getImplementation()
Returns the implementation ofWanPublisher
.WanPublisherState
getInitialPublisherState()
Returns the initial WAN publisher state.KubernetesConfig
getKubernetesConfig()
Returns theKubernetesConfig
used by the discovery mechanism for this WAN publisher.int
getMaxConcurrentInvocations()
Returns the maximum number of WAN event batches being sent to the target cluster concurrently.int
getMaxTargetEndpoints()
Returns the maximum number of endpoints that WAN will connect to when using a discovery mechanism to define endpoints.int
getQueueCapacity()
Returns the capacity of the primary and backup queue for WAN replication events.WanQueueFullBehavior
getQueueFullBehavior()
Returns the configured behaviour of this WAN publisher when the WAN queue is full.int
getResponseTimeoutMillis()
Returns the duration in milliseconds for the wait time before retrying to send the events to target cluster again in case the acknowledgement has not arrived.WanSyncConfig
getSyncConfig()
Returns the config for the WAN sync mechanism.java.lang.String
getTargetEndpoints()
Returns the comma separated list of target cluster members, e.g.boolean
isSnapshotEnabled()
Returnstrue
if key-based coalescing is configured for this WAN publisher.boolean
isUseEndpointPrivateAddress()
Returns whether the WAN connection manager should connect to the endpoint on the private address returned by the discovery SPI.void
readData(ObjectDataInput in)
Reads fields from the input streamWanBatchPublisherConfig
setAcknowledgeType(WanAcknowledgeType acknowledgeType)
Sets the strategy for when the target cluster should acknowledge that a WAN event batch has been processed.WanBatchPublisherConfig
setAwsConfig(AwsConfig awsConfig)
Sets theAwsConfig
used by the discovery mechanism for this WAN publisher.WanBatchPublisherConfig
setAzureConfig(AzureConfig azureConfig)
Sets theAzureConfig
used by the discovery mechanism for this WAN publisher.WanBatchPublisherConfig
setBatchMaxDelayMillis(int batchMaxDelayMillis)
Sets the maximum amount of time in milliseconds to wait before sending a batch of events to target cluster, ifgetBatchSize()
of events have not arrived within this duration.WanBatchPublisherConfig
setBatchSize(int batchSize)
Sets the maximum batch size that can be sent to target cluster.WanBatchPublisherConfig
setClassName(java.lang.String className)
Sets the name of the class implementingWanPublisher
.WanBatchPublisherConfig
setClusterName(java.lang.String clusterName)
Sets the cluster name used as an endpoint group password for authentication on the target endpoint.WanBatchPublisherConfig
setDiscoveryConfig(DiscoveryConfig discoveryConfig)
Sets theDiscoveryConfig
used by the discovery mechanism for this WAN publisher.WanBatchPublisherConfig
setDiscoveryPeriodSeconds(int discoveryPeriodSeconds)
Sets the period in seconds in which WAN tries to discover new target endpoints and reestablish connections to failed endpoints.WanBatchPublisherConfig
setEndpoint(java.lang.String endpoint)
Sets the WAN endpoint configuration qualifier.WanBatchPublisherConfig
setEurekaConfig(EurekaConfig eurekaConfig)
Sets theEurekaConfig
used by the discovery mechanism for this WAN publisher.WanBatchPublisherConfig
setGcpConfig(GcpConfig gcpConfig)
Sets theGcpConfig
used by the discovery mechanism for this WAN publisher.WanBatchPublisherConfig
setIdleMaxParkNs(long idleMaxParkNs)
Sets the maximum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.WanBatchPublisherConfig
setIdleMinParkNs(long idleMinParkNs)
Sets the minimum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.WanBatchPublisherConfig
setImplementation(WanPublisher implementation)
No-op method as the implementation cannot be changed for this publisher.WanBatchPublisherConfig
setInitialPublisherState(WanPublisherState initialPublisherState)
Sets the initial publisher state.WanBatchPublisherConfig
setKubernetesConfig(KubernetesConfig kubernetesConfig)
Sets theKubernetesConfig
used by the discovery mechanism for this WAN publisher.WanBatchPublisherConfig
setMaxConcurrentInvocations(int maxConcurrentInvocations)
Sets the maximum number of WAN event batches being sent to the target cluster concurrently.WanBatchPublisherConfig
setMaxTargetEndpoints(int maxTargetEndpoints)
Sets the maximum number of endpoints that WAN will connect to when using a discovery mechanism to define endpoints.WanBatchPublisherConfig
setProperties(java.util.Map<java.lang.String,java.lang.Comparable> properties)
Sets the WAN publisher properties.WanBatchPublisherConfig
setPublisherId(java.lang.String publisherId)
Sets the publisher ID used for identifying the publisher in aWanReplicationConfig
.WanBatchPublisherConfig
setQueueCapacity(int queueCapacity)
Sets the capacity of the primary and backup queue for WAN replication events.WanBatchPublisherConfig
setQueueFullBehavior(WanQueueFullBehavior queueFullBehavior)
Sets the configured behaviour of this WAN publisher when the WAN queue is full.WanBatchPublisherConfig
setResponseTimeoutMillis(int responseTimeoutMillis)
Sets the duration in milliseconds for the waiting time before retrying to send the events to target cluster again in case of acknowledgement is not arrived.WanBatchPublisherConfig
setSnapshotEnabled(boolean snapshotEnabled)
Sets if key-based coalescing is configured for this WAN publisher.WanBatchPublisherConfig
setSyncConfig(WanSyncConfig syncConfig)
Sets the config for the WAN sync mechanism.WanBatchPublisherConfig
setTargetEndpoints(java.lang.String targetEndpoints)
Sets the comma separated list of target cluster members, e.g.WanBatchPublisherConfig
setUseEndpointPrivateAddress(boolean useEndpointPrivateAddress)
Sets whether the WAN connection manager should connect to the endpoint on the private address returned by the discovery SPI.java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream-
Methods inherited from class com.hazelcast.config.AbstractWanPublisherConfig
equals, getClassName, getProperties, getPublisherId, hashCode
-
-
-
-
Field Detail
-
DEFAULT_CLUSTER_NAME
public static final java.lang.String DEFAULT_CLUSTER_NAME
- See Also:
- Constant Field Values
-
DEFAULT_SNAPSHOT_ENABLED
public static final boolean DEFAULT_SNAPSHOT_ENABLED
- See Also:
- Constant Field Values
-
DEFAULT_INITIAL_PUBLISHER_STATE
public static final WanPublisherState DEFAULT_INITIAL_PUBLISHER_STATE
-
DEFAULT_QUEUE_CAPACITY
public static final int DEFAULT_QUEUE_CAPACITY
- See Also:
- Constant Field Values
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_BATCH_MAX_DELAY_MILLIS
public static final int DEFAULT_BATCH_MAX_DELAY_MILLIS
- See Also:
- Constant Field Values
-
DEFAULT_RESPONSE_TIMEOUT_MILLIS
public static final int DEFAULT_RESPONSE_TIMEOUT_MILLIS
- See Also:
- Constant Field Values
-
DEFAULT_QUEUE_FULL_BEHAVIOUR
public static final WanQueueFullBehavior DEFAULT_QUEUE_FULL_BEHAVIOUR
-
DEFAULT_ACKNOWLEDGE_TYPE
public static final WanAcknowledgeType DEFAULT_ACKNOWLEDGE_TYPE
-
DEFAULT_DISCOVERY_PERIOD_SECONDS
public static final int DEFAULT_DISCOVERY_PERIOD_SECONDS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_TARGET_ENDPOINTS
public static final int DEFAULT_MAX_TARGET_ENDPOINTS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_CONCURRENT_INVOCATIONS
public static final int DEFAULT_MAX_CONCURRENT_INVOCATIONS
- See Also:
- Constant Field Values
-
DEFAULT_USE_ENDPOINT_PRIVATE_ADDRESS
public static final boolean DEFAULT_USE_ENDPOINT_PRIVATE_ADDRESS
- See Also:
- Constant Field Values
-
DEFAULT_IDLE_MIN_PARK_NS
public static final long DEFAULT_IDLE_MIN_PARK_NS
-
DEFAULT_IDLE_MAX_PARK_NS
public static final long DEFAULT_IDLE_MAX_PARK_NS
-
DEFAULT_TARGET_ENDPOINTS
public static final java.lang.String DEFAULT_TARGET_ENDPOINTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setClassName
public WanBatchPublisherConfig setClassName(@Nonnull java.lang.String className)
Description copied from class:AbstractWanPublisherConfig
Sets the name of the class implementingWanPublisher
. To configure the built in WanBatchReplication, please useWanBatchPublisherConfig
config class.- Overrides:
setClassName
in classAbstractWanPublisherConfig
- Parameters:
className
- the name of the class implementation for the WAN replication- Returns:
- this config
-
getImplementation
public WanPublisher getImplementation()
Description copied from class:AbstractWanPublisherConfig
Returns the implementation ofWanPublisher
.- Overrides:
getImplementation
in classAbstractWanPublisherConfig
-
setPublisherId
public WanBatchPublisherConfig setPublisherId(java.lang.String publisherId)
Description copied from class:AbstractWanPublisherConfig
Sets the publisher ID used for identifying the publisher in aWanReplicationConfig
.- Overrides:
setPublisherId
in classAbstractWanPublisherConfig
- Parameters:
publisherId
- the WAN publisher ID- Returns:
- this config
-
setProperties
public WanBatchPublisherConfig setProperties(@Nonnull java.util.Map<java.lang.String,java.lang.Comparable> properties)
Description copied from class:AbstractWanPublisherConfig
Sets the WAN publisher properties.- Overrides:
setProperties
in classAbstractWanPublisherConfig
- Parameters:
properties
- WAN publisher properties- Returns:
- this config
-
setImplementation
public WanBatchPublisherConfig setImplementation(@Nonnull WanPublisher implementation)
No-op method as the implementation cannot be changed for this publisher.- Overrides:
setImplementation
in classAbstractWanPublisherConfig
- Parameters:
implementation
- the implementation for the WAN replication- Returns:
- this config
-
getClusterName
@Nonnull public java.lang.String getClusterName()
Returns the cluster name used as a publisher cluster name for authentication on the target endpoint. If there is no separate publisher ID property defined, this cluster name will also be used as a WAN publisher ID. This ID is then used for identifying the publisher in aWanReplicationConfig
.- Returns:
- the WAN endpoint cluster name
- See Also:
AbstractWanPublisherConfig.getPublisherId()
-
setClusterName
public WanBatchPublisherConfig setClusterName(@Nonnull java.lang.String clusterName)
Sets the cluster name used as an endpoint group password for authentication on the target endpoint. If there is no separate publisher ID property defined, this cluster name will also be used as a WAN publisher ID. This ID is then used for identifying the publisher in aWanReplicationConfig
.- Parameters:
clusterName
- the WAN endpoint cluster name- Returns:
- this config
- See Also:
AbstractWanPublisherConfig.getPublisherId()
-
isSnapshotEnabled
public boolean isSnapshotEnabled()
Returnstrue
if key-based coalescing is configured for this WAN publisher. When enabled, only the latestWanEvent
of a key is sent to target.- See Also:
isSnapshotEnabled()
-
setSnapshotEnabled
public WanBatchPublisherConfig setSnapshotEnabled(boolean snapshotEnabled)
Sets if key-based coalescing is configured for this WAN publisher. When enabled, only the latestWanEvent
of a key is sent to target.- Returns:
- this config
- See Also:
isSnapshotEnabled()
-
getBatchSize
public int getBatchSize()
Returns the maximum batch size that can be sent to target cluster.- Returns:
- the maximum size of a WAN event batch
-
setBatchSize
public WanBatchPublisherConfig setBatchSize(int batchSize)
Sets the maximum batch size that can be sent to target cluster.- Parameters:
batchSize
- the maximum size of a WAN event batch- Returns:
- this config
-
getBatchMaxDelayMillis
public int getBatchMaxDelayMillis()
Returns the maximum amount of time in milliseconds to wait before sending a batch of events to target cluster, ifgetBatchSize()
of events have not arrived within this duration.- Returns:
- maximum amount of time to wait before sending a batch of events
-
setBatchMaxDelayMillis
public WanBatchPublisherConfig setBatchMaxDelayMillis(int batchMaxDelayMillis)
Sets the maximum amount of time in milliseconds to wait before sending a batch of events to target cluster, ifgetBatchSize()
of events have not arrived within this duration.- Parameters:
batchMaxDelayMillis
- maximum amount of time to wait before sending a batch of events- Returns:
- this config
-
getResponseTimeoutMillis
public int getResponseTimeoutMillis()
Returns the duration in milliseconds for the wait time before retrying to send the events to target cluster again in case the acknowledgement has not arrived.- Returns:
- timeout for response from target cluster
-
setResponseTimeoutMillis
public WanBatchPublisherConfig setResponseTimeoutMillis(int responseTimeoutMillis)
Sets the duration in milliseconds for the waiting time before retrying to send the events to target cluster again in case of acknowledgement is not arrived.- Parameters:
responseTimeoutMillis
- timeout for response from target cluster- Returns:
- this config
-
getAcknowledgeType
@Nonnull public WanAcknowledgeType getAcknowledgeType()
Returns the strategy for when the target cluster should acknowledge that a WAN event batch has been processed.- Returns:
- acknowledge type
-
setAcknowledgeType
public WanBatchPublisherConfig setAcknowledgeType(@Nonnull WanAcknowledgeType acknowledgeType)
Sets the strategy for when the target cluster should acknowledge that a WAN event batch has been processed.- Parameters:
acknowledgeType
- acknowledge type- Returns:
- this config
-
getTargetEndpoints
public java.lang.String getTargetEndpoints()
Returns the comma separated list of target cluster members, e.g.127.0.0.1:5701, 127.0.0.1:5702
. If you don't know the addresses of the target cluster members upfront, you may consider using some of the discovery strategies.- Returns:
- comma separated list
- See Also:
getAwsConfig()
,getGcpConfig()
,getAzureConfig()
,getKubernetesConfig()
,getEurekaConfig()
,getDiscoveryConfig()
-
setTargetEndpoints
public WanBatchPublisherConfig setTargetEndpoints(java.lang.String targetEndpoints)
Sets the comma separated list of target cluster members, e.g.127.0.0.1:5701, 127.0.0.1:5702
. If you don't know the addresses of the target cluster members upfront, you may consider using some of the discovery strategies.- Parameters:
targetEndpoints
- comma separated list- Returns:
- this config
- See Also:
setAwsConfig(AwsConfig)
,setGcpConfig(GcpConfig)
,setAzureConfig(AzureConfig)
,setKubernetesConfig(KubernetesConfig)
,setEurekaConfig(EurekaConfig)
,setDiscoveryConfig(DiscoveryConfig)
-
getSyncConfig
public WanSyncConfig getSyncConfig()
Returns the config for the WAN sync mechanism.
-
setSyncConfig
public WanBatchPublisherConfig setSyncConfig(WanSyncConfig syncConfig)
Sets the config for the WAN sync mechanism.- Parameters:
syncConfig
- the WAN sync config- Returns:
- this config
-
getQueueCapacity
public int getQueueCapacity()
Returns the capacity of the primary and backup queue for WAN replication events.One hazelcast instance can have up to
2*queueCapacity
events since we keep up toqueueCapacity
primary events (events with keys for which the instance is the owner) andqueueCapacity
backup events (events with keys for which the instance is the backup). Events for IMap and ICache count against this limit collectively.When the queue capacity is reached, backup events are dropped while normal replication events behave as determined by the
getQueueFullBehavior()
.- Returns:
- the queue capacity
-
setQueueCapacity
public WanBatchPublisherConfig setQueueCapacity(int queueCapacity)
Sets the capacity of the primary and backup queue for WAN replication events.One hazelcast instance can have up to
2*queueCapacity
events since we keep up toqueueCapacity
primary events (events with keys for which the instance is the owner) andqueueCapacity
backup events (events with keys for which the instance is the backup). Events for IMap and ICache count against this limit collectively.When the queue capacity is reached, backup events are dropped while normal replication events behave as determined by the
getQueueFullBehavior()
.- Parameters:
queueCapacity
- the queue capacity- Returns:
- this config
-
getQueueFullBehavior
@Nonnull public WanQueueFullBehavior getQueueFullBehavior()
Returns the configured behaviour of this WAN publisher when the WAN queue is full.
-
setQueueFullBehavior
public WanBatchPublisherConfig setQueueFullBehavior(@Nonnull WanQueueFullBehavior queueFullBehavior)
Sets the configured behaviour of this WAN publisher when the WAN queue is full.- Parameters:
queueFullBehavior
- the behaviour of this publisher when the WAN queue is full- Returns:
- this config
-
getInitialPublisherState
@Nonnull public WanPublisherState getInitialPublisherState()
Returns the initial WAN publisher state.
-
setInitialPublisherState
public WanBatchPublisherConfig setInitialPublisherState(@Nonnull WanPublisherState initialPublisherState)
Sets the initial publisher state.- Parameters:
initialPublisherState
- the state- Returns:
- this configuration
-
getDiscoveryPeriodSeconds
public int getDiscoveryPeriodSeconds()
Returns the period in seconds in which WAN tries to discover new target endpoints and reestablish connections to failed endpoints.- Returns:
- period for retrying connections to target endpoints
-
setDiscoveryPeriodSeconds
public WanBatchPublisherConfig setDiscoveryPeriodSeconds(int discoveryPeriodSeconds)
Sets the period in seconds in which WAN tries to discover new target endpoints and reestablish connections to failed endpoints.- Parameters:
discoveryPeriodSeconds
- period for retrying connections to target endpoints- Returns:
- this config
-
getMaxTargetEndpoints
public int getMaxTargetEndpoints()
Returns the maximum number of endpoints that WAN will connect to when using a discovery mechanism to define endpoints. This property has no effect when static endpoint addresses are defined usingsetTargetEndpoints(String)
.- Returns:
- maximum number of endpoints that WAN will connect to
-
setMaxTargetEndpoints
public WanBatchPublisherConfig setMaxTargetEndpoints(int maxTargetEndpoints)
Sets the maximum number of endpoints that WAN will connect to when using a discovery mechanism to define endpoints. This property has no effect when static endpoint addresses are defined usingsetTargetEndpoints(String)
.- Parameters:
maxTargetEndpoints
- maximum number of endpoints that WAN will connect to- Returns:
- this config
-
getMaxConcurrentInvocations
public int getMaxConcurrentInvocations()
Returns the maximum number of WAN event batches being sent to the target cluster concurrently.Setting this property to anything less than
2
will only allow a single batch of events to be sent to each target endpoint and will maintain causality of events for a single partition.Setting this property to
2
or higher will allow multiple batches of WAN events to be sent to each target endpoint. Since this allows reordering or batches due to network conditions, causality and ordering of events for a single partition is lost and batches for a single partition are now sent randomly to any available target endpoint. This, however, does present faster WAN replication for certain scenarios such as replicating immutable, independent map entries which are only added once and where ordering of when these entries are added is not necessary. Keep in mind that if you set this property to a value which is less than the target endpoint count, you will lose performance as not all target endpoints will be used at any point in time to process WAN event batches. So, for instance, if you have a target cluster with 3 members (target endpoints) and you want to use this property, it makes sense to set it to a value higher than3
. Otherwise, you can simply disable it by setting it to less than2
in which case WAN will use the default replication strategy and adapt to the target endpoint count while maintaining causality.- Returns:
- the maximum number of WAN event batches being sent to the target cluster concurrently
-
setMaxConcurrentInvocations
public WanBatchPublisherConfig setMaxConcurrentInvocations(int maxConcurrentInvocations)
Sets the maximum number of WAN event batches being sent to the target cluster concurrently.Setting this property to anything less than
2
will only allow a single batch of events to be sent to each target endpoint and will maintain causality of events for a single partition.Setting this property to
2
or higher will allow multiple batches of WAN events to be sent to each target endpoint. Since this allows reordering or batches due to network conditions, causality and ordering of events for a single partition is lost and batches for a single partition are now sent randomly to any available target endpoint. This, however, does present faster WAN replication for certain scenarios such as replicating immutable, independent map entries which are only added once and where ordering of when these entries are added is not necessary. Keep in mind that if you set this property to a value which is less than the target endpoint count, you will lose performance as not all target endpoints will be used at any point in time to process WAN event batches. So, for instance, if you have a target cluster with 3 members (target endpoints) and you want to use this property, it makes sense to set it to a value higher than3
. Otherwise, you can simply disable it by setting it to less than2
in which case WAN will use the default replication strategy and adapt to the target endpoint count while maintaining causality.- Parameters:
maxConcurrentInvocations
- the maximum number of WAN event batches being sent to the target cluster concurrently- Returns:
- this config
-
isUseEndpointPrivateAddress
public boolean isUseEndpointPrivateAddress()
Returns whether the WAN connection manager should connect to the endpoint on the private address returned by the discovery SPI. By default this property isfalse
which means the WAN connection manager will always use the public address.- Returns:
true
if the WAN connection manager should connect to the endpoint on the private address returned by the discovery SPI- See Also:
DiscoveryNode.getPublicAddress()
,DiscoveryNode.getPrivateAddress()
-
setUseEndpointPrivateAddress
public WanBatchPublisherConfig setUseEndpointPrivateAddress(boolean useEndpointPrivateAddress)
Sets whether the WAN connection manager should connect to the endpoint on the private address returned by the discovery SPI. By default this property isfalse
which means the WAN connection manager will always use the public address.- Returns:
- this config
- See Also:
DiscoveryNode.getPublicAddress()
,DiscoveryNode.getPrivateAddress()
-
getIdleMinParkNs
public long getIdleMinParkNs()
Returns the minimum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.- Returns:
- minimum duration in nanoseconds that the WAN replication thread will be parked
-
setIdleMinParkNs
public WanBatchPublisherConfig setIdleMinParkNs(long idleMinParkNs)
Sets the minimum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.- Parameters:
idleMinParkNs
- minimum duration in nanoseconds that the WAN replication thread will be parked- Returns:
- this config
-
getIdleMaxParkNs
public long getIdleMaxParkNs()
Returns the maximum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.- Returns:
- maximum duration in nanoseconds that the WAN replication thread will be parked
-
setIdleMaxParkNs
public WanBatchPublisherConfig setIdleMaxParkNs(long idleMaxParkNs)
Sets the maximum duration in nanoseconds that the WAN replication thread will be parked if there are no events to replicate.- Parameters:
idleMaxParkNs
- maximum duration in nanoseconds that the WAN replication thread will be parked- Returns:
- this config
-
getAwsConfig
public AwsConfig getAwsConfig()
Returns theAwsConfig
used by the discovery mechanism for this WAN publisher.
-
setAwsConfig
public WanBatchPublisherConfig setAwsConfig(AwsConfig awsConfig)
Sets theAwsConfig
used by the discovery mechanism for this WAN publisher.- Parameters:
awsConfig
- the AWS discovery configuration- Returns:
- this config
- Throws:
java.lang.IllegalArgumentException
- if awsConfig is null
-
getGcpConfig
public GcpConfig getGcpConfig()
Returns theGcpConfig
used by the discovery mechanism for this WAN publisher.
-
setGcpConfig
public WanBatchPublisherConfig setGcpConfig(GcpConfig gcpConfig)
Sets theGcpConfig
used by the discovery mechanism for this WAN publisher.- Parameters:
gcpConfig
- the GCP discovery configuration- Returns:
- this config
- Throws:
java.lang.IllegalArgumentException
- if gcpConfig is null
-
getAzureConfig
public AzureConfig getAzureConfig()
Returns theAzureConfig
used by the discovery mechanism for this WAN publisher.
-
setAzureConfig
public WanBatchPublisherConfig setAzureConfig(AzureConfig azureConfig)
Sets theAzureConfig
used by the discovery mechanism for this WAN publisher.- Parameters:
azureConfig
- the Azure discovery configuration- Returns:
- this config
- Throws:
java.lang.IllegalArgumentException
- if azureConfig is null
-
getKubernetesConfig
public KubernetesConfig getKubernetesConfig()
Returns theKubernetesConfig
used by the discovery mechanism for this WAN publisher.
-
setKubernetesConfig
public WanBatchPublisherConfig setKubernetesConfig(KubernetesConfig kubernetesConfig)
Sets theKubernetesConfig
used by the discovery mechanism for this WAN publisher.- Parameters:
kubernetesConfig
- the Kubernetes discovery configuration- Returns:
- this config
- Throws:
java.lang.IllegalArgumentException
- if kubernetesConfig is null
-
getEurekaConfig
public EurekaConfig getEurekaConfig()
Returns theEurekaConfig
used by the discovery mechanism for this WAN publisher.
-
setEurekaConfig
public WanBatchPublisherConfig setEurekaConfig(EurekaConfig eurekaConfig)
Sets theEurekaConfig
used by the discovery mechanism for this WAN publisher.- Parameters:
eurekaConfig
- the Eureka discovery configuration- Returns:
- this config
- Throws:
java.lang.IllegalArgumentException
- if eurekaConfig is null
-
getDiscoveryConfig
public DiscoveryConfig getDiscoveryConfig()
Returns the currently definedDiscoveryConfig
used by the discovery mechanism for this WAN publisher.- Returns:
- current DiscoveryProvidersConfig instance
-
setDiscoveryConfig
public WanBatchPublisherConfig setDiscoveryConfig(DiscoveryConfig discoveryConfig)
Sets theDiscoveryConfig
used by the discovery mechanism for this WAN publisher.- Parameters:
discoveryConfig
- configuration to set- Returns:
- this config
- Throws:
java.lang.IllegalArgumentException
- if discoveryProvidersConfig is null
-
getEndpoint
public java.lang.String getEndpoint()
Returns the WAN endpoint configuration qualifier. When using pre-3.12 network configuration, its value can benull
and is not taken into account. With 3.12+ advanced network config, anEndpointConfig
orServerSocketEndpointConfig
is looked up with protocol typeWAN
and this string as identifier. If such anEndpointConfig
is found, its configuration is used when the WAN publisher opens a connection to the target cluster members.- Returns:
- endpoint qualifier
- Since:
- 3.12
- See Also:
NetworkConfig
,AdvancedNetworkConfig
-
setEndpoint
public WanBatchPublisherConfig setEndpoint(java.lang.String endpoint)
Sets the WAN endpoint configuration qualifier. When using pre-3.12 network configuration, its value can benull
and is not taken into account. With 3.12+ advanced network config, anEndpointConfig
orServerSocketEndpointConfig
is looked up with protocol typeWAN
and this string as identifier. If such anEndpointConfig
is found, its configuration is used when the WAN publisher opens a connection to the target cluster members.- Parameters:
endpoint
- endpoint qualifier- Returns:
- this configuration
- Since:
- 3.12
- See Also:
NetworkConfig
,AdvancedNetworkConfig
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFactoryId
public int getFactoryId()
Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Returns:
- factory ID
-
getClassId
public int getClassId()
Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Returns:
- type ID
-
writeData
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Overrides:
writeData
in classAbstractWanPublisherConfig
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Overrides:
readData
in classAbstractWanPublisherConfig
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
-