public class BlueGreenConnectionPlugin extends AbstractConnectionPlugin
| Modifier and Type | Field and Description |
|---|---|
static AwsWrapperProperty |
BG_CONNECT_TIMEOUT |
static AwsWrapperProperty |
BGD_ID |
protected java.lang.String |
bgdId |
protected BlueGreenStatus |
bgStatus |
protected java.util.concurrent.atomic.AtomicLong |
endTimeNano |
protected boolean |
isIamInUse |
protected PluginService |
pluginService |
protected java.util.Properties |
props |
protected static java.util.Map<java.lang.String,BlueGreenStatusProvider> |
provider |
protected BlueGreenProviderSupplier |
providerSupplier |
protected RdsUtils |
rdsUtils |
protected FullServicesContainer |
servicesContainer |
protected java.util.concurrent.atomic.AtomicLong |
startTimeNano |
protected StorageService |
storageService |
protected java.util.Set<java.lang.String> |
subscribedMethods |
protected TelemetryFactory |
telemetryFactory |
| Constructor and Description |
|---|
BlueGreenConnectionPlugin(@NonNull FullServicesContainer servicesContainer,
@NonNull java.util.Properties props) |
BlueGreenConnectionPlugin(@NonNull FullServicesContainer servicesContainer,
@NonNull java.util.Properties props,
@NonNull BlueGreenProviderSupplier providerSupplier) |
| Modifier and Type | Method and Description |
|---|---|
java.sql.Connection |
connect(java.lang.String driverProtocol,
HostSpec hostSpec,
java.util.Properties props,
boolean isInitialConnection,
JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc)
Establishes a connection to the given host using the given driver protocol and properties.
|
<T,E extends java.lang.Exception> |
execute(java.lang.Class<T> resultClass,
java.lang.Class<E> exceptionClass,
java.lang.Object methodInvokeOn,
java.lang.String methodName,
JdbcCallable<T,E> jdbcMethodFunc,
java.lang.Object[] jdbcMethodArgs) |
long |
getHoldTimeNano() |
protected long |
getNanoTime() |
java.util.Set<java.lang.String> |
getSubscribedMethods() |
protected void |
initProvider() |
protected java.sql.Connection |
regularOpenConnection(JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc,
boolean isInitialConnection) |
void |
resetRoutingTimeNano() |
acceptsStrategy, forceConnect, getHostSpecByStrategy, getHostSpecByStrategy, initHostProvider, notifyConnectionChanged, notifyNodeListChangedpublic static final AwsWrapperProperty BG_CONNECT_TIMEOUT
public static final AwsWrapperProperty BGD_ID
protected static java.util.Map<java.lang.String,BlueGreenStatusProvider> provider
protected final FullServicesContainer servicesContainer
protected final StorageService storageService
protected final PluginService pluginService
protected final java.util.Properties props
protected BlueGreenProviderSupplier providerSupplier
protected final TelemetryFactory telemetryFactory
protected final RdsUtils rdsUtils
protected BlueGreenStatus bgStatus
protected java.lang.String bgdId
protected boolean isIamInUse
protected final java.util.concurrent.atomic.AtomicLong startTimeNano
protected final java.util.concurrent.atomic.AtomicLong endTimeNano
protected final java.util.Set<java.lang.String> subscribedMethods
public BlueGreenConnectionPlugin(@NonNull FullServicesContainer servicesContainer, @NonNull java.util.Properties props)
public BlueGreenConnectionPlugin(@NonNull FullServicesContainer servicesContainer, @NonNull java.util.Properties props, @NonNull BlueGreenProviderSupplier providerSupplier)
public java.util.Set<java.lang.String> getSubscribedMethods()
getSubscribedMethods in interface ConnectionPlugingetSubscribedMethods in class AbstractConnectionPluginpublic java.sql.Connection connect(java.lang.String driverProtocol,
HostSpec hostSpec,
java.util.Properties props,
boolean isInitialConnection,
JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc)
throws java.sql.SQLException
ConnectionPluginConnectionProvider has been set with
Driver.setCustomConnectionProvider(ConnectionProvider) and
ConnectionProvider.acceptsUrl(String, HostSpec, Properties) returns true for the given
protocol, host, and properties, the connection will be created by the non-default
ConnectionProvider. Otherwise, the connection will be created by the default
ConnectionProvider. The default ConnectionProvider will be DriverConnectionProvider for
connections requested via the DriverManager and
DataSourceConnectionProvider for connections requested via an
AwsWrapperDataSource.connect in interface ConnectionPluginconnect in class AbstractConnectionPlugindriverProtocol - the driver protocol that should be used to establish the connectionhostSpec - the host details for the desired connectionprops - the connection propertiesisInitialConnection - a boolean indicating whether the current Connection is
establishing an initial physical connection to the database or has
already established a physical connection in the pastconnectFunc - the function to call to continue the connect request down the
connect pipelineConnection to the requested hostjava.sql.SQLException - if there was an error establishing a Connection to the requested
hostprotected java.sql.Connection regularOpenConnection(JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc, boolean isInitialConnection) throws java.sql.SQLException
java.sql.SQLExceptionpublic <T,E extends java.lang.Exception> T execute(java.lang.Class<T> resultClass,
java.lang.Class<E> exceptionClass,
java.lang.Object methodInvokeOn,
java.lang.String methodName,
JdbcCallable<T,E> jdbcMethodFunc,
java.lang.Object[] jdbcMethodArgs)
throws E extends java.lang.Exception
execute in interface ConnectionPluginexecute in class AbstractConnectionPluginE extends java.lang.Exceptionprotected void initProvider()
protected long getNanoTime()
public long getHoldTimeNano()
public void resetRoutingTimeNano()