connect to storage server failover with multi IPs

This commit is contained in:
YuQing
2023-12-13 10:06:39 +08:00
parent 020857dbf1
commit bb203bdc71
12 changed files with 404 additions and 56 deletions
@@ -37,15 +37,20 @@ public class TrackerServer {
this.index = index;
}
public Connection getConnection() throws MyException, IOException {
protected Connection getConnection(InetSocketAddress sockAddr) throws MyException, IOException {
Connection connection;
if (ClientGlobal.g_connection_pool_enabled) {
connection = ConnectionPool.getConnection(this.inetSockAddr);
connection = ConnectionPool.getConnection(sockAddr);
} else {
connection = ConnectionFactory.create(this.inetSockAddr);
connection = ConnectionFactory.create(sockAddr);
}
return connection;
}
public Connection getConnection() throws MyException, IOException {
return this.getConnection(this.inetSockAddr);
}
/**
* get the server info
*