Navigation Menu

Skip to content

Commit

Permalink
Removing synchronized keyword from the static and private methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay Soman committed Apr 23, 2013
1 parent 77e08d7 commit cc89784
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/java/voldemort/client/rebalance/RebalancePartitionsInfo.java
Expand Up @@ -93,7 +93,7 @@ public RebalancePartitionsInfo(int stealerNodeId,
this.initialCluster = Utils.notNull(initialCluster);
}

private synchronized void findMaxReplicaType(HashMap<String, HashMap<Integer, List<Integer>>> storeToReplicaToPartitionList) {
private void findMaxReplicaType(HashMap<String, HashMap<Integer, List<Integer>>> storeToReplicaToPartitionList) {
for(Entry<String, HashMap<Integer, List<Integer>>> entry: storeToReplicaToPartitionList.entrySet()) {
for(Entry<Integer, List<Integer>> replicaToPartitionList: entry.getValue().entrySet()) {
if(replicaToPartitionList.getKey() > this.maxReplica) {
Expand All @@ -103,7 +103,7 @@ private synchronized void findMaxReplicaType(HashMap<String, HashMap<Integer, Li
}
}

public synchronized static RebalancePartitionsInfo create(String line) {
public static RebalancePartitionsInfo create(String line) {
try {
JsonReader reader = new JsonReader(new StringReader(line));
Map<String, ?> map = reader.readObject();
Expand All @@ -113,7 +113,7 @@ public synchronized static RebalancePartitionsInfo create(String line) {
}
}

public synchronized static RebalancePartitionsInfo create(Map<?, ?> map) {
public static RebalancePartitionsInfo create(Map<?, ?> map) {
int stealerId = (Integer) map.get("stealerId");
int donorId = (Integer) map.get("donorId");
List<String> unbalancedStoreList = Utils.uncheckedCast(map.get("unbalancedStores"));
Expand Down Expand Up @@ -321,7 +321,7 @@ public synchronized String toJsonString() {
}

@Override
public boolean equals(Object o) {
public synchronized boolean equals(Object o) {
if(this == o)
return true;
if(o == null || getClass() != o.getClass())
Expand All @@ -348,7 +348,7 @@ public boolean equals(Object o) {
}

@Override
public int hashCode() {
public synchronized int hashCode() {
int result = stealerId;
result = 31 * result + donorId;
result = 31 * result + initialCluster.hashCode();
Expand Down

0 comments on commit cc89784

Please sign in to comment.