public class GlobalDbFailoverConnectionPlugin extends FailoverConnectionPlugin
| Modifier and Type | Field and Description |
|---|---|
protected @Nullable java.util.Set<java.lang.String> |
accessibleRegions |
static AwsWrapperProperty |
ACTIVE_HOME_FAILOVER_MODE |
protected GlobalDbFailoverMode |
activeHomeFailoverMode |
static AwsWrapperProperty |
FAILOVER_HOME_REGION |
protected java.lang.String |
homeRegion |
static AwsWrapperProperty |
INACTIVE_HOME_FAILOVER_MODE |
protected GlobalDbFailoverMode |
inactiveHomeFailoverMode |
protected RetryUtil |
retryUtil |
closedExplicitly, ENABLE_CONNECT_FAILOVER, FAILOVER_MODE, FAILOVER_READER_HOST_SELECTOR_STRATEGY, FAILOVER_TIMEOUT_MS, failoverMode, failoverReaderFailedCounter, failoverReaderHostSelectorStrategySetting, failoverReaderSuccessCounter, failoverReaderTriggeredCounter, failoverTimeoutMsSetting, failoverWriterFailedCounter, failoverWriterSuccessCounter, failoverWriterTriggeredCounter, hostListProviderService, isClosed, isInTransaction, lastExceptionDealtWith, pluginManagerService, pluginService, properties, rdsHelper, rdsUrlType, servicesContainer, SKIP_FAILOVER_ON_INTERRUPTED_THREAD, skipFailoverOnInterruptedThread, staleDnsHelper, subscribedMethods, TELEMETRY_FAILOVER_ADDITIONAL_TOP_TRACE, telemetryFailoverAdditionalTopTraceSetting| Constructor and Description |
|---|
GlobalDbFailoverConnectionPlugin(FullServicesContainer servicesContainer,
java.util.Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
failover()
Initiates the failover procedure.
|
protected void |
failoverReader() |
protected void |
failoverToAllowedHost(@NonNull java.util.function.Supplier<java.util.Set<HostSpec>> allowedHosts,
@Nullable HostRole verifyRole,
long failoverEndNano) |
protected void |
failoverToWriter(HostSpec writerCandidate,
long failoverEndNano) |
protected void |
failoverWriter() |
protected void |
initFailoverMode() |
protected boolean |
isInAccessibleRegion(HostSpec host)
Checks if a host is in one of the accessible regions.
|
protected boolean |
isStrictWriterFailoverMode() |
allowedOnClosedConnection, canDirectExecute, connect, dealWithIllegalStateException, dealWithOriginalException, execute, getReaderFailoverConnection, getSnapshotState, getSubscribedMethodNames, getSubscribedMethods, initHostProvider, invalidateCurrentConnection, invalidInvocationOnClosedConnection, isFailoverEnabled, notifyNodeListChanged, pickNewConnection, shouldExceptionTriggerConnectionSwitch, throwFailoverSuccessExceptionacceptsStrategy, forceConnect, getHostSpecByStrategy, getHostSpecByStrategy, notifyConnectionChangedpublic static final AwsWrapperProperty ACTIVE_HOME_FAILOVER_MODE
public static final AwsWrapperProperty INACTIVE_HOME_FAILOVER_MODE
public static final AwsWrapperProperty FAILOVER_HOME_REGION
protected final RetryUtil retryUtil
protected GlobalDbFailoverMode activeHomeFailoverMode
protected GlobalDbFailoverMode inactiveHomeFailoverMode
protected java.lang.String homeRegion
protected @Nullable java.util.Set<java.lang.String> accessibleRegions
public GlobalDbFailoverConnectionPlugin(FullServicesContainer servicesContainer, java.util.Properties properties)
protected void initFailoverMode()
throws java.sql.SQLException
initFailoverMode in class FailoverConnectionPluginjava.sql.SQLExceptionprotected boolean isStrictWriterFailoverMode()
isStrictWriterFailoverMode in class FailoverConnectionPluginprotected void failover()
throws java.sql.SQLException
FailoverConnectionPluginfailover in class FailoverConnectionPluginjava.sql.SQLException - if an error occursprotected boolean isInAccessibleRegion(HostSpec host)
host - the host to checkprotected void failoverToWriter(HostSpec writerCandidate, long failoverEndNano) throws java.sql.SQLException
java.sql.SQLExceptionprotected void failoverToAllowedHost(@NonNull java.util.function.Supplier<java.util.Set<HostSpec>> allowedHosts, @Nullable HostRole verifyRole, long failoverEndNano) throws java.sql.SQLException
java.sql.SQLExceptionprotected void failoverReader()
throws java.sql.SQLException
failoverReader in class FailoverConnectionPluginjava.sql.SQLExceptionprotected void failoverWriter()
throws java.sql.SQLException
failoverWriter in class FailoverConnectionPluginjava.sql.SQLException