helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzh...@apache.org
Subject git commit: HELIX-197: fix state model leak, fix compile error, rb=13437
Date Fri, 09 Aug 2013 21:27:25 GMT
Updated Branches:
  refs/heads/master 11df95e81 -> f1a80a40f


HELIX-197: fix state model leak, fix compile error, rb=13437


Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/f1a80a40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/f1a80a40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/f1a80a40

Branch: refs/heads/master
Commit: f1a80a40f37baf788c1df298e005e1ddee4c0bca
Parents: 11df95e
Author: zzhang <zzhang@apache.org>
Authored: Fri Aug 9 14:27:12 2013 -0700
Committer: zzhang <zzhang@apache.org>
Committed: Fri Aug 9 14:27:12 2013 -0700

----------------------------------------------------------------------
 .../java/org/apache/helix/EspressoStorageMockNode.java | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f1a80a40/mockservice/src/main/java/org/apache/helix/EspressoStorageMockNode.java
----------------------------------------------------------------------
diff --git a/mockservice/src/main/java/org/apache/helix/EspressoStorageMockNode.java b/mockservice/src/main/java/org/apache/helix/EspressoStorageMockNode.java
index b196f55..777354f 100644
--- a/mockservice/src/main/java/org/apache/helix/EspressoStorageMockNode.java
+++ b/mockservice/src/main/java/org/apache/helix/EspressoStorageMockNode.java
@@ -20,6 +20,7 @@ package org.apache.helix;
 //import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 //import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 //import java.util.concurrent.ConcurrentMap;
@@ -132,11 +133,10 @@ public class EspressoStorageMockNode extends MockNode {
 	}
 
 	private boolean isPartitionOwnedByNode(String partitionName) {
-		Map<String, StateModel> stateModelMap = _stateModelFactory
-				.getStateModelMap();
-		logger.debug("state model map size: "+stateModelMap.size());
+		Set<String> stateModels = _stateModelFactory.getPartitionSet();
+		logger.debug("state model map size: "+stateModels.size());
 
-		return (stateModelMap.keySet().contains(partitionName));
+		return (stateModels.contains(partitionName));
 	}
 
 	private int getKeyPartition(String dbName, String key) {
@@ -167,9 +167,8 @@ public class EspressoStorageMockNode extends MockNode {
 				synchronized (_partitions) {
 					//logger.debug("Building partition map");
 					_partitions.clear();
-					Map<String, StateModel> stateModelMap = _stateModelFactory
-							.getStateModelMap();
-					for (String s: stateModelMap.keySet()) {
+					Set<String> stateModels = _stateModelFactory.getPartitionSet();
+					for (String s: stateModels) {
 						logger.debug("adding key "+s);
 						_partitions.add(s);
 					}


Mime
View raw message