Record Class MultiClusterConfig
java.lang.Object
java.lang.Record
org.openspaces.core.multicluster.MultiClusterConfig
- Record Components:
writeMode- how mutations are distributedreadMode- how reads pick a clusterfailoverPolicy- what happens when the routed cluster is unavailabletransactionPolicy- behaviour of fan-out inside a transactionquiescePolicy- behaviour when a cluster is quiescedfailureThreshold- consecutive failed reads before a cluster is marked unhealthy; a failed mutation against an unreachable cluster takes it out at oncefailureWindow- rolling window in which those failures must occurrequiredSuccessCount- forWRITE_SYNC, how many clusters must succeed (0= all of them)takeFanOutOnMiss- whether atakethat matched nothing on the read cluster still issues removals elsewhereasyncQueueCapacity- bound on mutations still owed to a cluster - deferred because it was quiesced, or handed to the background arm of an asynchronous operationfanOutTasks- whetherexecuteruns the task on every cluster rather than only on the active one. Off by default: a task is arbitrary code that may not be idempotent, and running it twice is a worse failure than running it onceclearSumsAcrossClusters- whether a fanned-outclearreturns the total removed across clusters rather than the primary's count
public record MultiClusterConfig(MultiClusterGigaSpace.WriteMode writeMode, MultiClusterGigaSpace.ReadMode readMode, MultiClusterGigaSpace.FailoverPolicy failoverPolicy, TransactionPolicy transactionPolicy, QuiescePolicy quiescePolicy, int failureThreshold, Duration failureWindow, int requiredSuccessCount, boolean takeFanOutOnMiss, int asyncQueueCapacity, boolean fanOutTasks, boolean clearSumsAcrossClusters)
extends Record
The complete routing configuration of a proxy instance, validated as a whole.
Immutable on purpose. The setXxx methods on
MultiClusterGigaSpace swap one config for another atomically, so an
in-flight operation always sees a coherent set of settings rather than a half-applied change. The
withXxx methods produce the replacement.
MultiClusterGigaSpace.WriteMode.WRITE_ONCE is the single statement of who replicates a mutation: the proxy applies
it to one cluster and a WAN Gateway carries it, or MultiClusterGigaSpace.WriteMode.WRITE_SYNC fans it out from here.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMultiClusterConfig(MultiClusterGigaSpace.WriteMode writeMode, MultiClusterGigaSpace.ReadMode readMode, MultiClusterGigaSpace.FailoverPolicy failoverPolicy, TransactionPolicy transactionPolicy, QuiescePolicy quiescePolicy, int failureThreshold, Duration failureWindow, int requiredSuccessCount, boolean takeFanOutOnMiss, int asyncQueueCapacity, boolean fanOutTasks, boolean clearSumsAcrossClusters) Creates an instance of aMultiClusterConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theasyncQueueCapacityrecord component.booleanReturns the value of theclearSumsAcrossClustersrecord component.static MultiClusterConfigdefaults()Conservative defaults: single active cluster, no fan-out, automatic failover.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailoverPolicyrecord component.intReturns the value of thefailureThresholdrecord component.Returns the value of thefailureWindowrecord component.booleanReturns the value of thefanOutTasksrecord component.final inthashCode()Returns a hash code value for this object.booleanTrue when reads may be served by a cluster other than the active one.booleanTrue when mutations are applied by the proxy to more than one cluster.Returns the value of thequiescePolicyrecord component.readMode()Returns the value of thereadModerecord component.intReturns the value of therequiredSuccessCountrecord component.booleanReturns the value of thetakeFanOutOnMissrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransactionPolicyrecord component.withAsyncQueueCapacity(int capacity) withFailureThreshold(int threshold) withFailureWindow(Duration window) Returns the value of thewriteModerecord component.
-
Field Details
-
DEFAULT_FAILURE_THRESHOLD
public static final int DEFAULT_FAILURE_THRESHOLD- See Also:
-
DEFAULT_FAILURE_WINDOW
-
DEFAULT_ASYNC_QUEUE_CAPACITY
public static final int DEFAULT_ASYNC_QUEUE_CAPACITY- See Also:
-
-
Constructor Details
-
MultiClusterConfig
public MultiClusterConfig(MultiClusterGigaSpace.WriteMode writeMode, MultiClusterGigaSpace.ReadMode readMode, MultiClusterGigaSpace.FailoverPolicy failoverPolicy, TransactionPolicy transactionPolicy, QuiescePolicy quiescePolicy, int failureThreshold, Duration failureWindow, int requiredSuccessCount, boolean takeFanOutOnMiss, int asyncQueueCapacity, boolean fanOutTasks, boolean clearSumsAcrossClusters) Creates an instance of aMultiClusterConfigrecord class.- Parameters:
writeMode- the value for thewriteModerecord componentreadMode- the value for thereadModerecord componentfailoverPolicy- the value for thefailoverPolicyrecord componenttransactionPolicy- the value for thetransactionPolicyrecord componentquiescePolicy- the value for thequiescePolicyrecord componentfailureThreshold- the value for thefailureThresholdrecord componentfailureWindow- the value for thefailureWindowrecord componentrequiredSuccessCount- the value for therequiredSuccessCountrecord componenttakeFanOutOnMiss- the value for thetakeFanOutOnMissrecord componentasyncQueueCapacity- the value for theasyncQueueCapacityrecord componentfanOutTasks- the value for thefanOutTasksrecord componentclearSumsAcrossClusters- the value for theclearSumsAcrossClustersrecord component
-
-
Method Details
-
defaults
Conservative defaults: single active cluster, no fan-out, automatic failover. -
withWriteMode
-
withReadMode
-
withFailoverPolicy
-
withFailureThreshold
-
withFailureWindow
-
withAsyncQueueCapacity
-
isFanOutWrite
public boolean isFanOutWrite()True when mutations are applied by the proxy to more than one cluster. -
isBalancedRead
public boolean isBalancedRead()True when reads may be served by a cluster other than the active one. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
writeMode
-
readMode
-
failoverPolicy
Returns the value of thefailoverPolicyrecord component.- Returns:
- the value of the
failoverPolicyrecord component
-
transactionPolicy
Returns the value of thetransactionPolicyrecord component.- Returns:
- the value of the
transactionPolicyrecord component
-
quiescePolicy
Returns the value of thequiescePolicyrecord component.- Returns:
- the value of the
quiescePolicyrecord component
-
failureThreshold
public int failureThreshold()Returns the value of thefailureThresholdrecord component.- Returns:
- the value of the
failureThresholdrecord component
-
failureWindow
Returns the value of thefailureWindowrecord component.- Returns:
- the value of the
failureWindowrecord component
-
requiredSuccessCount
public int requiredSuccessCount()Returns the value of therequiredSuccessCountrecord component.- Returns:
- the value of the
requiredSuccessCountrecord component
-
takeFanOutOnMiss
public boolean takeFanOutOnMiss()Returns the value of thetakeFanOutOnMissrecord component.- Returns:
- the value of the
takeFanOutOnMissrecord component
-
asyncQueueCapacity
public int asyncQueueCapacity()Returns the value of theasyncQueueCapacityrecord component.- Returns:
- the value of the
asyncQueueCapacityrecord component
-
fanOutTasks
public boolean fanOutTasks()Returns the value of thefanOutTasksrecord component.- Returns:
- the value of the
fanOutTasksrecord component
-
clearSumsAcrossClusters
public boolean clearSumsAcrossClusters()Returns the value of theclearSumsAcrossClustersrecord component.- Returns:
- the value of the
clearSumsAcrossClustersrecord component
-