B - builder typeP - primitive typepublic abstract class DistributedPrimitiveBuilder<B extends DistributedPrimitiveBuilder<B,P>,P extends DistributedPrimitive> extends Object implements io.atomix.utils.Builder<P>
| Constructor and Description |
|---|
DistributedPrimitiveBuilder(PrimitiveType type,
String name) |
| Modifier and Type | Method and Description |
|---|---|
int |
backups()
Returns the number of backups for the primitive.
|
P |
build()
Constructs an instance of the distributed primitive.
|
abstract CompletableFuture<P> |
buildAsync()
Constructs an instance of the asynchronous primitive.
|
Consistency |
consistency()
Returns the primitive consistency model.
|
int |
maxRetries()
Returns the maximum number of allowed retries.
|
String |
name()
Returns the name of the primitive.
|
Persistence |
persistence()
Returns the primitive persistence level.
|
PrimitiveType |
primitiveType()
Returns the primitive type.
|
PrimitiveProtocol |
protocol()
Returns the primitive protocol.
|
boolean |
readOnly()
Returns if updates are disabled.
|
Recovery |
recovery()
Returns the recovery strategy.
|
boolean |
relaxedReadConsistency()
Returns if consistency is relaxed for read operations.
|
Replication |
replication()
Returns the replication strategy.
|
Duration |
retryDelay()
Returns the retry delay.
|
io.atomix.utils.serializer.Serializer |
serializer()
Returns the serializer.
|
B |
withBackups(int numBackups)
Sets the number of backups.
|
B |
withConsistency(Consistency consistency)
Sets the primitive consistency model.
|
B |
withMaxRetries(int maxRetries)
Sets the maximum number of operation retries.
|
B |
withPersistence(Persistence persistence)
Sets the primitive persistence level.
|
B |
withProtocol(PrimitiveProtocol protocol)
Sets the primitive protocol.
|
B |
withRecovery(Recovery recovery)
Sets the primitive recovery strategy.
|
B |
withRelaxedReadConsistency()
Turns on relaxed consistency for read operations.
|
B |
withReplication(Replication replication)
Sets the primitive replication strategy.
|
B |
withRetryDelay(Duration retryDelay)
Sets the retry delay.
|
B |
withSerializer(io.atomix.utils.serializer.Serializer serializer)
Sets the serializer to use for transcoding info held in the primitive.
|
B |
withUpdatesDisabled()
Disables state changing operations on the returned distributed primitive.
|
public DistributedPrimitiveBuilder(PrimitiveType type, String name)
public B withSerializer(io.atomix.utils.serializer.Serializer serializer)
serializer - serializerpublic B withUpdatesDisabled()
public B withRelaxedReadConsistency()
public B withProtocol(PrimitiveProtocol protocol)
protocol - the primitive protocolpublic B withConsistency(Consistency consistency)
consistency - the primitive consistency modelNullPointerException - if the consistency model is nullpublic B withPersistence(Persistence persistence)
persistence - the primitive persistence levelNullPointerException - if the persistence level is nullpublic B withReplication(Replication replication)
replication - the primitive replication strategyNullPointerException - if the replication strategy is nullpublic B withRecovery(Recovery recovery)
recovery - the primitive recovery strategyNullPointerException - if the recovery strategy is nullpublic B withBackups(int numBackups)
numBackups - the number of backupsIllegalArgumentException - if the number of backups is not positive or -1public B withMaxRetries(int maxRetries)
maxRetries - the maximum number of allowed operation retriespublic B withRetryDelay(Duration retryDelay)
retryDelay - the retry delaypublic boolean readOnly()
true if yes; false otherwisepublic boolean relaxedReadConsistency()
true if yes; false otherwisepublic io.atomix.utils.serializer.Serializer serializer()
public String name()
public PrimitiveType primitiveType()
public PrimitiveProtocol protocol()
public Consistency consistency()
public Persistence persistence()
public Replication replication()
public Recovery recovery()
public int backups()
public int maxRetries()
public Duration retryDelay()
public P build()
build in interface io.atomix.utils.Builder<P extends DistributedPrimitive>public abstract CompletableFuture<P> buildAsync()
Copyright © 2013–2018. All rights reserved.