public class GdbReadWriteSplittingPlugin extends ReadWriteSplittingPlugin implements StateSnapshotProvider
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<java.lang.String> |
accessibleRegions |
static AwsWrapperProperty |
ENABLE_GWF |
protected boolean |
enableGwf |
protected java.lang.String |
homeRegion |
protected boolean |
isInit |
protected RdsUtils |
rdsHelper |
static AwsWrapperProperty |
RESTRICT_READER_TO_HOME_REGION |
static AwsWrapperProperty |
RESTRICT_WRITER_TO_HOME_REGION |
protected boolean |
restrictReaderToHomeRegion |
protected boolean |
restrictWriterToHomeRegion |
static AwsWrapperProperty |
RW_HOME_REGION |
hosts, READER_HOST_SELECTOR_STRATEGY, readerSelectorStrategy, VERIFY_INITIAL_CONNECTION_ROLE, verifyInitialConnectionRoleCACHED_READER_KEEP_ALIVE_TIMEOUT, hostListProviderService, inReadWriteSplit, isReaderConnFromInternalPool, isWriterConnFromInternalPool, pluginService, properties, readerCacheItem, readerHostSpec, writerConnection, writerHostSpec| Constructor and Description |
|---|
GdbReadWriteSplittingPlugin(PluginService pluginService,
@NonNull java.util.Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
java.sql.Connection |
connect(java.lang.String driverProtocol,
HostSpec hostSpec,
java.util.Properties props,
boolean isInitialConnection,
@NonNull JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc)
Establishes a connection to the given host using the given driver protocol and properties.
|
protected java.util.List<HostSpec> |
getReaderHostCandidates() |
java.util.List<Pair<java.lang.String,java.lang.Object>> |
getSnapshotState() |
protected void |
initializeWriterConnection() |
protected void |
initSettings(HostSpec initHostSpec,
java.util.Properties props) |
protected boolean |
isInAccessibleRegion(HostSpec host) |
protected void |
setWriterConnection(java.sql.Connection conn,
HostSpec host) |
closeReaderIfNecessary, initializeReaderConnection, isReader, isWriter, openNewReaderConnection, refreshAndStoreTopology, shouldUpdateReaderConnection, shouldUpdateWriterConnectioncloseReaderConnectionIfIdle, closeWriterConnectionIfIdle, execute, getKeepAliveTimeout, getReaderConnection, getReaderHostSpec, getSubscribedMethods, getWriterConnection, getWriterHostSpec, initHostProvider, isConnectionUsable, logAndThrowException, logAndThrowException, notifyConnectionChanged, releaseResources, setReaderConnection, switchConnectionIfRequired, switchCurrentConnectionToacceptsStrategy, forceConnect, getHostSpecByStrategy, getHostSpecByStrategy, notifyNodeListChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreleaseResourcespublic static final AwsWrapperProperty RW_HOME_REGION
public static final AwsWrapperProperty RESTRICT_WRITER_TO_HOME_REGION
public static final AwsWrapperProperty RESTRICT_READER_TO_HOME_REGION
public static final AwsWrapperProperty ENABLE_GWF
protected boolean isInit
protected final RdsUtils rdsHelper
protected java.lang.String homeRegion
protected final boolean restrictWriterToHomeRegion
protected final boolean restrictReaderToHomeRegion
protected final boolean enableGwf
protected java.util.Set<java.lang.String> accessibleRegions
public GdbReadWriteSplittingPlugin(PluginService pluginService, @NonNull java.util.Properties properties)
protected void initSettings(HostSpec initHostSpec, java.util.Properties props) throws java.sql.SQLException
java.sql.SQLExceptionpublic java.sql.Connection connect(java.lang.String driverProtocol,
HostSpec hostSpec,
java.util.Properties props,
boolean isInitialConnection,
@NonNull 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 ReadWriteSplittingPlugindriverProtocol - 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 void initializeWriterConnection()
throws java.sql.SQLException
initializeWriterConnection in class ReadWriteSplittingPluginjava.sql.SQLExceptionprotected void setWriterConnection(java.sql.Connection conn,
HostSpec host)
throws java.sql.SQLException
setWriterConnection in class AbstractReadWriteSplittingPluginjava.sql.SQLExceptionprotected java.util.List<HostSpec> getReaderHostCandidates() throws java.sql.SQLException
getReaderHostCandidates in class ReadWriteSplittingPluginjava.sql.SQLExceptionprotected boolean isInAccessibleRegion(HostSpec host)
public java.util.List<Pair<java.lang.String,java.lang.Object>> getSnapshotState()
getSnapshotState in interface StateSnapshotProvidergetSnapshotState in class ReadWriteSplittingPlugin