public class GdbMonitoringConnectionHandler extends AbstractMonitoringConnectionHandler<GdbMonitoringConnectionPriority>
MonitoringConnectionHandler that uses
GdbMonitoringConnectionPriority with region and primary/secondary awareness.| Modifier and Type | Field and Description |
|---|---|
static AwsWrapperProperty |
GDB_MONITORING_CONNECTION_PRIORITY |
protected RdsUtils |
rdsUtils |
protected java.util.concurrent.atomic.AtomicReference<HostSpec> |
writerHostSpec |
currentPriorityIndex, monitoringConnection, monitoringProperties, pluginService, priorities, topologyUtils, upgradeConnectedHost, upgradeConnection, upgradeExecutor, upgradeFuture, upgradeReadyNotifier| Constructor and Description |
|---|
GdbMonitoringConnectionHandler(AtomicConnection monitoringConnection,
PluginService pluginService,
TopologyUtils topologyUtils,
java.util.Properties properties,
java.util.Properties monitoringProperties,
java.util.concurrent.atomic.AtomicReference<HostSpec> writerHostSpec) |
GdbMonitoringConnectionHandler(AtomicConnection monitoringConnection,
PluginService pluginService,
TopologyUtils topologyUtils,
java.util.Properties properties,
java.util.Properties monitoringProperties,
java.util.concurrent.atomic.AtomicReference<HostSpec> writerHostSpec,
@Nullable java.lang.Runnable upgradeReadyNotifier) |
| Modifier and Type | Method and Description |
|---|---|
@Nullable HostSpec |
acceptConnections(java.util.Map<HostSpec,AtomicConnection> connections,
@Nullable HostSpec writerHostSpecOverride,
@Nullable java.util.List<HostSpec> topology)
GDB needs to evaluate priorities relative to the cluster's primary region.
|
protected int |
determinePriorityIndex(@NonNull HostSpec hostSpec,
boolean isWriter,
@Nullable java.lang.String primaryRegion) |
protected java.util.List<HostSpec> |
findHostsForPriority(int priorityIndex,
java.util.List<HostSpec> hosts)
Returns all hosts in
hosts that match the priority at priorityIndex of AbstractMonitoringConnectionHandler.priorities. |
protected @Nullable java.util.List<Pair<java.lang.String,java.lang.Object>> |
getAdditionalSnapshotState()
Hook for subclasses to publish additional snapshot state (e.g., GDB primary region).
|
protected @Nullable java.lang.String |
getPrimaryRegion() |
protected int |
getPriorityIndex(HostSpec host,
boolean isWriter)
Returns the index into
AbstractMonitoringConnectionHandler.priorities that the given host satisfies, or -1 if no priority
matches. |
protected java.lang.String |
getUpgradeThreadName()
Returns the thread-name prefix used for the async upgrade executor (e.g.,
"atmu" or "gatmu"). |
acceptConnection, attemptConnectionUpgrade, close, effectiveIndex, findUpgradeCandidates, formatPriorityIndex, getSnapshotStatepublic static final AwsWrapperProperty GDB_MONITORING_CONNECTION_PRIORITY
protected final RdsUtils rdsUtils
protected final java.util.concurrent.atomic.AtomicReference<HostSpec> writerHostSpec
public GdbMonitoringConnectionHandler(AtomicConnection monitoringConnection, PluginService pluginService, TopologyUtils topologyUtils, java.util.Properties properties, java.util.Properties monitoringProperties, java.util.concurrent.atomic.AtomicReference<HostSpec> writerHostSpec)
public GdbMonitoringConnectionHandler(AtomicConnection monitoringConnection, PluginService pluginService, TopologyUtils topologyUtils, java.util.Properties properties, java.util.Properties monitoringProperties, java.util.concurrent.atomic.AtomicReference<HostSpec> writerHostSpec, @Nullable java.lang.Runnable upgradeReadyNotifier)
public @Nullable HostSpec acceptConnections(java.util.Map<HostSpec,AtomicConnection> connections, @Nullable HostSpec writerHostSpecOverride, @Nullable java.util.List<HostSpec> topology)
AbstractMonitoringConnectionHandler.getPriorityIndex(HostSpec, boolean) which doesn't carry region
context, so acceptConnections is overridden to allow the caller's writer host to seed the primary
region (used during panic-mode resolution where the newly detected writer may differ from the cached one).acceptConnections in interface MonitoringConnectionHandleracceptConnections in class AbstractMonitoringConnectionHandler<GdbMonitoringConnectionPriority>connections - a map of host -> connection harvested from node threadswriterHostSpecOverride - the host spec of the writer (if known)topology - the current topology, used for region/role contextprotected int getPriorityIndex(HostSpec host, boolean isWriter)
AbstractMonitoringConnectionHandlerAbstractMonitoringConnectionHandler.priorities that the given host satisfies, or -1 if no priority
matches. The lowest-index match wins.getPriorityIndex in class AbstractMonitoringConnectionHandler<GdbMonitoringConnectionPriority>host - the host being consideredisWriter - whether the connection is to a writerprotected java.util.List<HostSpec> findHostsForPriority(int priorityIndex, java.util.List<HostSpec> hosts)
AbstractMonitoringConnectionHandlerhosts that match the priority at priorityIndex of AbstractMonitoringConnectionHandler.priorities.findHostsForPriority in class AbstractMonitoringConnectionHandler<GdbMonitoringConnectionPriority>protected java.lang.String getUpgradeThreadName()
AbstractMonitoringConnectionHandler"atmu" or "gatmu").getUpgradeThreadName in class AbstractMonitoringConnectionHandler<GdbMonitoringConnectionPriority>protected @Nullable java.util.List<Pair<java.lang.String,java.lang.Object>> getAdditionalSnapshotState()
AbstractMonitoringConnectionHandlergetAdditionalSnapshotState in class AbstractMonitoringConnectionHandler<GdbMonitoringConnectionPriority>protected @Nullable java.lang.String getPrimaryRegion()
protected int determinePriorityIndex(@NonNull HostSpec hostSpec, boolean isWriter, @Nullable java.lang.String primaryRegion)