Re-format source to respect Jedis convention
This commit is contained in:
@@ -14,13 +14,13 @@ public abstract class JedisClusterConnectionHandler {
|
||||
abstract Jedis getConnection();
|
||||
|
||||
public void returnConnection(Jedis connection) {
|
||||
cache.getNode(getNodeKey(connection.getClient()))
|
||||
.returnResource(connection);
|
||||
cache.getNode(getNodeKey(connection.getClient())).returnResource(
|
||||
connection);
|
||||
}
|
||||
|
||||
public void returnBrokenConnection(Jedis connection) {
|
||||
cache.getNode(getNodeKey(connection.getClient()))
|
||||
.returnBrokenResource(connection);
|
||||
cache.getNode(getNodeKey(connection.getClient())).returnBrokenResource(
|
||||
connection);
|
||||
}
|
||||
|
||||
abstract Jedis getConnectionFromSlot(int slot);
|
||||
|
||||
@@ -36,7 +36,8 @@ public class JedisClusterInfoCache {
|
||||
|
||||
HostAndPort targetNode = clusterNodeInfo.getNode();
|
||||
setNodeIfNotExist(targetNode);
|
||||
assignSlotsToNode(clusterNodeInfo.getAvailableSlots(), targetNode);
|
||||
assignSlotsToNode(clusterNodeInfo.getAvailableSlots(),
|
||||
targetNode);
|
||||
}
|
||||
} finally {
|
||||
w.unlock();
|
||||
@@ -78,8 +79,7 @@ public class JedisClusterInfoCache {
|
||||
}
|
||||
|
||||
private HostAndPort generateHostAndPort(List<Object> hostInfos) {
|
||||
return new HostAndPort(
|
||||
SafeEncoder.encode((byte[]) hostInfos.get(0)),
|
||||
return new HostAndPort(SafeEncoder.encode((byte[]) hostInfos.get(0)),
|
||||
((Long) hostInfos.get(1)).intValue());
|
||||
}
|
||||
|
||||
@@ -172,9 +172,8 @@ public class JedisClusterInfoCache {
|
||||
|
||||
private List<Integer> getAssignedSlotArray(List<Object> slotInfo) {
|
||||
List<Integer> slotNums = new ArrayList<Integer>();
|
||||
for (int slot = ((Long) slotInfo.get(0)).intValue();
|
||||
slot <= ((Long) slotInfo.get(1)).intValue();
|
||||
slot++) {
|
||||
for (int slot = ((Long) slotInfo.get(0)).intValue(); slot <= ((Long) slotInfo
|
||||
.get(1)).intValue(); slot++) {
|
||||
slotNums.add(slot);
|
||||
}
|
||||
return slotNums;
|
||||
|
||||
Reference in New Issue
Block a user