hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-15479 No more garbage or beware of autoboxing (Vladimir Rodionov)
Date Sun, 20 Mar 2016 04:21:28 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 14c0e7795 -> d5bf8c86d


HBASE-15479 No more garbage or beware of autoboxing (Vladimir Rodionov)


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

Branch: refs/heads/branch-1.1
Commit: d5bf8c86d21fb24c17fbc8ad72f4a5c9ccd034ba
Parents: 14c0e77
Author: tedyu <yuzhihong@gmail.com>
Authored: Sat Mar 19 21:21:20 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Sat Mar 19 21:21:20 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/client/AsyncProcess.java    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d5bf8c86/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
index 04b90dc..49552b0 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
@@ -356,7 +356,7 @@ class AsyncProcess {
 
       // Remember the previous decisions about regions or region servers we put in the
       //  final multi.
-      Map<Long, Boolean> regionIncluded = new HashMap<Long, Boolean>();
+      Map<HRegionInfo, Boolean> regionIncluded = new HashMap<HRegionInfo, Boolean>();
       Map<ServerName, Boolean> serverIncluded = new HashMap<ServerName, Boolean>();
 
       int posInList = -1;
@@ -456,10 +456,10 @@ class AsyncProcess {
    * @return true if this region is considered as busy.
    */
   protected boolean canTakeOperation(HRegionLocation loc,
-                                     Map<Long, Boolean> regionsIncluded,
+                                     Map<HRegionInfo, Boolean> regionsIncluded,
                                      Map<ServerName, Boolean> serversIncluded) {
-    long regionId = loc.getRegionInfo().getRegionId();
-    Boolean regionPrevious = regionsIncluded.get(regionId);
+    HRegionInfo regionInfo = loc.getRegionInfo();
+    Boolean regionPrevious = regionsIncluded.get(regionInfo);
 
     if (regionPrevious != null) {
       // We already know what to do with this region.
@@ -469,14 +469,14 @@ class AsyncProcess {
     Boolean serverPrevious = serversIncluded.get(loc.getServerName());
     if (Boolean.FALSE.equals(serverPrevious)) {
       // It's a new region, on a region server that we have already excluded.
-      regionsIncluded.put(regionId, Boolean.FALSE);
+      regionsIncluded.put(regionInfo, Boolean.FALSE);
       return false;
     }
 
     AtomicInteger regionCnt = taskCounterPerRegion.get(loc.getRegionInfo().getRegionName());
     if (regionCnt != null && regionCnt.get() >= maxConcurrentTasksPerRegion) {
       // Too many tasks on this region already.
-      regionsIncluded.put(regionId, Boolean.FALSE);
+      regionsIncluded.put(regionInfo, Boolean.FALSE);
       return false;
     }
 
@@ -499,7 +499,7 @@ class AsyncProcess {
       }
 
       if (!ok) {
-        regionsIncluded.put(regionId, Boolean.FALSE);
+        regionsIncluded.put(regionInfo, Boolean.FALSE);
         serversIncluded.put(loc.getServerName(), Boolean.FALSE);
         return false;
       }
@@ -509,7 +509,7 @@ class AsyncProcess {
       assert serverPrevious.equals(Boolean.TRUE);
     }
 
-    regionsIncluded.put(regionId, Boolean.TRUE);
+    regionsIncluded.put(regionInfo, Boolean.TRUE);
 
     return true;
   }


Mime
View raw message