Package io.atomix.protocols.backup
Class MultiPrimaryProtocolBuilder
java.lang.Object
io.atomix.primitive.protocol.PrimitiveProtocolBuilder<MultiPrimaryProtocolBuilder,MultiPrimaryProtocolConfig,MultiPrimaryProtocol>
io.atomix.protocols.backup.MultiPrimaryProtocolBuilder
- All Implemented Interfaces:
io.atomix.utils.Builder<MultiPrimaryProtocol>
public class MultiPrimaryProtocolBuilder extends io.atomix.primitive.protocol.PrimitiveProtocolBuilder<MultiPrimaryProtocolBuilder,MultiPrimaryProtocolConfig,MultiPrimaryProtocol>
Multi-primary protocol builder.
-
Method Summary
Modifier and Type Method Description MultiPrimaryProtocolbuild()MultiPrimaryProtocolBuilderwithBackups(int numBackups)Sets the number of backups.MultiPrimaryProtocolBuilderwithConsistency(io.atomix.primitive.Consistency consistency)Sets the protocol consistency model.MultiPrimaryProtocolBuilderwithMaxRetries(int maxRetries)Sets the maximum number of retries before an operation can be failed.MultiPrimaryProtocolBuilderwithPartitioner(io.atomix.primitive.partition.Partitioner<java.lang.String> partitioner)Sets the protocol partitioner.MultiPrimaryProtocolBuilderwithRecovery(io.atomix.primitive.Recovery recovery)Sets the protocol recovery strategy.MultiPrimaryProtocolBuilderwithReplication(io.atomix.primitive.Replication replication)Sets the protocol replication strategy.MultiPrimaryProtocolBuilderwithRetryDelay(long retryDelay, java.util.concurrent.TimeUnit timeUnit)Sets the operation retry delay.MultiPrimaryProtocolBuilderwithRetryDelay(java.time.Duration retryDelay)Sets the operation retry delay.MultiPrimaryProtocolBuilderwithRetryDelayMillis(long retryDelayMillis)Sets the operation retry delay.
-
Method Details
-
withPartitioner
public MultiPrimaryProtocolBuilder withPartitioner(io.atomix.primitive.partition.Partitioner<java.lang.String> partitioner)Sets the protocol partitioner.- Parameters:
partitioner- the protocol partitioner- Returns:
- the protocol builder
-
withConsistency
Sets the protocol consistency model.- Parameters:
consistency- the protocol consistency model- Returns:
- the protocol builder
-
withReplication
Sets the protocol replication strategy.- Parameters:
replication- the protocol replication strategy- Returns:
- the protocol builder
-
withRecovery
Sets the protocol recovery strategy.- Parameters:
recovery- the protocol recovery strategy- Returns:
- the protocol builder
-
withBackups
Sets the number of backups.- Parameters:
numBackups- the number of backups- Returns:
- the protocol builder
-
withMaxRetries
Sets the maximum number of retries before an operation can be failed.- Parameters:
maxRetries- the maximum number of retries before an operation can be failed- Returns:
- the proxy builder
-
withRetryDelayMillis
Sets the operation retry delay.- Parameters:
retryDelayMillis- the delay between operation retries in milliseconds- Returns:
- the proxy builder
-
withRetryDelay
public MultiPrimaryProtocolBuilder withRetryDelay(long retryDelay, java.util.concurrent.TimeUnit timeUnit)Sets the operation retry delay.- Parameters:
retryDelay- the delay between operation retriestimeUnit- the delay time unit- Returns:
- the proxy builder
- Throws:
java.lang.NullPointerException- if the time unit is null
-
withRetryDelay
Sets the operation retry delay.- Parameters:
retryDelay- the delay between operation retries- Returns:
- the proxy builder
- Throws:
java.lang.NullPointerException- if the delay is null
-
build
-