hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1535199 - in /hbase/branches/0.96: hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Date Wed, 23 Oct 2013 22:22:45 GMT
Author: jxiang
Date: Wed Oct 23 22:22:45 2013
New Revision: 1535199

URL: http://svn.apache.org/r1535199
Log:
HBASE-9821 Scanner id could collide

Modified:
    hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java?rev=1535199&r1=1535198&r2=1535199&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
(original)
+++ hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
Wed Oct 23 22:22:45 2013
@@ -146,6 +146,7 @@ public class ScannerCallable extends Reg
   /**
    * @see java.util.concurrent.Callable#call()
    */
+  @SuppressWarnings("deprecation")
   public Result [] call() throws IOException {
     if (closed) {
       if (scannerId != -1) {
@@ -199,7 +200,8 @@ public class ScannerCallable extends Reg
           updateResultsMetrics(rrs);
         } catch (IOException e) {
           if (logScannerActivity) {
-            LOG.info("Got exception making request " + TextFormat.shortDebugString(request),
e);
+            LOG.info("Got exception making request " + TextFormat.shortDebugString(request)
+              + " to " + getLocation(), e);
           }
           IOException ioe = e;
           if (e instanceof RemoteException) {

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1535199&r1=1535198&r2=1535199&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Wed Oct 23 22:22:45 2013
@@ -2686,8 +2686,7 @@ public class HRegionServer implements Cl
   protected long addScanner(RegionScanner s) throws LeaseStillHeldException {
     long scannerId = -1;
     while (true) {
-      scannerId = rand.nextLong();
-      if (scannerId == -1) continue;
+      scannerId = Math.abs(rand.nextLong() << 24) ^ startcode;
       String scannerName = String.valueOf(scannerId);
       RegionScannerHolder existing = scanners.putIfAbsent(scannerName, new RegionScannerHolder(s));
       if (existing == null) {



Mime
View raw message