Remove redundant synchronized from JedisClusterInfoCache
* JedisClusterInfoCache already uses RWLock so synchonized keyword is not necessary ** it just slow down whole throughput
This commit is contained in:
@@ -118,7 +118,7 @@ public class JedisClusterInfoCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void assignSlotsToNode(List<Integer> targetSlots,
|
public void assignSlotsToNode(List<Integer> targetSlots,
|
||||||
HostAndPort targetNode) {
|
HostAndPort targetNode) {
|
||||||
w.lock();
|
w.lock();
|
||||||
try {
|
try {
|
||||||
@@ -137,7 +137,7 @@ public class JedisClusterInfoCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized JedisPool getNode(String nodeKey) {
|
public JedisPool getNode(String nodeKey) {
|
||||||
r.lock();
|
r.lock();
|
||||||
try {
|
try {
|
||||||
return nodes.get(nodeKey);
|
return nodes.get(nodeKey);
|
||||||
@@ -146,7 +146,7 @@ public class JedisClusterInfoCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized JedisPool getSlotPool(int slot) {
|
public JedisPool getSlotPool(int slot) {
|
||||||
r.lock();
|
r.lock();
|
||||||
try {
|
try {
|
||||||
return slots.get(slot);
|
return slots.get(slot);
|
||||||
@@ -155,7 +155,7 @@ public class JedisClusterInfoCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized Map<String, JedisPool> getNodes() {
|
public Map<String, JedisPool> getNodes() {
|
||||||
r.lock();
|
r.lock();
|
||||||
try {
|
try {
|
||||||
return new HashMap<String, JedisPool>(nodes);
|
return new HashMap<String, JedisPool>(nodes);
|
||||||
|
|||||||
Reference in New Issue
Block a user