Package io.aeron.cluster.service
Class ClusteredServiceContainer.Configuration
java.lang.Object
io.aeron.cluster.service.ClusteredServiceContainer.Configuration
- Enclosing class:
- ClusteredServiceContainer
Configuration options for the consensus module and service container within a cluster.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault directory to use for the aeron cluster.static final StringDirectory to use for the aeron cluster.static final intDefault identity for a clustered instance.static final StringProperty name for the identity of the cluster instance.static final StringIdleStrategyto be employed for cluster agents.static final intCounter type id for the cluster node role.static final StringDirectory to use for the aeron cluster services, will default toConsensusModule.Context.clusterDir()if not specified.static final intCounter type id for the clustered service error count.static final intCounter type id of the commit position.static final intDefault stream id within a channel for communications from the services to the consensus module.static final StringStream id within the control channel for communications from the services to the consensus module.static final StringDefault channel for communications between the local consensus module and services.static final StringChannel for control communications between the local consensus module and services.static final longDefault threshold value for the container work cycle threshold to track for being exceeded.static final StringProperty name for threshold value for the container work cycle threshold to track for being exceeded.static final StringDefaultIdleStrategyto be employed for cluster agents.static final StringDelegatingErrorHandlerwhich will be first in the chain before delegating to theClusteredServiceContainer.Context.errorHandler().static final intDefault length in bytes of the error buffer for the cluster container.static final StringLength in bytes of the error buffer for the cluster container.static final longTimeout in milliseconds to detect liveness.static final intDefault fragment limit for polling log.static final StringFragment limit to use when polling the log.static final StringDirectory to use for the Cluster component's mark file.static final longUpdate interval for cluster mark file in nanoseconds.static final StringDefault channel to be used for log or snapshot replay on startup.static final StringChannel to be used for log or snapshot replay on startup.static final intDefault stream id for the log or snapshot replay within a channel.static final StringStream id within a channel for the clustered log or snapshot replay.static final booleanDefault to true that this a responding service to client requests.static final StringIs this a responding service to client requests property.static final StringClass name for dynamically loading aClusteredService.static final intDefault identity for a clustered service.static final StringIdentity for a clustered service.static final StringName for a clustered service to be the role of theAgent.static final StringName for a clustered service to be the role of theAgent.static final intDefault stream id within the control channel for communications from the consensus module.static final StringStream id within the control channel for communications from the consensus module to the services.static final StringDefault channel to be used for archiving snapshots.static final StringChannel to be used for archiving snapshots.static final longDefault threshold value, which is used for tracking snapshot duration breaches.static final StringProperty name for threshold value, which is used for tracking snapshot duration breaches.static final intDefault stream id for the archived snapshots within a channel.static final StringStream id within a channel for archiving snapshots.static final longType of snapshot for this service.static final StringProperty to configure if this node should take standby snapshots. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe valueCLUSTER_DIR_DEFAULTor system propertyCLUSTER_DIR_PROP_NAMEif set.static intThe valueCLUSTER_ID_DEFAULTor system propertyCLUSTER_ID_PROP_NAMEif set.static StringThe value of system propertyCLUSTER_DIR_PROP_NAMEif set or null.static intThe valueCONSENSUS_MODULE_STREAM_ID_DEFAULTor system propertyCONSENSUS_MODULE_STREAM_ID_PROP_NAMEif set.static StringThe valueCONTROL_CHANNEL_DEFAULTor system propertyCONTROL_CHANNEL_PROP_NAMEif set.static longGet threshold value for the container work cycle threshold to track for being exceeded.static intSize in bytes of the error buffer in the mark file.static Supplier<IdleStrategy>idleStrategySupplier(StatusIndicator controllableStatus) Create a supplier ofIdleStrategys that will use the system property.static booleanThe valueRESPONDER_SERVICE_DEFAULTor system propertyRESPONDER_SERVICE_PROP_NAMEif set.static intThe valueLOG_FRAGMENT_LIMIT_DEFAULTor system propertyLOG_FRAGMENT_LIMIT_PROP_NAMEif set.static StringGet the alternative directory to be used for storing the Cluster component's mark file.static ClusteredServiceCreate a newClusteredServicebased on the configuredSERVICE_CLASS_NAME_PROP_NAME.static DelegatingErrorHandlerCreate a newDelegatingErrorHandlerdefined byDELEGATING_ERROR_HANDLER_PROP_NAME.static StringThe valueREPLAY_CHANNEL_DEFAULTor system propertyREPLAY_CHANNEL_PROP_NAMEif set.static intThe valueREPLAY_STREAM_ID_DEFAULTor system propertyREPLAY_STREAM_ID_PROP_NAMEif set.static intThe valueSERVICE_ID_DEFAULTor system propertySERVICE_ID_PROP_NAMEif set.static StringThe valueSERVICE_NAME_DEFAULTor system propertySERVICE_NAME_PROP_NAMEif set.static intThe valueSERVICE_STREAM_ID_DEFAULTor system propertySERVICE_STREAM_ID_PROP_NAMEif set.static StringThe valueSNAPSHOT_CHANNEL_DEFAULTor system propertySNAPSHOT_CHANNEL_PROP_NAMEif set.static longGet threshold value, which is used for monitoring snapshot duration breaches of its predefined threshold.static intThe valueSNAPSHOT_STREAM_ID_DEFAULTor system propertySNAPSHOT_STREAM_ID_PROP_NAMEif set.static booleanGet the configuration value to determine if this node should take standby snapshots be enabled.
-
Field Details
-
SNAPSHOT_TYPE_ID
public static final long SNAPSHOT_TYPE_IDType of snapshot for this service.- See Also:
-
MARK_FILE_UPDATE_INTERVAL_NS
public static final long MARK_FILE_UPDATE_INTERVAL_NSUpdate interval for cluster mark file in nanoseconds. -
LIVENESS_TIMEOUT_MS
public static final long LIVENESS_TIMEOUT_MSTimeout in milliseconds to detect liveness. -
CLUSTER_ID_PROP_NAME
Property name for the identity of the cluster instance.- See Also:
-
CLUSTER_ID_DEFAULT
public static final int CLUSTER_ID_DEFAULTDefault identity for a clustered instance.- See Also:
-
SERVICE_ID_PROP_NAME
Identity for a clustered service. Services should be numbered from 0 and be contiguous.- See Also:
-
SERVICE_ID_DEFAULT
public static final int SERVICE_ID_DEFAULTDefault identity for a clustered service.- See Also:
-
SERVICE_NAME_PROP_NAME
Name for a clustered service to be the role of theAgent.- See Also:
-
SERVICE_NAME_DEFAULT
Name for a clustered service to be the role of theAgent.- See Also:
-
SERVICE_CLASS_NAME_PROP_NAME
Class name for dynamically loading aClusteredService. This is used ifClusteredServiceContainer.Context.clusteredService()is not set.- See Also:
-
REPLAY_CHANNEL_PROP_NAME
Channel to be used for log or snapshot replay on startup.- See Also:
-
REPLAY_CHANNEL_DEFAULT
Default channel to be used for log or snapshot replay on startup.- See Also:
-
REPLAY_STREAM_ID_PROP_NAME
Stream id within a channel for the clustered log or snapshot replay.- See Also:
-
REPLAY_STREAM_ID_DEFAULT
public static final int REPLAY_STREAM_ID_DEFAULTDefault stream id for the log or snapshot replay within a channel.- See Also:
-
CONTROL_CHANNEL_PROP_NAME
Channel for control communications between the local consensus module and services.- See Also:
-
CONTROL_CHANNEL_DEFAULT
Default channel for communications between the local consensus module and services. This should be IPC.- See Also:
-
SERVICE_STREAM_ID_PROP_NAME
Stream id within the control channel for communications from the consensus module to the services.- See Also:
-
SERVICE_STREAM_ID_DEFAULT
public static final int SERVICE_STREAM_ID_DEFAULTDefault stream id within the control channel for communications from the consensus module.- See Also:
-
CONSENSUS_MODULE_STREAM_ID_PROP_NAME
Stream id within the control channel for communications from the services to the consensus module.- See Also:
-
CONSENSUS_MODULE_STREAM_ID_DEFAULT
public static final int CONSENSUS_MODULE_STREAM_ID_DEFAULTDefault stream id within a channel for communications from the services to the consensus module.- See Also:
-
SNAPSHOT_CHANNEL_PROP_NAME
Channel to be used for archiving snapshots.- See Also:
-
SNAPSHOT_CHANNEL_DEFAULT
Default channel to be used for archiving snapshots.- See Also:
-
SNAPSHOT_STREAM_ID_PROP_NAME
Stream id within a channel for archiving snapshots.- See Also:
-
SNAPSHOT_STREAM_ID_DEFAULT
public static final int SNAPSHOT_STREAM_ID_DEFAULTDefault stream id for the archived snapshots within a channel.- See Also:
-
CLUSTER_DIR_PROP_NAME
Directory to use for the aeron cluster.- See Also:
-
CLUSTER_DIR_DEFAULT
Default directory to use for the aeron cluster.- See Also:
-
CLUSTER_SERVICES_DIR_PROP_NAME
Directory to use for the aeron cluster services, will default toConsensusModule.Context.clusterDir()if not specified.- See Also:
-
MARK_FILE_DIR_PROP_NAME
Directory to use for the Cluster component's mark file.- See Also:
-
ERROR_BUFFER_LENGTH_PROP_NAME
Length in bytes of the error buffer for the cluster container.- See Also:
-
ERROR_BUFFER_LENGTH_DEFAULT
public static final int ERROR_BUFFER_LENGTH_DEFAULTDefault length in bytes of the error buffer for the cluster container.- See Also:
-
RESPONDER_SERVICE_PROP_NAME
Is this a responding service to client requests property.- See Also:
-
RESPONDER_SERVICE_DEFAULT
public static final boolean RESPONDER_SERVICE_DEFAULTDefault to true that this a responding service to client requests.- See Also:
-
LOG_FRAGMENT_LIMIT_PROP_NAME
Fragment limit to use when polling the log.- See Also:
-
LOG_FRAGMENT_LIMIT_DEFAULT
public static final int LOG_FRAGMENT_LIMIT_DEFAULTDefault fragment limit for polling log.- See Also:
-
DELEGATING_ERROR_HANDLER_PROP_NAME
DelegatingErrorHandlerwhich will be first in the chain before delegating to theClusteredServiceContainer.Context.errorHandler().- See Also:
-
CYCLE_THRESHOLD_PROP_NAME
Property name for threshold value for the container work cycle threshold to track for being exceeded.- See Also:
-
CYCLE_THRESHOLD_DEFAULT_NS
public static final long CYCLE_THRESHOLD_DEFAULT_NSDefault threshold value for the container work cycle threshold to track for being exceeded. -
SNAPSHOT_DURATION_THRESHOLD_PROP_NAME
Property name for threshold value, which is used for tracking snapshot duration breaches.- Since:
- 1.44.0
- See Also:
-
SNAPSHOT_DURATION_THRESHOLD_DEFAULT_NS
public static final long SNAPSHOT_DURATION_THRESHOLD_DEFAULT_NSDefault threshold value, which is used for tracking snapshot duration breaches.- Since:
- 1.44.0
-
CLUSTER_NODE_ROLE_TYPE_ID
public static final int CLUSTER_NODE_ROLE_TYPE_IDCounter type id for the cluster node role.- See Also:
-
COMMIT_POSITION_TYPE_ID
public static final int COMMIT_POSITION_TYPE_IDCounter type id of the commit position.- See Also:
-
CLUSTERED_SERVICE_ERROR_COUNT_TYPE_ID
public static final int CLUSTERED_SERVICE_ERROR_COUNT_TYPE_IDCounter type id for the clustered service error count.- See Also:
-
DEFAULT_IDLE_STRATEGY
DefaultIdleStrategyto be employed for cluster agents.- See Also:
-
CLUSTER_IDLE_STRATEGY_PROP_NAME
IdleStrategyto be employed for cluster agents.- See Also:
-
STANDBY_SNAPSHOT_ENABLED_PROP_NAME
Property to configure if this node should take standby snapshots. The default for this property isfalse.- See Also:
-
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
clusterId
public static int clusterId()The valueCLUSTER_ID_DEFAULTor system propertyCLUSTER_ID_PROP_NAMEif set.- Returns:
CLUSTER_ID_DEFAULTor system propertyCLUSTER_ID_PROP_NAMEif set.
-
serviceId
public static int serviceId()The valueSERVICE_ID_DEFAULTor system propertySERVICE_ID_PROP_NAMEif set.- Returns:
SERVICE_ID_DEFAULTor system propertySERVICE_ID_PROP_NAMEif set.
-
serviceName
The valueSERVICE_NAME_DEFAULTor system propertySERVICE_NAME_PROP_NAMEif set.- Returns:
SERVICE_NAME_DEFAULTor system propertySERVICE_NAME_PROP_NAMEif set.
-
replayChannel
The valueREPLAY_CHANNEL_DEFAULTor system propertyREPLAY_CHANNEL_PROP_NAMEif set.- Returns:
REPLAY_CHANNEL_DEFAULTor system propertyREPLAY_CHANNEL_PROP_NAMEif set.
-
replayStreamId
public static int replayStreamId()The valueREPLAY_STREAM_ID_DEFAULTor system propertyREPLAY_STREAM_ID_PROP_NAMEif set.- Returns:
REPLAY_STREAM_ID_DEFAULTor system propertyREPLAY_STREAM_ID_PROP_NAMEif set.
-
controlChannel
The valueCONTROL_CHANNEL_DEFAULTor system propertyCONTROL_CHANNEL_PROP_NAMEif set.- Returns:
CONTROL_CHANNEL_DEFAULTor system propertyCONTROL_CHANNEL_PROP_NAMEif set.
-
consensusModuleStreamId
public static int consensusModuleStreamId()The valueCONSENSUS_MODULE_STREAM_ID_DEFAULTor system propertyCONSENSUS_MODULE_STREAM_ID_PROP_NAMEif set.- Returns:
CONSENSUS_MODULE_STREAM_ID_DEFAULTor system propertyCONSENSUS_MODULE_STREAM_ID_PROP_NAMEif set.
-
serviceStreamId
public static int serviceStreamId()The valueSERVICE_STREAM_ID_DEFAULTor system propertySERVICE_STREAM_ID_PROP_NAMEif set.- Returns:
SERVICE_STREAM_ID_DEFAULTor system propertySERVICE_STREAM_ID_PROP_NAMEif set.
-
snapshotChannel
The valueSNAPSHOT_CHANNEL_DEFAULTor system propertySNAPSHOT_CHANNEL_PROP_NAMEif set.- Returns:
SNAPSHOT_CHANNEL_DEFAULTor system propertySNAPSHOT_CHANNEL_PROP_NAMEif set.
-
snapshotStreamId
public static int snapshotStreamId()The valueSNAPSHOT_STREAM_ID_DEFAULTor system propertySNAPSHOT_STREAM_ID_PROP_NAMEif set.- Returns:
SNAPSHOT_STREAM_ID_DEFAULTor system propertySNAPSHOT_STREAM_ID_PROP_NAMEif set.
-
idleStrategySupplier
Create a supplier ofIdleStrategys that will use the system property.- Parameters:
controllableStatus- if aControllableIdleStrategyis required.- Returns:
- the new idle strategy
-
clusterDirName
The valueCLUSTER_DIR_DEFAULTor system propertyCLUSTER_DIR_PROP_NAMEif set.- Returns:
CLUSTER_DIR_DEFAULTor system propertyCLUSTER_DIR_PROP_NAMEif set.
-
clusterServicesDirName
The value of system propertyCLUSTER_DIR_PROP_NAMEif set or null.- Returns:
CLUSTER_DIR_PROP_NAMEif set or null.
-
errorBufferLength
public static int errorBufferLength()Size in bytes of the error buffer in the mark file.- Returns:
- length of error buffer in bytes.
- See Also:
-
isRespondingService
public static boolean isRespondingService()The valueRESPONDER_SERVICE_DEFAULTor system propertyRESPONDER_SERVICE_PROP_NAMEif set.- Returns:
RESPONDER_SERVICE_DEFAULTor system propertyRESPONDER_SERVICE_PROP_NAMEif set.
-
logFragmentLimit
public static int logFragmentLimit()The valueLOG_FRAGMENT_LIMIT_DEFAULTor system propertyLOG_FRAGMENT_LIMIT_PROP_NAMEif set.- Returns:
LOG_FRAGMENT_LIMIT_DEFAULTor system propertyLOG_FRAGMENT_LIMIT_PROP_NAMEif set.
-
cycleThresholdNs
public static long cycleThresholdNs()Get threshold value for the container work cycle threshold to track for being exceeded.- Returns:
- threshold value in nanoseconds.
-
snapshotDurationThresholdNs
public static long snapshotDurationThresholdNs()Get threshold value, which is used for monitoring snapshot duration breaches of its predefined threshold.- Returns:
- threshold value in nanoseconds.
-
standbySnapshotEnabled
public static boolean standbySnapshotEnabled()Get the configuration value to determine if this node should take standby snapshots be enabled.- Returns:
- configuration value for standby snapshots being enabled.
-
newClusteredService
Create a newClusteredServicebased on the configuredSERVICE_CLASS_NAME_PROP_NAME.- Returns:
- a new
ClusteredServicebased on the configuredSERVICE_CLASS_NAME_PROP_NAME.
-
newDelegatingErrorHandler
Create a newDelegatingErrorHandlerdefined byDELEGATING_ERROR_HANDLER_PROP_NAME.- Returns:
- a new
DelegatingErrorHandlerdefined byDELEGATING_ERROR_HANDLER_PROP_NAMEor null if property not set.
-
markFileDir
Get the alternative directory to be used for storing the Cluster component's mark file.- Returns:
- the directory to be used for storing the archive mark file.
-