public static 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. |
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.
|
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.
|
String |
clusterMembersStatusEndpoints()
The endpoints representing cluster members of the cluster to attempt to contact to join the cluster.
|
ConsensusModule.Context |
clusterMembersStatusEndpoints(String endpoints)
String representing the cluster members member status endpoints used to request to join the cluster.
|
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() |
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.
|
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)
Non-default for context.
|
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.
|
Counter |
invalidRequestCounter()
Get the counter for the count of invalid client requests.
|
ConsensusModule.Context |
invalidRequestCounter(Counter invalidRequestCounter)
Set the counter for the count of invalid client requests.
|
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 |
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.
|
String |
memberStatusChannel()
Get the channel parameter for the member status communication channel.
|
ConsensusModule.Context |
memberStatusChannel(String channel)
Set the channel parameter for the member status communication channel.
|
int |
memberStatusStreamId()
Get the stream id for the member status channel.
|
ConsensusModule.Context |
memberStatusStreamId(int streamId)
Set the stream id for the member status channel.
|
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.
|
String |
serviceControlChannel()
Get the channel parameter for bi-directional communications between the consensus module and services.
|
ConsensusModule.Context |
serviceControlChannel(String channel)
Set the channel parameter for bi-directional communications between the consensus module and services.
|
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.
|
MutableDirectBuffer |
tempBuffer()
The temporary buffer than can be used to build up counter labels to avoid allocation.
|
ConsensusModule.Context |
tempBuffer(MutableDirectBuffer tempBuffer)
Set the temporary buffer than can be used to build up counter labels to avoid allocation.
|
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 MutableDirectBuffer tempBuffer()
public ConsensusModule.Context tempBuffer(MutableDirectBuffer tempBuffer)
tempBuffer
- to be used to avoid allocation.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_NAME
public String clusterDirectoryName()
ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAME
public ConsensusModule.Context clusterDir(File clusterDir)
clusterDir
- to use.ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAME
public File clusterDir()
ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAME
public 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_NAME
public ConsensusModule.Context clusterMemberId(int clusterMemberId)
clusterMemberId
- for this member.ConsensusModule.Configuration.CLUSTER_MEMBER_ID_PROP_NAME
public int clusterMemberId()
ConsensusModule.Configuration.CLUSTER_MEMBER_ID_PROP_NAME
public 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_NAME
public int appointedLeaderId()
-1 means no leader has been appointed and an automated leader election should occur.
ConsensusModule.Configuration.APPOINTED_LEADER_ID_PROP_NAME
public ConsensusModule.Context clusterMembers(String clusterMembers)
0,client-facing:port,member-facing:port,log:port,transfer:port,archive:port| \
1,client-facing:port,member-facing:port,log:port,transfer:port,archive:port| ...
The client facing 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_NAME
public String clusterMembers()
The client facing 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_NAME
public ConsensusModule.Context clusterMembersStatusEndpoints(String endpoints)
"endpoint,endpoint,endpoint"
endpoints
- which are to be contacted for joining the cluster.ConsensusModule.Configuration.CLUSTER_MEMBERS_STATUS_ENDPOINTS_PROP_NAME
public String clusterMembersStatusEndpoints()
ConsensusModule.Configuration.CLUSTER_MEMBERS_STATUS_ENDPOINTS_PROP_NAME
public ConsensusModule.Context clusterMembersIgnoreSnapshot(boolean ignore)
ignore
- or not the cluster members in the snapshot.ConsensusModule.Configuration.CLUSTER_MEMBERS_IGNORE_SNAPSHOT_PROP_NAME
public boolean clusterMembersIgnoreSnapshot()
ConsensusModule.Configuration.CLUSTER_MEMBERS_IGNORE_SNAPSHOT_PROP_NAME
public ConsensusModule.Context ingressChannel(String channel)
channel
- parameter for the ingress channel.AeronCluster.Configuration.INGRESS_CHANNEL_PROP_NAME
public String ingressChannel()
AeronCluster.Configuration.INGRESS_CHANNEL_PROP_NAME
public ConsensusModule.Context ingressStreamId(int streamId)
streamId
- for the ingress channel.AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAME
public int ingressStreamId()
AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAME
public ConsensusModule.Context ingressFragmentLimit(int ingressFragmentLimit)
ingressFragmentLimit
- for the ingress channel.ConsensusModule.Configuration.CLUSTER_INGRESS_FRAGMENT_LIMIT_PROP_NAME
public int ingressFragmentLimit()
ConsensusModule.Configuration.CLUSTER_INGRESS_FRAGMENT_LIMIT_PROP_NAME
public ConsensusModule.Context logChannel(String channel)
channel
- parameter for the cluster log channel.ConsensusModule.Configuration.LOG_CHANNEL_PROP_NAME
public String logChannel()
ConsensusModule.Configuration.LOG_CHANNEL_PROP_NAME
public ConsensusModule.Context logStreamId(int streamId)
streamId
- for the cluster log channel.ConsensusModule.Configuration.LOG_STREAM_ID_PROP_NAME
public int logStreamId()
ConsensusModule.Configuration.LOG_STREAM_ID_PROP_NAME
public ConsensusModule.Context memberEndpoints(String endpoints)
endpoints
- for the cluster node.ConsensusModule.Configuration.MEMBER_ENDPOINTS_PROP_NAME
public String memberEndpoints()
ConsensusModule.Configuration.MEMBER_ENDPOINTS_PROP_NAME
public ConsensusModule.Context replayChannel(String channel)
channel
- parameter for the cluster log replay channel.ClusteredServiceContainer.Configuration.REPLAY_CHANNEL_PROP_NAME
public String replayChannel()
ClusteredServiceContainer.Configuration.REPLAY_CHANNEL_PROP_NAME
public ConsensusModule.Context replayStreamId(int streamId)
streamId
- for the cluster log replay channel.ClusteredServiceContainer.Configuration.REPLAY_STREAM_ID_PROP_NAME
public int replayStreamId()
ClusteredServiceContainer.Configuration.REPLAY_STREAM_ID_PROP_NAME
public ConsensusModule.Context serviceControlChannel(String channel)
channel
- parameter for bi-directional communications between the consensus module and services.ClusteredServiceContainer.Configuration.SERVICE_CONTROL_CHANNEL_PROP_NAME
public String serviceControlChannel()
ClusteredServiceContainer.Configuration.SERVICE_CONTROL_CHANNEL_PROP_NAME
public ConsensusModule.Context serviceStreamId(int streamId)
streamId
- for communications from the consensus module and to the services.ClusteredServiceContainer.Configuration.SERVICE_STREAM_ID_PROP_NAME
public int serviceStreamId()
ClusteredServiceContainer.Configuration.SERVICE_STREAM_ID_PROP_NAME
public ConsensusModule.Context consensusModuleStreamId(int streamId)
streamId
- for communications from the services to the consensus module.ClusteredServiceContainer.Configuration.CONSENSUS_MODULE_STREAM_ID_PROP_NAME
public int consensusModuleStreamId()
ClusteredServiceContainer.Configuration.CONSENSUS_MODULE_STREAM_ID_PROP_NAME
public ConsensusModule.Context snapshotChannel(String channel)
channel
- parameter for snapshot recordingsClusteredServiceContainer.Configuration.SNAPSHOT_CHANNEL_PROP_NAME
public String snapshotChannel()
ClusteredServiceContainer.Configuration.SNAPSHOT_CHANNEL_PROP_NAME
public ConsensusModule.Context snapshotStreamId(int streamId)
streamId
- for snapshot recordings.ClusteredServiceContainer.Configuration.SNAPSHOT_STREAM_ID_PROP_NAME
public int snapshotStreamId()
ClusteredServiceContainer.Configuration.SNAPSHOT_STREAM_ID_PROP_NAME
public ConsensusModule.Context memberStatusChannel(String channel)
channel
- parameter for the member status communication channel.ConsensusModule.Configuration.MEMBER_STATUS_CHANNEL_PROP_NAME
public String memberStatusChannel()
ConsensusModule.Configuration.MEMBER_STATUS_CHANNEL_PROP_NAME
public ConsensusModule.Context memberStatusStreamId(int streamId)
streamId
- for the ingress channel.ConsensusModule.Configuration.MEMBER_STATUS_STREAM_ID_PROP_NAME
public int memberStatusStreamId()
ConsensusModule.Configuration.MEMBER_STATUS_STREAM_ID_PROP_NAME
public ConsensusModule.Context wheelTickResolutionNs(long wheelTickResolutionNs)
wheelTickResolutionNs
- the resolution in nanoseconds of each tick on the timer wheel.ConsensusModule.Configuration.WHEEL_TICK_RESOLUTION_PROP_NAME
public long wheelTickResolutionNs()
ConsensusModule.Configuration.WHEEL_TICK_RESOLUTION_PROP_NAME
public ConsensusModule.Context ticksPerWheel(int ticksPerWheel)
ticksPerWheel
- the number of ticks on the timer wheel.ConsensusModule.Configuration.TICKS_PER_WHEEL_PROP_NAME
public int ticksPerWheel()
ConsensusModule.Configuration.TICKS_PER_WHEEL_PROP_NAME
public 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_NAME
public int serviceCount()
ConsensusModule.Configuration.SERVICE_COUNT_PROP_NAME
,
ClusteredServiceContainer.Configuration.SERVICE_ID_PROP_NAME
public ConsensusModule.Context maxConcurrentSessions(int maxSessions)
maxSessions
- after which new sessions will be rejected.ConsensusModule.Configuration.MAX_CONCURRENT_SESSIONS_PROP_NAME
public int maxConcurrentSessions()
ConsensusModule.Configuration.MAX_CONCURRENT_SESSIONS_PROP_NAME
public ConsensusModule.Context sessionTimeoutNs(long sessionTimeoutNs)
sessionTimeoutNs
- to wait for activity on a session.ConsensusModule.Configuration.SESSION_TIMEOUT_PROP_NAME
public long sessionTimeoutNs()
ConsensusModule.Configuration.SESSION_TIMEOUT_PROP_NAME
public ConsensusModule.Context leaderHeartbeatTimeoutNs(long heartbeatTimeoutNs)
heartbeatTimeoutNs
- to wait for heartbeat from a leader.ConsensusModule.Configuration.LEADER_HEARTBEAT_TIMEOUT_PROP_NAME
public long leaderHeartbeatTimeoutNs()
ConsensusModule.Configuration.LEADER_HEARTBEAT_TIMEOUT_PROP_NAME
public ConsensusModule.Context leaderHeartbeatIntervalNs(long heartbeatIntervalNs)
heartbeatIntervalNs
- between leader heartbeats.ConsensusModule.Configuration.LEADER_HEARTBEAT_INTERVAL_PROP_NAME
public long leaderHeartbeatIntervalNs()
ConsensusModule.Configuration.LEADER_HEARTBEAT_INTERVAL_PROP_NAME
public ConsensusModule.Context startupCanvassTimeoutNs(long timeoutNs)
timeoutNs
- to wait on startup after recovery before commencing an election.ConsensusModule.Configuration.STARTUP_CANVASS_TIMEOUT_PROP_NAME
public long startupCanvassTimeoutNs()
ConsensusModule.Configuration.STARTUP_CANVASS_TIMEOUT_PROP_NAME
public ConsensusModule.Context electionTimeoutNs(long timeoutNs)
timeoutNs
- to wait for votes in an elections.ConsensusModule.Configuration.ELECTION_TIMEOUT_PROP_NAME
public long electionTimeoutNs()
ConsensusModule.Configuration.ELECTION_TIMEOUT_PROP_NAME
public ConsensusModule.Context electionStatusIntervalNs(long electionStatusIntervalNs)
electionStatusIntervalNs
- between status message updates.ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_PROP_NAME
,
ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_DEFAULT_NS
public long electionStatusIntervalNs()
ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_PROP_NAME
,
ConsensusModule.Configuration.ELECTION_STATUS_INTERVAL_DEFAULT_NS
public 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_NS
public long dynamicJoinIntervalNs()
ConsensusModule.Configuration.DYNAMIC_JOIN_INTERVAL_PROP_NAME
,
ConsensusModule.Configuration.DYNAMIC_JOIN_INTERVAL_DEFAULT_NS
public ConsensusModule.Context terminationTimeoutNs(long terminationTimeoutNs)
terminationTimeoutNs
- to wait for follower termination.ConsensusModule.Configuration.TERMINATION_TIMEOUT_PROP_NAME
,
ConsensusModule.Configuration.TERMINATION_TIMEOUT_DEFAULT_NS
public long terminationTimeoutNs()
ConsensusModule.Configuration.TERMINATION_TIMEOUT_PROP_NAME
,
ConsensusModule.Configuration.TERMINATION_TIMEOUT_DEFAULT_NS
public 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 AtomicCounter errorCounter()
public ConsensusModule.Context errorCounter(AtomicCounter errorCounter)
errorCounter
- the error counter that will record the number of errors observed.public ConsensusModule.Context countedErrorHandler(CountedErrorHandler countedErrorHandler)
countedErrorHandler
- to override the default.public CountedErrorHandler countedErrorHandler()
errorHandler()
that will increment errorCounter()
by default.errorHandler()
that will increment errorCounter()
by default.public Counter electionStateCounter()
Election.State
public ConsensusModule.Context electionStateCounter(Counter electionStateCounter)
electionStateCounter
- for the current state of an election.Election.State
public Counter moduleStateCounter()
ConsensusModule.State
public ConsensusModule.Context moduleStateCounter(Counter moduleState)
moduleState
- the counter for the current state of the consensus module.ConsensusModule.State
public Counter commitPositionCounter()
CommitPos
public ConsensusModule.Context commitPositionCounter(Counter commitPosition)
commitPosition
- counter for the commit position the cluster has reached for consensus.CommitPos
public Counter clusterNodeRoleCounter()
Cluster.Role
of the
consensus module node.Cluster.Role
of the
cluster node.Cluster.Role
public 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.Role
public Counter controlToggleCounter()
ClusterControl
public ConsensusModule.Context controlToggleCounter(Counter controlToggle)
controlToggle
- the counter for triggering cluster node actions.ClusterControl
public Counter snapshotCounter()
public ConsensusModule.Context snapshotCounter(Counter snapshotCounter)
snapshotCounter
- the count of snapshots taken.public Counter invalidRequestCounter()
public ConsensusModule.Context invalidRequestCounter(Counter invalidRequestCounter)
invalidRequestCounter
- the count of invalid client requests.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_NAME
public int errorBufferLength()
ConsensusModule.Configuration.ERROR_BUFFER_LENGTH_PROP_NAME
public 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.