public static class ClusterBackup.Context extends Object implements Cloneable
ClusterBackup.| Constructor and Description |
|---|
Context() |
| Modifier and Type | Method and Description |
|---|---|
Aeron |
aeron()
Aeron client for communicating with the local Media Driver. |
ClusterBackup.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.
|
ClusterBackup.Context |
aeronDirectoryName(String aeronDirectoryName)
Set the top level Aeron directory used for communication between the Aeron client and Media Driver.
|
AeronArchive.Context |
archiveContext()
Get the
AeronArchive.Context used for communicating with the local Archive. |
ClusterBackup.Context |
archiveContext(AeronArchive.Context archiveContext)
Set the
AeronArchive.Context used for communicating with the local Archive. |
String |
catchupChannel()
Get the catchup channel template to use for log and snapshot retrieval.
|
ClusterBackup.Context |
catchupChannel(String catchupChannel)
Set the catchup channel template to use for log and snapshot retrieval.
|
String |
catchupEndpoint()
Get the catchup endpoint to use for log retrieval.
|
ClusterBackup.Context |
catchupEndpoint(String catchupEndpoint)
Set the endpoint that will be subscribed to in order to receive logs and snapshots.
|
ClusterBackup.Context |
clone()
Perform a shallow copy of the object.
|
void |
close()
Close the context and free applicable resources.
|
AeronArchive.Context |
clusterArchiveContext()
Get the
AeronArchive.Context used for communicating with the remote Archive
in the cluster being backed up. |
ClusterBackup.Context |
clusterArchiveContext(AeronArchive.Context archiveContext)
Set the
AeronArchive.Context used for communicating with the remote Archive
in the cluster being backed up. |
long |
clusterBackupCoolDownIntervalNs()
Interval at which the cluster backup is re-initialised after an exception has been thrown.
|
ClusterBackup.Context |
clusterBackupCoolDownIntervalNs(long clusterBackupCoolDownIntervalNs)
Interval at which the cluster backup is re-initialised after an exception has been thrown.
|
long |
clusterBackupIntervalNs()
Interval at which a cluster backup will send backup queries.
|
ClusterBackup.Context |
clusterBackupIntervalNs(long clusterBackupIntervalNs)
Interval at which a cluster backup will send backup queries.
|
long |
clusterBackupProgressTimeoutNs()
Timeout within which a cluster backup will expect progress.
|
ClusterBackup.Context |
clusterBackupProgressTimeoutNs(long clusterBackupProgressTimeoutNs)
Timeout within which a cluster backup will expect progress.
|
long |
clusterBackupResponseTimeoutNs()
Timeout within which a cluster backup will expect a response from a backup query.
|
ClusterBackup.Context |
clusterBackupResponseTimeoutNs(long clusterBackupResponseTimeoutNs)
Timeout within which a cluster backup will expect a response from a backup query.
|
String |
clusterConsensusEndpoints()
The endpoints representing cluster members of the cluster to attempt to a backup from.
|
ClusterBackup.Context |
clusterConsensusEndpoints(String endpoints)
String representing the cluster members consensus endpoints.
|
File |
clusterDir()
The directory used for the cluster directory.
|
ClusterBackup.Context |
clusterDir(File clusterDir)
Set the directory to use for the cluster directory.
|
String |
clusterDirectoryName()
The directory name to use for the cluster directory.
|
ClusterBackup.Context |
clusterDirectoryName(String clusterDirectoryName)
Set the directory name to use for the cluster directory.
|
int |
clusterId()
Get the id for this cluster instance.
|
ClusterBackup.Context |
clusterId(int clusterId)
Set the id for this cluster instance.
|
ClusterMarkFile |
clusterMarkFile()
The
ClusterMarkFile in use. |
ClusterBackup.Context |
clusterMarkFile(ClusterMarkFile markFile)
Set the
ClusterMarkFile in use. |
void |
conclude()
Conclude configuration by setting up defaults when specifics are not provided.
|
String |
consensusChannel()
Get the channel parameter for the consensus communication channel.
|
ClusterBackup.Context |
consensusChannel(String channel)
Set the channel parameter for the consensus communication channel.
|
int |
consensusModuleSnapshotStreamId()
Get the stream id for the consensus module snapshot replay channel.
|
ClusterBackup.Context |
consensusModuleSnapshotStreamId(int streamId)
Set the stream id for the consensus module snapshot replay.
|
int |
consensusStreamId()
Get the stream id for the consensus channel.
|
ClusterBackup.Context |
consensusStreamId(int streamId)
Set the stream id for the consensus channel.
|
CountedErrorHandler |
countedErrorHandler()
The
errorHandler() that will increment errorCounter() by default. |
ClusterBackup.Context |
countedErrorHandler(CountedErrorHandler countedErrorHandler)
Non-default for context.
|
CredentialsSupplier |
credentialsSupplier()
Get the
CredentialsSupplier to be used for authentication with the cluster. |
ClusterBackup.Context |
credentialsSupplier(CredentialsSupplier credentialsSupplier)
Set the
CredentialsSupplier to be used for authentication with the cluster. |
void |
deleteDirectory()
Delete the cluster directory.
|
boolean |
deleteDirOnStart()
Will the consensus module attempt to immediately delete
clusterDir() on startup. |
ClusterBackup.Context |
deleteDirOnStart(boolean deleteDirOnStart)
Should the consensus module attempt to immediately delete
clusterDir() on startup. |
EpochClock |
epochClock()
Get the
EpochClock to used for tracking wall clock time. |
ClusterBackup.Context |
epochClock(EpochClock clock)
Set the
EpochClock to be used for tracking wall clock time. |
int |
errorBufferLength()
The error buffer length in bytes.
|
ClusterBackup.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.
|
ClusterBackup.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. |
ClusterBackup.Context |
errorHandler(ErrorHandler errorHandler)
Set the
ErrorHandler to be used by the Cluster Backup. |
DistinctErrorLog |
errorLog()
The
DistinctErrorLog in use. |
ClusterBackup.Context |
errorLog(DistinctErrorLog errorLog)
Set the
DistinctErrorLog in use. |
ClusterBackupEventsListener |
eventsListener()
Get the
ClusterBackupEventsListener in use for the backup agent. |
ClusterBackup.Context |
eventsListener(ClusterBackupEventsListener eventsListener)
Set the
ClusterBackupEventsListener to use for the backup agent. |
IdleStrategy |
idleStrategy()
Get a new
IdleStrategy based on configured supplier. |
ClusterBackup.Context |
idleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier)
Provides an
IdleStrategy supplier for the idle strategy for the agent duty cycle. |
Counter |
liveLogPositionCounter()
Get the counter for the current position of the live log.
|
ClusterBackup.Context |
liveLogPositionCounter(Counter liveLogPositionCounter)
Set the counter for the current position of the live log.
|
int |
logStreamId()
Get the stream id for the cluster log channel.
|
ClusterBackup.Context |
logStreamId(int streamId)
Set the stream id for the cluster log channel.
|
File |
markFileDir()
Get the directory in which the ClusterBackup will store mark file (i.e.
|
ClusterBackup.Context |
markFileDir(File markFileDir)
Set the directory in which the ClusterBackup will store mark file (i.e.
|
Counter |
nextQueryDeadlineMsCounter()
Get the counter for the next query deadline ms.
|
ClusterBackup.Context |
nextQueryDeadlineMsCounter(Counter nextQueryDeadlineMsCounter)
Set the counter for the next query deadline ms.
|
boolean |
ownsAeronClient()
Does this context own the
aeron() client and this takes responsibility for closing it? |
ClusterBackup.Context |
ownsAeronClient(boolean ownsAeronClient)
Does this context own the
aeron() client and this takes responsibility for closing it? |
long |
replicationProgressIntervalNs()
Interval between checks for replication progress.
|
ClusterBackup.Context |
replicationProgressIntervalNs(long intervalNs)
Interval between checks for replication progress.
|
long |
replicationProgressTimeoutNs()
Timeout when no progress it detected when performing an archive replication (typically for snapshots).
|
ClusterBackup.Context |
replicationProgressTimeoutNs(long timeoutNs)
Timeout when no progress it detected when performing an archive replication (typically for snapshots).
|
int |
serviceSnapshotStreamId()
Get the stream id for the clustered service snapshot replay channel.
|
ClusterBackup.Context |
serviceSnapshotStreamId(int streamId)
Set the stream id for the clustered service snapshot replay.
|
ShutdownSignalBarrier |
shutdownSignalBarrier()
Get the
ShutdownSignalBarrier that can be used to shut down. |
ClusterBackup.Context |
shutdownSignalBarrier(ShutdownSignalBarrier barrier)
Set the
ShutdownSignalBarrier that can be used to shut down a consensus module. |
ClusterBackup.SourceType |
sourceType()
Get the currently configured source type
|
ClusterBackup.Context |
sourceType(ClusterBackup.SourceType sourceType)
Set the
ClusterBackup.SourceType to be used for this backup instance. |
Counter |
stateCounter()
Get the counter for the current state of the cluster backup.
|
ClusterBackup.Context |
stateCounter(Counter stateCounter)
Set the counter for the current state of the cluster backup.
|
Runnable |
terminationHook()
Get the
Runnable that is called when the ClusterBackup processes a termination action. |
ClusterBackup.Context |
terminationHook(Runnable terminationHook)
Set the
Runnable that is called when the ClusterBackup processes a termination action. |
ThreadFactory |
threadFactory()
Get the thread factory used for creating threads.
|
ClusterBackup.Context |
threadFactory(ThreadFactory threadFactory)
Set the thread factory used for creating threads.
|
String |
toString() |
boolean |
useAgentInvoker()
Should an
AgentInvoker be used for running the ClusterBackup rather than run it on
a thread with a AgentRunner. |
ClusterBackup.Context |
useAgentInvoker(boolean useAgentInvoker)
Should an
AgentInvoker be used for running the ClusterBackup rather than run it on
a thread with a AgentRunner. |
public ClusterBackup.Context clone()
public void conclude()
public ClusterBackup.Context aeron(Aeron aeron)
Aeron client for communicating with the local Media Driver.
This client will be closed when the ClusterBackup.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 ClusterBackup.Context aeronDirectoryName(String aeronDirectoryName)
aeronDirectoryName - the top level Aeron directory.public String aeronDirectoryName()
public ClusterBackup.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 ClusterBackup.Context deleteDirOnStart(boolean deleteDirOnStart)
clusterDir() on startup.deleteDirOnStart - Attempt deletion.public boolean deleteDirOnStart()
clusterDir() on startup.public ClusterBackup.Context clusterId(int clusterId)
clusterId - for this clustered instance.ClusteredServiceContainer.Configuration.CLUSTER_ID_PROP_NAMEpublic int clusterId()
ClusteredServiceContainer.Configuration.CLUSTER_ID_PROP_NAMEpublic ClusterBackup.Context clusterDirectoryName(String clusterDirectoryName)
clusterDirectoryName - to use.ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic String clusterDirectoryName()
ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic ClusterBackup.Context clusterDir(File clusterDir)
clusterDir - to use.ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic File clusterDir()
ClusteredServiceContainer.Configuration.CLUSTER_DIR_PROP_NAMEpublic File markFileDir()
cluster-mark.dat). It
defaults to clusterDir() if it is not set explicitly via the
ClusteredServiceContainer.Configuration.MARK_FILE_DIR_PROP_NAME.cluster-mark.dat).ClusteredServiceContainer.Configuration.MARK_FILE_DIR_PROP_NAME,
clusterDir()public ClusterBackup.Context markFileDir(File markFileDir)
cluster-mark.dat).markFileDir - the directory in which the ClusterBackup will store mark file (i.e. cluster-mark.dat).public ClusterBackup.Context archiveContext(AeronArchive.Context archiveContext)
AeronArchive.Context used for communicating with the local Archive.archiveContext - used for communicating with the local Archive.public AeronArchive.Context archiveContext()
AeronArchive.Context used for communicating with the local Archive.AeronArchive.Context used for communicating with the local
Archive.public ClusterBackup.Context clusterArchiveContext(AeronArchive.Context archiveContext)
AeronArchive.Context used for communicating with the remote Archive
in the cluster being backed up.archiveContext - used for communicating with the remote Archive in the cluster being backed up.public AeronArchive.Context clusterArchiveContext()
AeronArchive.Context used for communicating with the remote Archive
in the cluster being backed up.AeronArchive.Context used for communicating the remote Archive
in the cluster being backed up.public ThreadFactory threadFactory()
public ClusterBackup.Context threadFactory(ThreadFactory threadFactory)
threadFactory - used for creating threadspublic ClusterBackup.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 ClusterBackup.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 ClusterBackup.Context errorHandler(ErrorHandler errorHandler)
ErrorHandler to be used by the Cluster Backup.errorHandler - the error handler to be used by the Cluster Backup.public AtomicCounter errorCounter()
public ClusterBackup.Context errorCounter(AtomicCounter errorCounter)
errorCounter - the error counter that will record the number of errors observed.public ClusterBackup.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 ClusterBackup.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 ClusterBackup.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 ClusterBackup.Context consensusModuleSnapshotStreamId(int streamId)
streamId - for the consensus module snapshot replay channel.ConsensusModule.Context.snapshotStreamId()public int consensusModuleSnapshotStreamId()
ConsensusModule.Context.snapshotStreamId()public ClusterBackup.Context serviceSnapshotStreamId(int streamId)
streamId - for the clustered service snapshot replay channel.ClusteredServiceContainer.Context.snapshotStreamId()public int serviceSnapshotStreamId()
ClusteredServiceContainer.Context.snapshotStreamId()public ClusterBackup.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 ClusterBackup.Context catchupEndpoint(String catchupEndpoint)
catchupEndpoint - to use for the log retrieval.ClusterBackup.Configuration.catchupEndpoint()public String catchupEndpoint()
ClusterBackup.Configuration.catchupEndpoint()public ClusterBackup.Context catchupChannel(String catchupChannel)
catchupChannel - to use for the log and snapshot retrieval.ClusterBackup.Configuration.CLUSTER_BACKUP_CATCHUP_CHANNEL_PROP_NAMEpublic String catchupChannel()
ClusterBackup.Configuration.CLUSTER_BACKUP_CATCHUP_CHANNEL_PROP_NAMEpublic ClusterBackup.Context clusterBackupIntervalNs(long clusterBackupIntervalNs)
clusterBackupIntervalNs - between add cluster members and snapshot recording queries.ClusterBackup.Configuration.CLUSTER_BACKUP_INTERVAL_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_INTERVAL_DEFAULT_NSpublic long clusterBackupIntervalNs()
ClusterBackup.Configuration.CLUSTER_BACKUP_INTERVAL_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_INTERVAL_DEFAULT_NSpublic ClusterBackup.Context clusterBackupResponseTimeoutNs(long clusterBackupResponseTimeoutNs)
clusterBackupResponseTimeoutNs - within which a cluster backup will expect a response.ClusterBackup.Configuration.CLUSTER_BACKUP_RESPONSE_TIMEOUT_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_RESPONSE_TIMEOUT_DEFAULT_NSpublic long clusterBackupResponseTimeoutNs()
ClusterBackup.Configuration.CLUSTER_BACKUP_RESPONSE_TIMEOUT_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_RESPONSE_TIMEOUT_DEFAULT_NSpublic ClusterBackup.Context clusterBackupProgressTimeoutNs(long clusterBackupProgressTimeoutNs)
clusterBackupProgressTimeoutNs - within which a cluster backup will expect a response.ClusterBackup.Configuration.CLUSTER_BACKUP_PROGRESS_TIMEOUT_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_PROGRESS_TIMEOUT_DEFAULT_NSpublic long clusterBackupProgressTimeoutNs()
ClusterBackup.Configuration.CLUSTER_BACKUP_PROGRESS_TIMEOUT_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_PROGRESS_TIMEOUT_DEFAULT_NSpublic ClusterBackup.Context clusterBackupCoolDownIntervalNs(long clusterBackupCoolDownIntervalNs)
clusterBackupCoolDownIntervalNs - time before the cluster backup is re-initialised.ClusterBackup.Configuration.CLUSTER_BACKUP_COOL_DOWN_INTERVAL_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_COOL_DOWN_INTERVAL_DEFAULT_NSpublic long clusterBackupCoolDownIntervalNs()
ClusterBackup.Configuration.CLUSTER_BACKUP_COOL_DOWN_INTERVAL_PROP_NAME,
ClusterBackup.Configuration.CLUSTER_BACKUP_COOL_DOWN_INTERVAL_DEFAULT_NSpublic ClusterBackup.Context clusterConsensusEndpoints(String endpoints)
"endpoint,endpoint,endpoint"
endpoints - which are to be contacted for joining the cluster.public String clusterConsensusEndpoints()
public ClusterBackup.Context shutdownSignalBarrier(ShutdownSignalBarrier barrier)
ShutdownSignalBarrier that can be used to shut down a consensus module.barrier - that can be used to shut down a consensus module.public ShutdownSignalBarrier shutdownSignalBarrier()
ShutdownSignalBarrier that can be used to shut down.ShutdownSignalBarrier that can be used to shut down.public ClusterBackup.Context terminationHook(Runnable terminationHook)
Runnable that is called when the ClusterBackup processes a termination action.terminationHook - that can be used to terminate.public Runnable terminationHook()
Runnable that is called when the ClusterBackup processes a termination action.
The default action is to call signal on the shutdownSignalBarrier().
Runnable that can be used to terminate.public ClusterBackup.Context clusterMarkFile(ClusterMarkFile markFile)
ClusterMarkFile in use.markFile - to use.public ClusterMarkFile clusterMarkFile()
ClusterMarkFile in use.ClusterMarkFile in use.public ClusterBackup.Context errorBufferLength(int errorBufferLength)
errorBufferLength - in bytes to use.public int errorBufferLength()
public ClusterBackup.Context errorLog(DistinctErrorLog errorLog)
DistinctErrorLog in use.errorLog - to use.public DistinctErrorLog errorLog()
DistinctErrorLog in use.DistinctErrorLog in use.public Counter stateCounter()
ClusterBackup.Statepublic ClusterBackup.Context stateCounter(Counter stateCounter)
stateCounter - the counter for the current state of the cluster backup.ClusterBackup.Statepublic Counter liveLogPositionCounter()
public ClusterBackup.Context liveLogPositionCounter(Counter liveLogPositionCounter)
liveLogPositionCounter - the counter for the current position of the live log.public Counter nextQueryDeadlineMsCounter()
public ClusterBackup.Context nextQueryDeadlineMsCounter(Counter nextQueryDeadlineMsCounter)
nextQueryDeadlineMsCounter - the counter for the next query deadline ms.public ClusterBackupEventsListener eventsListener()
ClusterBackupEventsListener in use for the backup agent.ClusterBackupEventsListener in use for the backup agent.ClusterBackupEventsListenerpublic ClusterBackup.Context eventsListener(ClusterBackupEventsListener eventsListener)
ClusterBackupEventsListener to use for the backup agent.eventsListener - to use for the backup agent.ClusterBackupEventsListenerpublic ClusterBackup.Context useAgentInvoker(boolean useAgentInvoker)
AgentInvoker be used for running the ClusterBackup rather than run it on
a thread with a AgentRunner.useAgentInvoker - use AgentInvoker be used for running the ClusterBackup?public boolean useAgentInvoker()
AgentInvoker be used for running the ClusterBackup rather than run it on
a thread with a AgentRunner.ClusterBackup will be run with an AgentInvoker otherwise false.public ClusterBackup.Context credentialsSupplier(CredentialsSupplier credentialsSupplier)
CredentialsSupplier to be used for authentication with the cluster.credentialsSupplier - to be used for authentication with the cluster.public CredentialsSupplier credentialsSupplier()
CredentialsSupplier to be used for authentication with the cluster.CredentialsSupplier to be used for authentication with the cluster.public ClusterBackup.Context sourceType(ClusterBackup.SourceType sourceType)
ClusterBackup.SourceType to be used for this backup instance.sourceType - type of sources to receive log traffic from.public ClusterBackup.SourceType sourceType()
IllegalArgumentException - if the configured source type is not one of ClusterBackup.SourceTypepublic ClusterBackup.Context replicationProgressTimeoutNs(long timeoutNs)
timeoutNs - timeout in nanosecondsConsensusModule.Configuration.replicationProgressTimeoutNs()public long replicationProgressTimeoutNs()
ConsensusModule.Configuration.replicationProgressTimeoutNs()public ClusterBackup.Context replicationProgressIntervalNs(long intervalNs)
replicationProgressTimeoutNs()
divided by 10.intervalNs - timeout in nanosecondsConsensusModule.Configuration.replicationProgressIntervalNs()public long replicationProgressIntervalNs()
ConsensusModule.Configuration.replicationProgressIntervalNs()public void deleteDirectory()
public void close()
If ownsAeronClient() is true then the aeron() client will be closed.
Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.