hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [6/9] hbase git commit: HBASE-17855 Fix typo in async client implementation
Date Fri, 31 Mar 2017 22:54:36 GMT
HBASE-17855 Fix typo in async client implementation


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

Branch: refs/heads/hbase-12439
Commit: 0ec1459467f280280630e5b597bef302ec43cedd
Parents: d033cbb
Author: zhangduo <zhangduo@apache.org>
Authored: Fri Mar 31 09:37:20 2017 +0800
Committer: zhangduo <zhangduo@apache.org>
Committed: Fri Mar 31 13:00:27 2017 +0800

----------------------------------------------------------------------
 .../hbase/client/AsyncMetaRegionLocator.java    | 35 ++++++++++----------
 .../hbase/client/AsyncNonMetaRegionLocator.java |  3 +-
 .../hadoop/hbase/client/AsyncRegionLocator.java |  2 +-
 .../client/AbstractTestAsyncTableScan.java      |  8 ++---
 4 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0ec14594/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java
index 5b7a68f..6e7dba7 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java
@@ -94,25 +94,26 @@ class AsyncMetaRegionLocator {
   }
 
   void updateCachedLocation(HRegionLocation loc, Throwable exception) {
-    updateCachedLoation(loc, exception, l -> metaRegionLocation.get(), newLoc -> {
-      for (;;) {
-        HRegionLocation oldLoc = metaRegionLocation.get();
-        if (oldLoc != null && (oldLoc.getSeqNum() > newLoc.getSeqNum()
-            || oldLoc.getServerName().equals(newLoc.getServerName()))) {
-          return;
-        }
-        if (metaRegionLocation.compareAndSet(oldLoc, newLoc)) {
-          return;
+    AsyncRegionLocator.updateCachedLocation(loc, exception, l -> metaRegionLocation.get(),
+      newLoc -> {
+        for (;;) {
+          HRegionLocation oldLoc = metaRegionLocation.get();
+          if (oldLoc != null && (oldLoc.getSeqNum() > newLoc.getSeqNum() ||
+              oldLoc.getServerName().equals(newLoc.getServerName()))) {
+            return;
+          }
+          if (metaRegionLocation.compareAndSet(oldLoc, newLoc)) {
+            return;
+          }
         }
-      }
-    }, l -> {
-      for (;;) {
-        HRegionLocation oldLoc = metaRegionLocation.get();
-        if (!canUpdate(l, oldLoc) || metaRegionLocation.compareAndSet(oldLoc, null)) {
-          return;
+      }, l -> {
+        for (;;) {
+          HRegionLocation oldLoc = metaRegionLocation.get();
+          if (!canUpdate(l, oldLoc) || metaRegionLocation.compareAndSet(oldLoc, null)) {
+            return;
+          }
         }
-      }
-    });
+      });
   }
 
   void clearCache() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/0ec14594/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java
index dcf2c91..3dc9537 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java
@@ -22,7 +22,6 @@ import static org.apache.hadoop.hbase.HConstants.NINES;
 import static org.apache.hadoop.hbase.HConstants.ZEROES;
 import static org.apache.hadoop.hbase.HRegionInfo.createRegionName;
 import static org.apache.hadoop.hbase.TableName.META_TABLE_NAME;
-import static org.apache.hadoop.hbase.client.AsyncRegionLocator.updateCachedLoation;
 import static org.apache.hadoop.hbase.client.ConnectionUtils.createClosestRowAfter;
 import static org.apache.hadoop.hbase.client.ConnectionUtils.isEmptyStopRow;
 import static org.apache.hadoop.hbase.util.Bytes.BYTES_COMPARATOR;
@@ -442,7 +441,7 @@ class AsyncNonMetaRegionLocator {
   }
 
   void updateCachedLocation(HRegionLocation loc, Throwable exception) {
-    updateCachedLoation(loc, exception, l -> {
+    AsyncRegionLocator.updateCachedLocation(loc, exception, l -> {
       TableCache tableCache = cache.get(l.getRegionInfo().getTable());
       if (tableCache == null) {
         return null;

http://git-wip-us.apache.org/repos/asf/hbase/blob/0ec14594/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java
index 7030eac..1c65472 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java
@@ -98,7 +98,7 @@ class AsyncRegionLocator {
         && oldLoc.getServerName().equals(loc.getServerName());
   }
 
-  static void updateCachedLoation(HRegionLocation loc, Throwable exception,
+  static void updateCachedLocation(HRegionLocation loc, Throwable exception,
       Function<HRegionLocation, HRegionLocation> cachedLocationSupplier,
       Consumer<HRegionLocation> addToCache, Consumer<HRegionLocation> removeFromCache)
{
     HRegionLocation oldLoc = cachedLocationSupplier.apply(loc);

http://git-wip-us.apache.org/repos/asf/hbase/blob/0ec14594/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
index 661ffe2..d4409ca 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
@@ -237,11 +237,11 @@ public abstract class AbstractTestAsyncTableScan {
 
   @Test
   public void testScanWithLimit() throws Exception {
- //   testScan(1, true, 998, false, 900); // from first region to last region
+    testScan(1, true, 998, false, 900); // from first region to last region
     testScan(123, true, 234, true, 100);
-  //  testScan(234, true, 456, false, 100);
- //   testScan(345, false, 567, true, 100);
- //   testScan(456, false, 678, false, 100);
+    testScan(234, true, 456, false, 100);
+    testScan(345, false, 567, true, 100);
+    testScan(456, false, 678, false, 100);
   }
 
   @Test


Mime
View raw message