public class ReplicationConnectionProxy extends MultiHostConnectionProxy implements PingTarget
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowReplicaDownConnections |
protected boolean |
allowSourceDownConnections |
protected boolean |
enableJMX |
protected boolean |
readFromSourceWhenNoReplicas |
protected boolean |
readFromSourceWhenNoReplicasOriginal |
protected boolean |
readOnly |
protected LoadBalancedConnection |
replicasConnection |
protected LoadBalancedConnection |
sourceConnection |
connectionUrl, lastExceptionDealtWith| Modifier and Type | Method and Description |
|---|---|
void |
addReplicaHost(java.lang.String hostPortPair) |
void |
addSlaveHost(java.lang.String hostPortPair)
Deprecated.
|
static ReplicationConnection |
createProxyInstance(ConnectionUrl connectionUrl)
Static factory to create
ReplicationConnection instances. |
void |
doPing()
Pings both l/b connections.
|
long |
getConnectionGroupId() |
JdbcConnection |
getCurrentConnection() |
JdbcConnection |
getMasterConnection()
Deprecated.
|
JdbcConnection |
getReplicasConnection() |
JdbcConnection |
getSlavesConnection()
Deprecated.
|
JdbcConnection |
getSourceConnection() |
boolean |
isHostMaster(java.lang.String hostPortPair)
Deprecated.
|
boolean |
isHostReplica(java.lang.String hostPortPair) |
boolean |
isHostSlave(java.lang.String hostPortPair)
Deprecated.
|
boolean |
isHostSource(java.lang.String hostPortPair) |
boolean |
isReadOnly() |
boolean |
isReplicasConnection()
Checks if current connection is the replicas l/b connection.
|
boolean |
isSlavesConnection()
Deprecated.
|
boolean |
isSourceConnection()
Checks if current connection is the sources l/b connection.
|
void |
promoteReplicaToSource(java.lang.String hostPortPair) |
void |
promoteSlaveToMaster(java.lang.String hostPortPair)
Deprecated.
|
protected void |
propagateProxyDown(JdbcConnection proxyConn)
Propagates the connection proxy down through all live connections.
|
void |
removeMasterHost(java.lang.String hostPortPair)
Deprecated.
|
void |
removeMasterHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse)
Deprecated.
|
void |
removeMasterHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse,
boolean isNowReplica)
Deprecated.
|
void |
removeReplica(java.lang.String hostPortPair) |
void |
removeReplica(java.lang.String hostPortPair,
boolean closeGently) |
void |
removeSlave(java.lang.String hostPortPair)
Deprecated.
|
void |
removeSlave(java.lang.String hostPortPair,
boolean closeGently)
Deprecated.
|
void |
removeSourceHost(java.lang.String hostPortPair) |
void |
removeSourceHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse) |
void |
removeSourceHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse,
boolean isNowReplica) |
void |
setReadOnly(boolean readOnly) |
allowedOnClosedConnection, getParentProxy, getProxy, invoke, setProxyprotected boolean enableJMX
protected boolean allowSourceDownConnections
protected boolean allowReplicaDownConnections
protected boolean readFromSourceWhenNoReplicas
protected boolean readFromSourceWhenNoReplicasOriginal
protected boolean readOnly
protected LoadBalancedConnection sourceConnection
protected LoadBalancedConnection replicasConnection
public static ReplicationConnection createProxyInstance(ConnectionUrl connectionUrl) throws java.sql.SQLException
ReplicationConnection instances.connectionUrl - The connection URL containing the hosts in a replication setup.ReplicationConnection proxy.java.sql.SQLException - if an error occursprotected void propagateProxyDown(JdbcConnection proxyConn)
propagateProxyDown in class MultiHostConnectionProxyproxyConn - The top level connection in the multi-host connections chain.public boolean isSourceConnection()
public boolean isReplicasConnection()
@Deprecated public boolean isSlavesConnection()
isReplicasConnection() instead.public void doPing()
throws java.sql.SQLException
doPing in interface PingTargetjava.sql.SQLExceptionpublic JdbcConnection getCurrentConnection()
public long getConnectionGroupId()
public JdbcConnection getSourceConnection()
@Deprecated public JdbcConnection getMasterConnection()
getSourceConnection() instead.JdbcConnectionpublic void promoteReplicaToSource(java.lang.String hostPortPair)
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void promoteSlaveToMaster(java.lang.String hostPortPair)
throws java.sql.SQLException
promoteReplicaToSource(String) instead.hostPortPair - host:portjava.sql.SQLExceptionpublic void removeSourceHost(java.lang.String hostPortPair)
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void removeMasterHost(java.lang.String hostPortPair)
throws java.sql.SQLException
removeSourceHost(String) instead.hostPortPair - host:portjava.sql.SQLExceptionpublic void removeSourceHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse)
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void removeMasterHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse)
throws java.sql.SQLException
removeSourceHost(String, boolean) instead.hostPortPair - host:portwaitUntilNotInUse - remove only when not in usejava.sql.SQLExceptionpublic void removeSourceHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse,
boolean isNowReplica)
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void removeMasterHost(java.lang.String hostPortPair,
boolean waitUntilNotInUse,
boolean isNowReplica)
throws java.sql.SQLException
removeSourceHost(String, boolean, boolean) instead.hostPortPair - host:portwaitUntilNotInUse - remove only when not in useisNowReplica - place to replicasjava.sql.SQLExceptionpublic boolean isHostSource(java.lang.String hostPortPair)
@Deprecated public boolean isHostMaster(java.lang.String hostPortPair)
isHostSource(String) instead.hostPortPair - host:portpublic JdbcConnection getReplicasConnection()
@Deprecated public JdbcConnection getSlavesConnection()
getReplicasConnection() instead.JdbcConnectionpublic void addReplicaHost(java.lang.String hostPortPair)
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void addSlaveHost(java.lang.String hostPortPair)
throws java.sql.SQLException
addReplicaHost(String) instead.hostPortPair - host:portjava.sql.SQLExceptionpublic void removeReplica(java.lang.String hostPortPair)
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void removeSlave(java.lang.String hostPortPair)
throws java.sql.SQLException
removeReplica(String) instead.hostPortPair - host:portjava.sql.SQLExceptionpublic void removeReplica(java.lang.String hostPortPair,
boolean closeGently)
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void removeSlave(java.lang.String hostPortPair,
boolean closeGently)
throws java.sql.SQLException
removeReplica(String, boolean) instead.hostPortPair - host:portcloseGently - optionjava.sql.SQLExceptionpublic boolean isHostReplica(java.lang.String hostPortPair)
@Deprecated public boolean isHostSlave(java.lang.String hostPortPair)
isHostReplica(String) instead.hostPortPair - host:portpublic void setReadOnly(boolean readOnly)
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean isReadOnly()
throws java.sql.SQLException
java.sql.SQLException