Package org.onosproject.store.service
Class LeaderElectorOptions<O extends LeaderElectorOptions<O>>
- java.lang.Object
-
- org.onosproject.store.primitives.DistributedPrimitiveOptions<O>
-
- org.onosproject.store.service.LeaderElectorOptions<O>
-
- Direct Known Subclasses:
LeaderElectorBuilder
public abstract class LeaderElectorOptions<O extends LeaderElectorOptions<O>> extends DistributedPrimitiveOptions<O>
Builder for constructing newAsyncLeaderElector
instances.
-
-
Constructor Summary
Constructors Constructor Description LeaderElectorOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
electionTimeoutMillis()
Returns the election timeout in milliseconds.O
withElectionTimeout(long electionTimeoutMillis)
Sets the election timeout in milliseconds.O
withElectionTimeout(long electionTimeout, java.util.concurrent.TimeUnit timeUnit)
Sets the election timeout.-
Methods inherited from class org.onosproject.store.primitives.DistributedPrimitiveOptions
applicationId, meteringEnabled, name, partitionsDisabled, readOnly, relaxedReadConsistency, revisionType, serializer, type, version, withApplicationId, withName, withRelaxedReadConsistency, withRevisionType, withSerializer, withUpdatesDisabled, withVersion
-
-
-
-
Method Detail
-
withElectionTimeout
public O withElectionTimeout(long electionTimeoutMillis)
Sets the election timeout in milliseconds.- Parameters:
electionTimeoutMillis
- the election timeout in milliseconds- Returns:
- leader elector builder
-
withElectionTimeout
public O withElectionTimeout(long electionTimeout, java.util.concurrent.TimeUnit timeUnit)
Sets the election timeout.- Parameters:
electionTimeout
- the election timeouttimeUnit
- the timeout time unit- Returns:
- leader elector builder
-
electionTimeoutMillis
public final long electionTimeoutMillis()
Returns the election timeout in milliseconds.- Returns:
- the election timeout in milliseconds
-
-