|
|
@ -61,7 +61,7 @@ public class ClientConnectionsEntry {
|
|
|
|
public ClientConnectionsEntry(RedisClient client, int poolMinSize, int poolMaxSize, int subscribePoolMinSize, int subscribePoolMaxSize,
|
|
|
|
public ClientConnectionsEntry(RedisClient client, int poolMinSize, int poolMaxSize, int subscribePoolMinSize, int subscribePoolMaxSize,
|
|
|
|
ConnectionManager connectionManager, NodeType nodeType) {
|
|
|
|
ConnectionManager connectionManager, NodeType nodeType) {
|
|
|
|
this.client = client;
|
|
|
|
this.client = client;
|
|
|
|
this.freeConnectionsCounter = new AsyncSemaphore(poolMaxSize);
|
|
|
|
this.freeConnectionsCounter = new AsyncSemaphore(20);
|
|
|
|
this.connectionManager = connectionManager;
|
|
|
|
this.connectionManager = connectionManager;
|
|
|
|
this.nodeType = nodeType;
|
|
|
|
this.nodeType = nodeType;
|
|
|
|
this.freeSubscribeConnectionsCounter = new AsyncSemaphore(subscribePoolMaxSize);
|
|
|
|
this.freeSubscribeConnectionsCounter = new AsyncSemaphore(subscribePoolMaxSize);
|
|
|
@ -161,7 +161,8 @@ public class ClientConnectionsEntry {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public RedisConnection pollConnection() {
|
|
|
|
public RedisConnection pollConnection() {
|
|
|
|
return freeConnections.poll();
|
|
|
|
return freeConnections.peek();
|
|
|
|
|
|
|
|
// return freeConnections.poll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void releaseConnection(RedisConnection connection) {
|
|
|
|
public void releaseConnection(RedisConnection connection) {
|
|
|
@ -175,7 +176,9 @@ public class ClientConnectionsEntry {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
connection.setLastUsageTime(System.nanoTime());
|
|
|
|
connection.setLastUsageTime(System.nanoTime());
|
|
|
|
freeConnections.add(connection);
|
|
|
|
if (freeConnections.isEmpty()) {
|
|
|
|
|
|
|
|
freeConnections.add(connection);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public RFuture<RedisConnection> connect() {
|
|
|
|
public RFuture<RedisConnection> connect() {
|
|
|
|