Class ClusterConnectionImpl
java.lang.Object
org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionImpl
- All Implemented Interfaces:
ClusterTopologyListener,AfterConnectInternalListener,TopologyManager,DiscoveryListener,ActiveMQComponent,ClusterConnection
public final class ClusterConnectionImpl
extends Object
implements ClusterConnection, AfterConnectInternalListener, TopologyManager, DiscoveryListener
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionClusterConnectionImpl(ClusterManager manager, DiscoveryGroupConfiguration dg, TransportConfiguration connector, SimpleString name, SimpleString address, int minLargeMessageSize, long clientFailureCheckPeriod, long connectionTTL, long retryInterval, double retryIntervalMultiplier, long maxRetryInterval, int initialConnectAttempts, int reconnectAttempts, long callTimeout, long callFailoverTimeout, boolean useDuplicateDetection, MessageLoadBalancingType messageLoadBalancingType, int confirmationWindowSize, int producerWindowSize, ExecutorFactory executorFactory, ActiveMQServer server, PostOffice postOffice, ManagementService managementService, ScheduledExecutorService scheduledExecutor, int maxHops, NodeManager nodeManager, String clusterUser, String clusterPassword, boolean allowDirectConnectionsOnly, long clusterNotificationInterval, int clusterNotificationAttempts, String clientId, int topologyScannerAttempts) ClusterConnectionImpl(ClusterManager manager, TransportConfiguration[] staticTranspConfigs, TransportConfiguration connector, SimpleString name, SimpleString address, int minLargeMessageSize, long clientFailureCheckPeriod, long connectionTTL, long retryInterval, double retryIntervalMultiplier, long maxRetryInterval, int initialConnectAttempts, int reconnectAttempts, long callTimeout, long callFailoverTimeout, boolean useDuplicateDetection, MessageLoadBalancingType messageLoadBalancingType, int confirmationWindowSize, int producerWindowSize, ExecutorFactory executorFactory, ActiveMQServer server, PostOffice postOffice, ManagementService managementService, ScheduledExecutorService scheduledExecutor, int maxHops, NodeManager nodeManager, String clusterUser, String clusterPassword, boolean allowDirectConnectionsOnly, long clusterNotificationInterval, int clusterNotificationAttempts, String clientId, int topologyScannerAttempts) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidconnectorsChanged(List<DiscoveryEntry> newConnectors) describe()voiddisconnectRecord(String targetNodeID) voidgetBridgeMetrics(String nodeId) Returns the BridgeMetrics for the bridge to the given node if exists.Bridge[]longThe metric for this cluster connectiongetName()getNodes()Only used for tests?longFor tests onlygetSfQueueName(String nodeID) voidbooleanisNodeActive(String nodeId) booleanbooleanvoidnodeAnnounced(long uniqueEventID, String nodeID, String backupGroupName, String scaleDownGroupName, Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean backup) voidTriggered when a node leaves the cluster.voidnodeUP(TopologyMember topologyMember, boolean last) Triggered when a node joins the cluster.voidvoidbooleanremoveMember(long uniqueEventID, String nodeId, boolean disconnect) From topologyManagervoidremoveRecord(String targetNodeID) voidsetSplitBrainDetection(boolean splitBrainDetection) This is needed on replication, however we don't need it on shared storage.voidstart()voidstop()toString()booleanupdateMember(long uniqueEventID, String nodeId, TopologyMemberImpl memberInput) This is the implementation of TopologyManager.booleanVerifies whether user and password match the ones configured for this ClusterConnection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Constructor Details
-
ClusterConnectionImpl
public ClusterConnectionImpl(ClusterManager manager, TransportConfiguration[] staticTranspConfigs, TransportConfiguration connector, SimpleString name, SimpleString address, int minLargeMessageSize, long clientFailureCheckPeriod, long connectionTTL, long retryInterval, double retryIntervalMultiplier, long maxRetryInterval, int initialConnectAttempts, int reconnectAttempts, long callTimeout, long callFailoverTimeout, boolean useDuplicateDetection, MessageLoadBalancingType messageLoadBalancingType, int confirmationWindowSize, int producerWindowSize, ExecutorFactory executorFactory, ActiveMQServer server, PostOffice postOffice, ManagementService managementService, ScheduledExecutorService scheduledExecutor, int maxHops, NodeManager nodeManager, String clusterUser, String clusterPassword, boolean allowDirectConnectionsOnly, long clusterNotificationInterval, int clusterNotificationAttempts, String clientId, int topologyScannerAttempts) throws Exception - Throws:
Exception
-
ClusterConnectionImpl
public ClusterConnectionImpl(ClusterManager manager, DiscoveryGroupConfiguration dg, TransportConfiguration connector, SimpleString name, SimpleString address, int minLargeMessageSize, long clientFailureCheckPeriod, long connectionTTL, long retryInterval, double retryIntervalMultiplier, long maxRetryInterval, int initialConnectAttempts, int reconnectAttempts, long callTimeout, long callFailoverTimeout, boolean useDuplicateDetection, MessageLoadBalancingType messageLoadBalancingType, int confirmationWindowSize, int producerWindowSize, ExecutorFactory executorFactory, ActiveMQServer server, PostOffice postOffice, ManagementService managementService, ScheduledExecutorService scheduledExecutor, int maxHops, NodeManager nodeManager, String clusterUser, String clusterPassword, boolean allowDirectConnectionsOnly, long clusterNotificationInterval, int clusterNotificationAttempts, String clientId, int topologyScannerAttempts) throws Exception - Throws:
Exception
-
-
Method Details
-
getServerLocator
For tests only -
start
- Specified by:
startin interfaceActiveMQComponent- Throws:
Exception
-
flushExecutor
public void flushExecutor()- Specified by:
flushExecutorin interfaceClusterConnection
-
stop
- Specified by:
stopin interfaceActiveMQComponent- Throws:
Exception
-
addClusterTopologyListener
- Specified by:
addClusterTopologyListenerin interfaceClusterConnection
-
removeClusterTopologyListener
- Specified by:
removeClusterTopologyListenerin interfaceClusterConnection
-
getTopology
- Specified by:
getTopologyin interfaceClusterConnection
-
nodeAnnounced
public void nodeAnnounced(long uniqueEventID, String nodeID, String backupGroupName, String scaleDownGroupName, Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean backup) - Specified by:
nodeAnnouncedin interfaceClusterConnection
-
updateMember
This is the implementation of TopologyManager. It is used to reject eventual updates from a split brain server.- Specified by:
updateMemberin interfaceTopologyManager
-
removeMember
From topologyManager- Specified by:
removeMemberin interfaceTopologyManager
-
setSplitBrainDetection
public void setSplitBrainDetection(boolean splitBrainDetection) Description copied from interface:ClusterConnectionThis is needed on replication, however we don't need it on shared storage.- Specified by:
setSplitBrainDetectionin interfaceClusterConnection
-
isSplitBrainDetection
public boolean isSplitBrainDetection()- Specified by:
isSplitBrainDetectionin interfaceClusterConnection
-
onConnection
- Specified by:
onConnectionin interfaceAfterConnectInternalListener
-
connectorsChanged
- Specified by:
connectorsChangedin interfaceDiscoveryListener
-
getTopologyScanner
-
isStarted
public boolean isStarted()- Specified by:
isStartedin interfaceActiveMQComponent
-
getName
- Specified by:
getNamein interfaceClusterConnection
-
getNodeID
- Specified by:
getNodeIDin interfaceClusterConnection
-
getServer
- Specified by:
getServerin interfaceClusterConnection
-
isNodeActive
- Specified by:
isNodeActivein interfaceClusterConnection
-
getCallTimeout
public long getCallTimeout()- Specified by:
getCallTimeoutin interfaceClusterConnection
-
getProducerWindowSize
public long getProducerWindowSize()- Specified by:
getProducerWindowSizein interfaceClusterConnection
-
getBridges
- Specified by:
getBridgesin interfaceClusterConnection
-
getNodes
Description copied from interface:ClusterConnectionOnly used for tests?- Specified by:
getNodesin interfaceClusterConnection- Returns:
- a Map of node ID and addresses
-
getConnector
- Specified by:
getConnectorin interfaceClusterConnection
-
nodeDown
Description copied from interface:ClusterTopologyListenerTriggered when a node leaves the cluster.- Specified by:
nodeDownin interfaceClusterTopologyListenernodeID- the id of the node leaving the cluster
-
nodeUP
Description copied from interface:ClusterTopologyListenerTriggered when a node joins the cluster.- Specified by:
nodeUPin interfaceClusterTopologyListenerlast- if the whole cluster topology is being transmitted (after adding the listener to the cluster connection) this parameter will betruefor the last topology member.
-
getSfQueueName
-
informClusterOfBackup
public void informClusterOfBackup()- Specified by:
informClusterOfBackupin interfaceClusterConnection
-
getMetrics
Description copied from interface:ClusterConnectionThe metric for this cluster connection- Specified by:
getMetricsin interfaceClusterConnection
-
getBridgeMetrics
Description copied from interface:ClusterConnectionReturns the BridgeMetrics for the bridge to the given node if exists.- Specified by:
getBridgeMetricsin interfaceClusterConnection- Returns:
- the BridgeMetrics for the bridge to the given node if exists
-
getRecords
-
toString
-
describe
- Specified by:
describein interfaceClusterConnection
-
verify
Description copied from interface:ClusterConnectionVerifies whether user and password match the ones configured for this ClusterConnection.- Specified by:
verifyin interfaceClusterConnection- Returns:
trueif username and password match,falseotherwise
-
removeRecord
- Specified by:
removeRecordin interfaceClusterConnection
-
disconnectRecord
- Specified by:
disconnectRecordin interfaceClusterConnection
-