public static final class ConsensusModule.Context extends Object implements Cloneable
ConsensusModule in a cluster.
The context will be owned by ConsensusModuleAgent after a successful
ConsensusModule.launch(Context) and closed via ConsensusModule.close().
| Constructor and Description |
|---|
Context() |
| Modifier and Type | Method and Description |
|---|---|
Aeron |
aeron()
Aeron client for communicating with the local Media Driver. |
ConsensusModule.Context |
aeron(Aeron aeron)
Aeron client for communicating with the local Media Driver. |
String |
aeronDirectoryName()
Get the top level Aeron directory used for communication between the Aeron client and Media Driver.
|
ConsensusModule.Context |
aeronDirectoryName(String aeronDirectoryName)
Set the top level Aeron directory used for communication between the Aeron client and Media Driver.
|
int |
appointedLeaderId()
The cluster member id of the appointed cluster leader.
|
ConsensusModule.Context |
appointedLeaderId(int appointedLeaderId)
The cluster member id of the appointed cluster leader.
|
int |
appVersion()
User assigned application version which appended to the log as the appVersion in new leadership events.
|
ConsensusModule.Context |
appVersion(int appVersion)
User assigned application version which appended to the log as the appVersion in new leadership events.
|
AeronArchive.Context |
archiveContext()
Get the
AeronArchive.Context that should be used for communicating with
the local Archive. |
ConsensusModule.Context |
archiveContext(AeronArchive.Context archiveContext)
Set the
AeronArchive.Context that should be used for communicating with the
local Archive. |
AuthenticatorSupplier |
authenticatorSupplier()
Get the
AuthenticatorSupplier that should be used for the consensus module. |
ConsensusModule.Context |
authenticatorSupplier(AuthenticatorSupplier authenticatorSupplier)
Set the
AuthenticatorSupplier that will be used for the consensus module. |
ConsensusModule.Context |
clone()
Perform a shallow copy of the object.
|
void |
close()
Close the context and free applicable resources.
|
ClusterClock |
clusterClock()
Get the
ClusterClock to used for timestamping messages and timers. |
ConsensusModule.Context |
clusterClock(ClusterClock clock)
Set the
ClusterClock to be used for timestamping messages and timers. |
String |
clusterConsensusEndpoints()
The endpoints representing cluster members of the cluster to attempt to contact to join the cluster.
|
ConsensusModule.Context |
clusterConsensusEndpoints(String endpoints)
String representing the cluster members consensus endpoints used to request to join the cluster.
|
File |
clusterDir()
The directory used for for the consensus module directory.
|
ConsensusModule.Context |
clusterDir(File clusterDir)
Set the directory to use for the consensus module directory.
|
String |
clusterDirectoryName()
The directory name to use for the consensus module directory.
|
ConsensusModule.Context |
clusterDirectoryName(String clusterDirectoryName)
Set the directory name to use for the consensus module directory.
|
int |
clusterId()
Get the id for this cluster instance.
|
ConsensusModule.Context |
clusterId(int clusterId)
Set the id for this cluster instance.
|
ClusterMarkFile |
clusterMarkFile()
The
ClusterMarkFile in use. |
ConsensusModule.Context |
clusterMarkFile(ClusterMarkFile markFile)
Set the
ClusterMarkFile in use. |
int |
clusterMemberId()
This cluster member identity.
|
ConsensusModule.Context |
clusterMemberId(int clusterMemberId)
This cluster member identity.
|
String |
clusterMembers()
The endpoints representing members of the cluster which are all candidates to be leader.
|
ConsensusModule.Context |
clusterMembers(String clusterMembers)
String representing the cluster members.
|
boolean |
clusterMembersIgnoreSnapshot()
Whether the cluster members in the snapshot should be ignored or not.
|
ConsensusModule.Context |
clusterMembersIgnoreSnapshot(boolean ignore)
Whether the cluster members in the snapshot should be ignored or not.
|
Counter |
clusterNodeRoleCounter()
Get the counter for representing the current
Cluster.Role of the
consensus module node. |
ConsensusModule.Context |
clusterNodeRoleCounter(Counter nodeRole)
Set the counter for representing the current
Cluster.Role of the
cluster node. |
Counter |
commitPositionCounter()
Get the counter for the commit position the cluster has reached for consensus.
|
ConsensusModule.Context |
commitPositionCounter(Counter commitPosition)
Set the counter for the commit position the cluster has reached for consensus.
|
void |
conclude()
Conclude configuration by setting up defaults when specifics are not provided.
|
String |
consensusChannel()
Get the channel parameter for the consensus communication channel.
|
ConsensusModule.Context |
consensusChannel(String channel)
Set the channel parameter for the consensus communication channel.
|
int |
consensusModuleStreamId()
Get the stream id for communications from the services to the consensus module.
|
ConsensusModule.Context |
consensusModuleStreamId(int streamId)
Set the stream id for communications from the services to the consensus module.
|
int |
consensusStreamId()
Get the stream id for the consensus channel.
|
ConsensusModule.Context |
consensusStreamId(int streamId)
Set the stream id for the consensus channel.
|
String |
controlChannel()
Get the channel parameter for bi-directional communications between the consensus module and services.
|
ConsensusModule.Context |
controlChannel(String channel)
Set the channel parameter for bi-directional communications between the consensus module and services.
|
Counter |
controlToggleCounter()
Get the counter for the control toggle for triggering actions on the cluster node.
|
ConsensusModule.Context |
controlToggleCounter(Counter controlToggle)
Set the counter for the control toggle for triggering actions on the cluster node.
|
CountedErrorHandler |
countedErrorHandler()
The
errorHandler() that will increment errorCounter() by default. |
ConsensusModule.Context |
countedErrorHandler(CountedErrorHandler countedErrorHandler)
The
errorHandler() that will increment errorCounter() by default. |
void |
deleteDirectory()
Delete the cluster directory.
|
boolean |
deleteDirOnStart()
Will the consensus module attempt to immediately delete
clusterDir() on startup. |
ConsensusModule.Context |
deleteDirOnStart(boolean deleteDirOnStart)
Should the consensus module attempt to immediately delete
clusterDir() on startup. |
long |
dynamicJoinIntervalNs()
Interval at which a dynamic joining member will send add cluster member and snapshot recording queries.
|
ConsensusModule.Context |
dynamicJoinIntervalNs(long dynamicJoinIntervalNs)
Interval at which a dynamic joining member will send add cluster member and snapshot recording queries.
|
Counter |
electionStateCounter()
Get the counter for the current state of an election
|
ConsensusModule.Context |
electionStateCounter(Counter electionStateCounter)
Set the counter for the current state of an election.
|
long |
electionStatusIntervalNs()
Interval at which a member will send out status messages during the election phases.
|
ConsensusModule.Context |
electionStatusIntervalNs(long electionStatusIntervalNs)
Interval at which a member will send out status messages during the election phases.
|
long |
electionTimeoutNs()
Timeout to wait for votes in an election before declaring the election void and starting over.
|
ConsensusModule.Context |
electionTimeoutNs(long timeoutNs)
Timeout to wait for votes in an election before declaring the election void and starting over.
|
EpochClock |
epochClock()
Get the
EpochClock to used for tracking wall clock time. |
ConsensusModule.Context |
epochClock(EpochClock clock)
Set the
EpochClock to be used for tracking wall clock time. |
int |
errorBufferLength()
The error buffer length in bytes.
|
ConsensusModule.Context |
errorBufferLength(int errorBufferLength)
Set the error buffer length in bytes to use.
|
AtomicCounter |
errorCounter()
Get the error counter that will record the number of errors observed.
|
ConsensusModule.Context |
errorCounter(AtomicCounter errorCounter)
Set the error counter that will record the number of errors observed.
|
ErrorHandler |
errorHandler()
Get the
ErrorHandler to be used by the Consensus Module. |
ConsensusModule.Context |
errorHandler(ErrorHandler errorHandler)
Set the
ErrorHandler to be used by the Consensus Module. |
DistinctErrorLog |
errorLog()
The
DistinctErrorLog in use. |
ConsensusModule.Context |
errorLog(DistinctErrorLog errorLog)
Set the
DistinctErrorLog in use. |
ConsensusModule.Context |
fileSyncLevel(int syncLevel)
Set level at which files should be sync'ed to disk.
|
IdleStrategy |
idleStrategy()
Get a new
IdleStrategy based on configured supplier. |
ConsensusModule.Context |
idleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier)
Provides an
IdleStrategy supplier for the idle strategy for the agent duty cycle. |
String |
ingressChannel()
Get the channel parameter for the ingress channel.
|
ConsensusModule.Context |
ingressChannel(String channel)
Set the channel parameter for the ingress channel.
|
int |
ingressFragmentLimit()
The limit for fragments to be consumed on each poll of ingress.
|
ConsensusModule.Context |
ingressFragmentLimit(int ingressFragmentLimit)
Set limit for fragments to be consumed on each poll of ingress.
|
int |
ingressStreamId()
Get the stream id for the ingress channel.
|
ConsensusModule.Context |
ingressStreamId(int streamId)
Set the stream id for the ingress channel.
|
long |
leaderHeartbeatIntervalNs()
Interval at which a leader will send heartbeats if the log is not progressing.
|
ConsensusModule.Context |
leaderHeartbeatIntervalNs(long heartbeatIntervalNs)
Interval at which a leader will send heartbeats if the log is not progressing.
|
long |
leaderHeartbeatTimeoutNs()
Timeout for a leader if no heartbeat is received by an other member.
|
ConsensusModule.Context |
leaderHeartbeatTimeoutNs(long heartbeatTimeoutNs)
Timeout for a leader if no heartbeat is received by an other member.
|
String |
logChannel()
Get the channel parameter for the cluster log channel.
|
ConsensusModule.Context |
logChannel(String channel)
Set the channel parameter for the cluster log channel.
|
int |
logFragmentLimit()
Get the fragment limit to be used when polling the log
Subscription. |
ConsensusModule.Context |
logFragmentLimit(int logFragmentLimit)
Set the fragment limit to be used when polling the log
Subscription. |
int |
logStreamId()
Get the stream id for the cluster log channel.
|
ConsensusModule.Context |
logStreamId(int streamId)
Set the stream id for the cluster log channel.
|
int |
maxConcurrentSessions()
Get the limit for the maximum number of concurrent cluster sessions.
|
ConsensusModule.Context |
maxConcurrentSessions(int maxSessions)
Set the limit for the maximum number of concurrent cluster sessions.
|
String |
memberEndpoints()
Get the endpoints for this cluster node.
|
ConsensusModule.Context |
memberEndpoints(String endpoints)
Set the endpoints for this cluster node.
|
Counter |
moduleStateCounter()
Get the counter for the current state of the consensus module.
|
ConsensusModule.Context |
moduleStateCounter(Counter moduleState)
Set the counter for the current state of the consensus module.
|
boolean |
ownsAeronClient()
Does this context own the
aeron() client and this takes responsibility for closing it? |
ConsensusModule.Context |
ownsAeronClient(boolean ownsAeronClient)
Does this context own the
aeron() client and this takes responsibility for closing it? |
Random |
random()
The source of random values for timeouts used in elections.
|
ConsensusModule.Context |
random(Random random)
The source of random values for timeouts used in elections.
|
RecordingLog |
recordingLog()
The
RecordingLog for the log terms and snapshots. |
ConsensusModule.Context |
recordingLog(RecordingLog recordingLog)
Set the
RecordingLog for the log terms and snapshots. |
String |
replayChannel()
Get the channel parameter for the cluster log and snapshot replay channel.
|
ConsensusModule.Context |
replayChannel(String channel)
Set the channel parameter for the cluster log and snapshot replay channel.
|
int |
replayStreamId()
Get the stream id for the cluster log and snapshot replay channel.
|
ConsensusModule.Context |
replayStreamId(int streamId)
Set the stream id for the cluster log and snapshot replay channel.
|
int |
serviceCount()
Get the number of clustered services in this cluster instance.
|
ConsensusModule.Context |
serviceCount(int serviceCount)
Set the number of clustered services in this cluster instance.
|
int |
serviceStreamId()
Get the stream id for communications from the consensus module and to the services.
|
ConsensusModule.Context |
serviceStreamId(int streamId)
Set the stream id for communications from the consensus module and to the services.
|
long |
sessionTimeoutNs()
Timeout for a session if no activity is observed.
|
ConsensusModule.Context |
sessionTimeoutNs(long sessionTimeoutNs)
Timeout for a session if no activity is observed.
|
ShutdownSignalBarrier |
shutdownSignalBarrier()
Get the
ShutdownSignalBarrier that can be used to shutdown a consensus module. |
ConsensusModule.Context |
shutdownSignalBarrier(ShutdownSignalBarrier barrier)
Set the
ShutdownSignalBarrier that can be used to shutdown a consensus module. |
String |
snapshotChannel()
Get the channel parameter for snapshot recordings.
|
ConsensusModule.Context |
snapshotChannel(String channel)
Set the channel parameter for snapshot recordings.
|
Counter |
snapshotCounter()
Get the counter for the count of snapshots taken.
|
ConsensusModule.Context |
snapshotCounter(Counter snapshotCounter)
Set the counter for the count of snapshots taken.
|
int |
snapshotStreamId()
Get the stream id for snapshot recordings.
|
ConsensusModule.Context |
snapshotStreamId(int streamId)
Set the stream id for snapshot recordings.
|
long |
startupCanvassTimeoutNs()
Timeout to wait for hearing the status of all cluster members on startup after recovery before commencing
an election if a majority of members has been heard from.
|
ConsensusModule.Context |
startupCanvassTimeoutNs(long timeoutNs)
Timeout to wait for hearing the status of all cluster members on startup after recovery before commencing
an election if a majority of members has been heard from.
|
Runnable |
terminationHook()
Get the
Runnable that is called when the ConsensusModule processes a termination action. |
ConsensusModule.Context |
terminationHook(Runnable terminationHook)
Set the
Runnable that is called when the ConsensusModule processes a termination action. |
long |
terminationTimeoutNs()
Timeout to wait for follower termination by leader.
|
ConsensusModule.Context |
terminationTimeoutNs(long terminationTimeoutNs)
Timeout to wait for follower termination by leader.
|
ThreadFactory |
threadFactory()
Get the thread factory used for creating threads.
|
ConsensusModule.Context |
threadFactory(ThreadFactory threadFactory)
Set the thread factory used for creating threads.
|
int |
ticksPerWheel()
Number of ticks, or spokes, on the timer wheel.
|
ConsensusModule.Context |
ticksPerWheel(int ticksPerWheel)
Number of ticks, or spokes, on the timer wheel.
|
Counter |
timedOutClientCounter()
Get the counter for the count of clients that have been timed out and disconnected.
|
ConsensusModule.Context |
timedOutClientCounter(Counter timedOutClientCounter)
Set the counter for the count of clients that have been timed out and disconnected.
|
long |
wheelTickResolutionNs()
Resolution in nanoseconds for each tick of the timer wheel for scheduling deadlines.
|
ConsensusModule.Context |
wheelTickResolutionNs(long wheelTickResolutionNs)
Resolution in nanoseconds for each tick of the timer wheel for scheduling deadlines.
|
public ConsensusModule.Context clone()
public void conclude()
public ConsensusModule.Context deleteDirOnStart(boolean deleteDirOnStart)
clusterDir() on startup.deleteDirOnStart - Attempt deletion.public boolean deleteDirOnStart()
clusterDir() on startup.public ConsensusModule.Context clusterDirectoryName(String clusterDirectoryName)
clusterDirectoryName - to use.ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic String clusterDirectoryName()
ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic ConsensusModule.Context clusterDir(File clusterDir)
clusterDir - to use.ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic File clusterDir()
ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic ConsensusModule.Context recordingLog(RecordingLog recordingLog)
RecordingLog for the log terms and snapshots.recordingLog - to use.public RecordingLog recordingLog()
RecordingLog for the log terms and snapshots.RecordingLog for the log terms and snapshots.public ConsensusModule.Context appVersion(int appVersion)
This can be validated using SemanticVersion to ensure only application nodes of the same
major version communicate with each other.
appVersion - for user application.public int appVersion()
This can be validated using SemanticVersion to ensure only application nodes of the same
major version communicate with each other.
public ConsensusModule.Context fileSyncLevel(int syncLevel)
syncLevel - to be applied for file writes.ConsensusModule.Configuration.FILE_SYNC_LEVEL_PROP_NAMEpublic ConsensusModule.Context clusterId(int clusterId)
clusterId - for this clustered instance.ClusteredServiceContainer.Configuration.CLUSTER_ID_PROP_NAMEpublic int clusterId()
ClusteredServiceContainer.Configuration.CLUSTER_ID_PROP_NAMEpublic ConsensusModule.Context clusterMemberId(int clusterMemberId)
clusterMemberId - for this member.ConsensusModule.Configuration.CLUSTER_MEMBER_ID_PROP_NAMEpublic int clusterMemberId()
ConsensusModule.Configuration.CLUSTER_MEMBER_ID_PROP_NAMEpublic ConsensusModule.Context appointedLeaderId(int appointedLeaderId)
-1 means no leader has been appointed and an automated leader election should occur.
appointedLeaderId - for the cluster.ConsensusModule.Configuration.APPOINTED_LEADER_ID_PROP_NAMEpublic int appointedLeaderId()
-1 means no leader has been appointed and an automated leader election should occur.
ConsensusModule.Configuration.APPOINTED_LEADER_ID_PROP_NAMEpublic ConsensusModule.Context clusterMembers(String clusterMembers)
0,ingress:port,consensus:port,log:port,catchup:port,archive:port| \
1,ingress:port,consensus:port,log:port,catchup:port,archive:port| ...
The ingress endpoints will be used as the endpoint substituted into the ingressChannel()
if the endpoint is not provided unless it is multicast.
clusterMembers - which are all candidates to be leader.ConsensusModule.Configuration.CLUSTER_MEMBERS_PROP_NAMEpublic String clusterMembers()
The ingress endpoints will be used as the endpoint in ingressChannel() if the endpoint is
not provided in that when it is not multicast.
ConsensusModule.Configuration.CLUSTER_MEMBERS_PROP_NAMEpublic ConsensusModule.Context clusterConsensusEndpoints(String endpoints)
"endpoint,endpoint,endpoint"
endpoints - which are to be contacted for joining the cluster.ConsensusModule.Configuration.CLUSTER_CONSENSUS_ENDPOINTS_PROP_NAMEpublic String clusterConsensusEndpoints()
ConsensusModule.Configuration.CLUSTER_CONSENSUS_ENDPOINTS_PROP_NAMEpublic ConsensusModule.Context clusterMembersIgnoreSnapshot(boolean ignore)
ignore - or not the cluster members in the snapshot.ConsensusModule.Configuration.CLUSTER_MEMBERS_IGNORE_SNAPSHOT_PROP_NAMEpublic boolean clusterMembersIgnoreSnapshot()
ConsensusModule.Configuration.CLUSTER_MEMBERS_IGNORE_SNAPSHOT_PROP_NAMEpublic ConsensusModule.Context ingressChannel(String channel)
channel - parameter for the ingress channel.AeronCluster.Configuration.INGRESS_CHANNEL_PROP_NAMEpublic String ingressChannel()
AeronCluster.Configuration.INGRESS_CHANNEL_PROP_NAMEpublic ConsensusModule.Context ingressStreamId(int streamId)
streamId - for the ingress channel.AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAMEpublic int ingressStreamId()
AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAMEpublic ConsensusModule.Context ingressFragmentLimit(int ingressFragmentLimit)
ingressFragmentLimit - for the ingress channel.ConsensusModule.Configuration.CLUSTER_INGRESS_FRAGMENT_LIMIT_PROP_NAMEpublic int ingressFragmentLimit()
ConsensusModule.Configuration.CLUSTER_INGRESS_FRAGMENT_LIMIT_PROP_NAMEpublic ConsensusModule.Context logChannel(String channel)
channel - parameter for the cluster log channel.ConsensusModule.Configuration.LOG_CHANNEL_PROP_NAMEpublic String logChannel()
ConsensusModule.Configuration.LOG_CHANNEL_PROP_NAMEpublic ConsensusModule.Context logStreamId(int streamId)
streamId - for the cluster log channel.ConsensusModule.Configuration.LOG_STREAM_ID_PROP_NAMEpublic int logStreamId()
ConsensusModule.Configuration.LOG_STREAM_ID_PROP_NAMEpublic ConsensusModule.Context memberEndpoints(String endpoints)
endpoints - for the cluster node.ConsensusModule.Configuration.MEMBER_ENDPOINTS_PROP_NAMEpublic String memberEndpoints()
ConsensusModule.Configuration.MEMBER_ENDPOINTS_PROP_NAMEpublic ConsensusModule.Context replayChannel(String channel)
channel - parameter for the cluster log replay channel.ClusteredServiceContainer.Configuration.REPLAY_CHANNEL_PROP_NAMEpublic String replayChannel()
ClusteredServiceContainer.Configuration.REPLAY_CHANNEL_PROP_NAMEpublic ConsensusModule.Context replayStreamId(int streamId)
streamId - for the cluster log replay channel.ClusteredServiceContainer.Configuration.REPLAY_STREAM_ID_PROP_NAMEpublic int replayStreamId()
ClusteredServiceContainer.Configuration.REPLAY_STREAM_ID_PROP_NAMEpublic ConsensusModule.Context controlChannel(String channel)
channel - parameter for bi-directional communications between the consensus module and services.ClusteredServiceContainer.Configuration.CONTROL_CHANNEL_PROP_NAMEpublic String controlChannel()
ClusteredServiceContainer.Configuration.CONTROL_CHANNEL_PROP_NAMEpublic ConsensusModule.Context serviceStreamId(int streamId)
streamId - for communications from the consensus module and to the services.ClusteredServiceContainer.Configuration.SERVICE_STREAM_ID_PROP_NAMEpublic int serviceStreamId()
ClusteredServiceContainer.Configuration.SERVICE_STREAM_ID_PROP_NAMEpublic ConsensusModule.Context consensusModuleStreamId(int streamId)
streamId - for communications from the services to the consensus module.ClusteredServiceContainer.Configuration.CONSENSUS_MODULE_STREAM_ID_PROP_NAMEpublic int consensusModuleStreamId()
ClusteredServiceContainer.Configuration.CONSENSUS_MODULE_STREAM_ID_PROP_NAMEpublic ConsensusModule.Context snapshotChannel(String channel)
channel - parameter for snapshot recordingsClusteredServiceContainer.Configuration.SNAPSHOT_CHANNEL_PROP_NAMEpublic String snapshotChannel()
ClusteredServiceContainer.Configuration.SNAPSHOT_CHANNEL_PROP_NAMEpublic ConsensusModule.Context snapshotStreamId(int streamId)
streamId - for snapshot recordings.ClusteredServiceContainer.Configuration.SNAPSHOT_STREAM_ID_PROP_NAMEpublic int snapshotStreamId()
ClusteredServiceContainer.Configuration.SNAPSHOT_STREAM_ID_PROP_NAMEpublic ConsensusModule.Context consensusChannel(String channel)
channel - parameter for the consensus communication channel.ConsensusModule.Configuration.CONSENSUS_CHANNEL_PROP_NAMEpublic String consensusChannel()
ConsensusModule.Configuration.CONSENSUS_CHANNEL_PROP_NAMEpublic ConsensusModule.Context consensusStreamId(int streamId)
streamId - for the consensus channel.ConsensusModule.Configuration.CONSENSUS_STREAM_ID_PROP_NAMEpublic int consensusStreamId()
ConsensusModule.Configuration.CONSENSUS_STREAM_ID_PROP_NAMEpublic ConsensusModule.Context logFragmentLimit(int logFragmentLimit)
Subscription.logFragmentLimit - for this clustered service.ClusteredServiceContainer.Configuration.LOG_FRAGMENT_LIMIT_DEFAULTpublic int logFragmentLimit()
Subscription.Subscription.ClusteredServiceContainer.Configuration.LOG_FRAGMENT_LIMIT_PROP_NAMEpublic ConsensusModule.Context wheelTickResolutionNs(long wheelTickResolutionNs)
wheelTickResolutionNs - the resolution in nanoseconds of each tick on the timer wheel.ConsensusModule.Configuration.WHEEL_TICK_RESOLUTION_PROP_NAMEpublic long wheelTickResolutionNs()
ConsensusModule.Configuration.WHEEL_TICK_RESOLUTION_PROP_NAMEpublic ConsensusModule.Context ticksPerWheel(int ticksPerWheel)
ticksPerWheel - the number of ticks on the timer wheel.ConsensusModule.Configuration.TICKS_PER_WHEEL_PROP_NAMEpublic int ticksPerWheel()
ConsensusModule.Configuration.TICKS_PER_WHEEL_PROP_NAMEpublic ConsensusModule.Context serviceCount(int serviceCount)
serviceCount - the number of clustered services in this cluster instance.ConsensusModule.Configuration.SERVICE_COUNT_PROP_NAME,
ClusteredServiceContainer.Configuration.SERVICE_ID_PROP_NAMEpublic int serviceCount()
ConsensusModule.Configuration.SERVICE_COUNT_PROP_NAME,
ClusteredServiceContainer.Configuration.SERVICE_ID_PROP_NAMEpublic ConsensusModule.Context maxConcurrentSessions(int maxSessions)
maxSessions - after which new sessions will be rejected.ConsensusModule.Configuration.MAX_CONCURRENT_SESSIONS_PROP_NAMEpublic int maxConcurrentSessions()
ConsensusModule.Configuration.MAX_CONCURRENT_SESSIONS_PROP_NAMEpublic ConsensusModule.Context sessionTimeoutNs(long sessionTimeoutNs)
sessionTimeoutNs - to wait for activity on a session.ConsensusModule.Configuration.SESSION_TIMEOUT_PROP_NAMEpublic long sessionTimeoutNs()
ConsensusModule.Configuration.SESSION_TIMEOUT_PROP_NAMEpublic ConsensusModule.Context leaderHeartbeatTimeoutNs(long heartbeatTimeoutNs)
heartbeatTimeoutNs - to wait for heartbeat from a leader.ConsensusModule.Configuration.LEADER_HEARTBEAT_TIMEOUT_PROP_NAMEpublic long leaderHeartbeatTimeoutNs()
ConsensusModule.Configuration.LEADER_HEARTBEAT_TIMEOUT_PROP_NAMEpublic ConsensusModule.Context leaderHeartbeatIntervalNs(long heartbeatIntervalNs)
heartbeatIntervalNs - between leader heartbeats.ConsensusModule.Configuration.LEADER_HEARTBEAT_INTERVAL_PROP_NAMEpublic long leaderHeartbeatIntervalNs()
ConsensusModule.Configuration.LEADER_HEARTBEAT_INTERVAL_PROP_NAMEpublic ConsensusModule.Context startupCanvassTimeoutNs(long timeoutNs)
timeoutNs - to wait on startup after recovery before commencing an election.ConsensusModule.Configuration.STARTUP_CANVASS_TIMEOUT_PROP_NAMEpublic long startupCanvassTimeoutNs()
ConsensusModule.Configuration.STARTUP_CANVASS_TIMEOUT_PROP_NAMEpublic ConsensusModule.Context electionTimeoutNs(long timeoutNs)
timeoutNs - to wait for votes in an elections.ConsensusModule.Configuration.ELECTION_TIMEOUT_PROP_NAMEpublic long electionTimeoutNs()
ConsensusModule.Configuration.ELECTION_TIMEOUT_PROP_NAMEpublic ConsensusModule.Context electionStatusIntervalNs(long electionStatusIntervalNs)
electionStatusIntervalNs - between status message updates.ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_PROP_NAME,
ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_DEFAULT_NSpublic long electionStatusIntervalNs()
ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_PROP_NAME,
ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_DEFAULT_NSpublic ConsensusModule.Context dynamicJoinIntervalNs(long dynamicJoinIntervalNs)
dynamicJoinIntervalNs - between add cluster members and snapshot recording queries.ConsensusModule.Configuration.DYNAMIC_JOIN_INTERVAL_PROP_NAME,
ConsensusModule.Configuration.DYNAMIC_JOIN_INTERVAL_DEFAULT_NSpublic long dynamicJoinIntervalNs()
ConsensusModule.Configuration.DYNAMIC_JOIN_INTERVAL_PROP_NAME,
ConsensusModule.Configuration.DYNAMIC_JOIN_INTERVAL_DEFAULT_NSpublic ConsensusModule.Context terminationTimeoutNs(long terminationTimeoutNs)
terminationTimeoutNs - to wait for follower termination.ConsensusModule.Configuration.TERMINATION_TIMEOUT_PROP_NAME,
ConsensusModule.Configuration.TERMINATION_TIMEOUT_DEFAULT_NSpublic long terminationTimeoutNs()
ConsensusModule.Configuration.TERMINATION_TIMEOUT_PROP_NAME,
ConsensusModule.Configuration.TERMINATION_TIMEOUT_DEFAULT_NSpublic ThreadFactory threadFactory()
public ConsensusModule.Context threadFactory(ThreadFactory threadFactory)
threadFactory - used for creating threadspublic ConsensusModule.Context idleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier)
IdleStrategy supplier for the idle strategy for the agent duty cycle.idleStrategySupplier - supplier for the idle strategy for the agent duty cycle.public IdleStrategy idleStrategy()
IdleStrategy based on configured supplier.IdleStrategy based on configured supplier.public ConsensusModule.Context clusterClock(ClusterClock clock)
ClusterClock to be used for timestamping messages and timers.clock - ClusterClock to be used for timestamping messages and timers.public ClusterClock clusterClock()
ClusterClock to used for timestamping messages and timers.ClusterClock to used for timestamping messages and timers.public ConsensusModule.Context epochClock(EpochClock clock)
EpochClock to be used for tracking wall clock time.clock - EpochClock to be used for tracking wall clock time.public EpochClock epochClock()
EpochClock to used for tracking wall clock time.EpochClock to used for tracking wall clock time.public ErrorHandler errorHandler()
ErrorHandler to be used by the Consensus Module.ErrorHandler to be used by the Consensus Module.public ConsensusModule.Context errorHandler(ErrorHandler errorHandler)
ErrorHandler to be used by the Consensus Module.errorHandler - the error handler to be used by the Consensus Module.public ConsensusModule.Context countedErrorHandler(CountedErrorHandler countedErrorHandler)
errorHandler() that will increment errorCounter() by default.countedErrorHandler - to override the default.public CountedErrorHandler countedErrorHandler()
errorHandler() that will increment errorCounter() by default.errorHandler() that will increment errorCounter() by default.public AtomicCounter errorCounter()
public ConsensusModule.Context errorCounter(AtomicCounter errorCounter)
errorCounter - the error counter that will record the number of errors observed.public Counter moduleStateCounter()
ConsensusModule.Statepublic ConsensusModule.Context moduleStateCounter(Counter moduleState)
moduleState - the counter for the current state of the consensus module.ConsensusModule.Statepublic Counter electionStateCounter()
ElectionStatepublic ConsensusModule.Context electionStateCounter(Counter electionStateCounter)
electionStateCounter - for the current state of an election.ElectionStatepublic Counter commitPositionCounter()
public ConsensusModule.Context commitPositionCounter(Counter commitPosition)
commitPosition - counter for the commit position the cluster has reached for consensus.public Counter clusterNodeRoleCounter()
Cluster.Role of the
consensus module node.Cluster.Role of the
cluster node.Cluster.Rolepublic ConsensusModule.Context clusterNodeRoleCounter(Counter nodeRole)
Cluster.Role of the
cluster node.nodeRole - the counter for representing the current Cluster.Role
of the cluster node.Cluster.Rolepublic Counter controlToggleCounter()
ClusterControlpublic ConsensusModule.Context controlToggleCounter(Counter controlToggle)
controlToggle - the counter for triggering cluster node actions.ClusterControlpublic Counter snapshotCounter()
public ConsensusModule.Context snapshotCounter(Counter snapshotCounter)
snapshotCounter - the count of snapshots taken.public Counter timedOutClientCounter()
public ConsensusModule.Context timedOutClientCounter(Counter timedOutClientCounter)
timedOutClientCounter - the count of clients that have been timed out and disconnected.public ConsensusModule.Context aeron(Aeron aeron)
Aeron client for communicating with the local Media Driver.
This client will be closed when the ConsensusModule.close() or close() methods are called
if ownsAeronClient() is true.
aeron - client for communicating with the local Media Driver.Aeron.connect()public Aeron aeron()
Aeron client for communicating with the local Media Driver.
If not provided then a default will be established during conclude() by calling
Aeron.connect().
public ConsensusModule.Context aeronDirectoryName(String aeronDirectoryName)
aeronDirectoryName - the top level Aeron directory.public String aeronDirectoryName()
public ConsensusModule.Context ownsAeronClient(boolean ownsAeronClient)
aeron() client and this takes responsibility for closing it?ownsAeronClient - does this context own the aeron() client.public boolean ownsAeronClient()
aeron() client and this takes responsibility for closing it?aeron() client and this takes responsibility for closing it?public ConsensusModule.Context archiveContext(AeronArchive.Context archiveContext)
AeronArchive.Context that should be used for communicating with the
local Archive.archiveContext - that should be used for communicating with the local Archive.public AeronArchive.Context archiveContext()
AeronArchive.Context that should be used for communicating with
the local Archive.AeronArchive.Context that should be used for communicating
with the local Archive.public AuthenticatorSupplier authenticatorSupplier()
AuthenticatorSupplier that should be used for the consensus module.AuthenticatorSupplier to be used for the consensus module.public ConsensusModule.Context authenticatorSupplier(AuthenticatorSupplier authenticatorSupplier)
AuthenticatorSupplier that will be used for the consensus module.authenticatorSupplier - AuthenticatorSupplier to use for the consensus module.public ConsensusModule.Context shutdownSignalBarrier(ShutdownSignalBarrier barrier)
ShutdownSignalBarrier that can be used to shutdown a consensus module.barrier - that can be used to shutdown a consensus module.public ShutdownSignalBarrier shutdownSignalBarrier()
ShutdownSignalBarrier that can be used to shutdown a consensus module.ShutdownSignalBarrier that can be used to shutdown a consensus module.public ConsensusModule.Context terminationHook(Runnable terminationHook)
Runnable that is called when the ConsensusModule processes a termination action.terminationHook - that can be used to terminate a consensus module.public Runnable terminationHook()
Runnable that is called when the ConsensusModule processes a termination action.
The default action is to call signal on the shutdownSignalBarrier().
Runnable that can be used to terminate a consensus module.public ConsensusModule.Context clusterMarkFile(ClusterMarkFile markFile)
ClusterMarkFile in use.markFile - to use.public ClusterMarkFile clusterMarkFile()
ClusterMarkFile in use.ClusterMarkFile in use.public ConsensusModule.Context errorBufferLength(int errorBufferLength)
errorBufferLength - in bytes to use.ConsensusModule.Configuration.ERROR_BUFFER_LENGTH_PROP_NAMEpublic int errorBufferLength()
ConsensusModule.Configuration.ERROR_BUFFER_LENGTH_PROP_NAMEpublic ConsensusModule.Context errorLog(DistinctErrorLog errorLog)
DistinctErrorLog in use.errorLog - to use.public DistinctErrorLog errorLog()
DistinctErrorLog in use.DistinctErrorLog in use.public ConsensusModule.Context random(Random random)
random - source of random values for timeouts used in elections.public Random random()
public void deleteDirectory()
public void close()
If ownsAeronClient() is true then the aeron() client will be closed.
Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.