public class BlueGreenStatusMonitor
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allStartTopologyEndpointsRemoved |
protected boolean |
allStartTopologyIpChanged |
protected boolean |
allTopologyChanged |
protected static java.lang.String |
BG_CLUSTER_ID |
protected java.lang.String |
bgdId |
protected BlueGreenDialect |
blueGreenDialect |
protected java.util.concurrent.atomic.AtomicBoolean |
collectIpAddresses |
protected java.util.concurrent.atomic.AtomicBoolean |
collectTopology |
protected java.util.concurrent.atomic.AtomicReference<java.lang.String> |
connectedIpAddress |
protected java.util.concurrent.atomic.AtomicReference<java.sql.Connection> |
connection |
protected java.util.concurrent.atomic.AtomicReference<HostSpec> |
connectionHostSpec |
protected java.util.concurrent.atomic.AtomicBoolean |
connectionHostSpecCorrect |
protected ConnectionUrlParser |
connectionUrlParser |
protected java.util.Map<java.lang.String,java.util.Optional<java.lang.String>> |
currentIpAddressesByHostMap |
protected BlueGreenPhase |
currentPhase |
protected java.util.concurrent.atomic.AtomicReference<java.util.List<HostSpec>> |
currentTopology |
protected static long |
DEFAULT_CHECK_INTERVAL_MS |
protected java.util.concurrent.ExecutorService |
executorService |
protected HostListProvider |
hostListProvider |
protected java.util.Set<java.lang.String> |
hostNames |
protected HostSpecBuilder |
hostSpecBuilder |
protected HostSpec |
initialHostSpec |
protected java.util.concurrent.atomic.AtomicReference<BlueGreenIntervalRate> |
intervalRate |
protected static java.util.Set<java.lang.String> |
knownVersions |
protected static java.lang.String |
latestKnownVersion |
protected OnBlueGreenStatusChange |
onBlueGreenStatusChangeFunc |
protected java.util.concurrent.ExecutorService |
openConnectionExecutorService |
protected java.util.concurrent.Future<java.lang.Void> |
openConnectionFuture |
protected java.util.concurrent.atomic.AtomicBoolean |
panicMode |
protected PluginService |
pluginService |
protected int |
port |
protected java.util.Properties |
props |
protected RdsUtils |
rdsUtils |
protected BlueGreenRole |
role |
protected FullServicesContainer |
servicesContainer |
protected java.lang.Object |
sleepWaitObj |
protected java.util.Map<java.lang.String,java.util.Optional<java.lang.String>> |
startIpAddressesByHostMap |
protected java.util.List<HostSpec> |
startTopology |
protected java.util.Map<BlueGreenIntervalRate,java.lang.Long> |
statusCheckIntervalMap |
protected java.util.concurrent.atomic.AtomicBoolean |
stop |
protected java.util.concurrent.atomic.AtomicBoolean |
useIpAddress |
protected java.lang.String |
version |
| Constructor and Description |
|---|
BlueGreenStatusMonitor(@NonNull BlueGreenRole role,
@NonNull java.lang.String bgdId,
@NonNull HostSpec initialHostSpec,
@NonNull FullServicesContainer servicesContainer,
@NonNull java.util.Properties props,
@NonNull java.util.Map<BlueGreenIntervalRate,java.lang.Long> statusCheckIntervalMap,
@Nullable OnBlueGreenStatusChange onBlueGreenStatusChangeFunc) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeConnection() |
protected void |
collectHostIpAddresses() |
protected void |
collectStatus() |
protected void |
collectTopology() |
protected void |
delay(long delayMs) |
protected java.util.Optional<java.lang.String> |
getIpAddress(java.lang.String host) |
protected void |
initHostListProvider() |
protected boolean |
isConnectionClosed(java.sql.Connection conn) |
protected void |
notifyChanges() |
protected void |
openConnection() |
void |
resetCollectedData() |
protected void |
runMonitoringLoop() |
void |
setCollectIpAddresses(boolean collectIpAddresses) |
void |
setCollectTopology(boolean collectTopology) |
void |
setIntervalRate(@NonNull BlueGreenIntervalRate blueGreenIntervalRate) |
void |
setStop(boolean stop) |
void |
setUseIpAddress(boolean useIpAddress) |
protected void |
updateIpAddressFlags() |
protected static final long DEFAULT_CHECK_INTERVAL_MS
protected static final java.lang.String BG_CLUSTER_ID
protected static final java.lang.String latestKnownVersion
protected static final java.util.Set<java.lang.String> knownVersions
protected final BlueGreenDialect blueGreenDialect
protected final FullServicesContainer servicesContainer
protected final PluginService pluginService
protected final java.lang.String bgdId
protected final java.util.Properties props
protected final BlueGreenRole role
protected final OnBlueGreenStatusChange onBlueGreenStatusChangeFunc
protected final java.util.Map<BlueGreenIntervalRate,java.lang.Long> statusCheckIntervalMap
protected final HostSpec initialHostSpec
protected final java.util.concurrent.ExecutorService executorService
protected final java.util.concurrent.ExecutorService openConnectionExecutorService
protected final RdsUtils rdsUtils
protected final ConnectionUrlParser connectionUrlParser
protected final HostSpecBuilder hostSpecBuilder
protected final java.util.concurrent.atomic.AtomicBoolean collectIpAddresses
protected final java.util.concurrent.atomic.AtomicBoolean collectTopology
protected final java.util.concurrent.atomic.AtomicReference<BlueGreenIntervalRate> intervalRate
protected final java.util.concurrent.atomic.AtomicBoolean stop
protected final java.util.concurrent.atomic.AtomicBoolean useIpAddress
protected final java.lang.Object sleepWaitObj
protected HostListProvider hostListProvider
protected java.util.List<HostSpec> startTopology
protected final java.util.concurrent.atomic.AtomicReference<java.util.List<HostSpec>> currentTopology
protected java.util.Map<java.lang.String,java.util.Optional<java.lang.String>> startIpAddressesByHostMap
protected java.util.Map<java.lang.String,java.util.Optional<java.lang.String>> currentIpAddressesByHostMap
protected boolean allStartTopologyIpChanged
protected boolean allStartTopologyEndpointsRemoved
protected boolean allTopologyChanged
protected BlueGreenPhase currentPhase
protected java.util.Set<java.lang.String> hostNames
protected java.lang.String version
protected int port
protected final java.util.concurrent.atomic.AtomicReference<java.sql.Connection> connection
protected final java.util.concurrent.atomic.AtomicReference<HostSpec> connectionHostSpec
protected final java.util.concurrent.atomic.AtomicReference<java.lang.String> connectedIpAddress
protected final java.util.concurrent.atomic.AtomicBoolean connectionHostSpecCorrect
protected final java.util.concurrent.atomic.AtomicBoolean panicMode
protected java.util.concurrent.Future<java.lang.Void> openConnectionFuture
public BlueGreenStatusMonitor(@NonNull BlueGreenRole role, @NonNull java.lang.String bgdId, @NonNull HostSpec initialHostSpec, @NonNull FullServicesContainer servicesContainer, @NonNull java.util.Properties props, @NonNull java.util.Map<BlueGreenIntervalRate,java.lang.Long> statusCheckIntervalMap, @Nullable OnBlueGreenStatusChange onBlueGreenStatusChangeFunc)
protected void runMonitoringLoop()
protected void delay(long delayMs)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void setIntervalRate(@NonNull BlueGreenIntervalRate blueGreenIntervalRate)
public void setCollectIpAddresses(boolean collectIpAddresses)
public void setCollectTopology(boolean collectTopology)
public void setUseIpAddress(boolean useIpAddress)
public void setStop(boolean stop)
public void resetCollectedData()
protected void collectHostIpAddresses()
protected void updateIpAddressFlags()
protected java.util.Optional<java.lang.String> getIpAddress(java.lang.String host)
protected void collectTopology()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void closeConnection()
protected void collectStatus()
protected boolean isConnectionClosed(java.sql.Connection conn)
protected void openConnection()
protected void notifyChanges()
protected void initHostListProvider()