hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1569128 - /hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java
Date Mon, 17 Feb 2014 22:34:21 GMT
Author: larsh
Date: Mon Feb 17 22:34:20 2014
New Revision: 1569128

URL: http://svn.apache.org/r1569128
Log:
HBASE-10552 HFilePerformanceEvaluation.GaussianRandomReadBenchmark fails sometimes.

Modified:
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java?rev=1569128&r1=1569127&r2=1569128&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java
(original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java
Mon Feb 17 22:34:20 2014
@@ -347,10 +347,7 @@ public class HFilePerformanceEvaluation 
     void doRow(int i) throws Exception {
       HFileScanner scanner = this.reader.getScanner(false, true);
       byte[] gaussianRandomRowBytes = getGaussianRandomRowBytes();
-      if (scanner.seekTo(gaussianRandomRowBytes) < 0) {
-        LOG.info("Not able to seekTo " + new String(gaussianRandomRowBytes));
-        return;
-      }
+      scanner.seekTo(gaussianRandomRowBytes);
       for (int ii = 0; ii < 30; ii++) {
         if (!scanner.next()) {
           LOG.info("NOTHING FOLLOWS");
@@ -364,7 +361,8 @@ public class HFilePerformanceEvaluation 
     private byte [] getGaussianRandomRowBytes() {
       int r = (int) randomData.nextGaussian((double)totalRows / 2.0,
           (double)totalRows / 10.0);
-      return format(r);
+      // make sure r falls into [0,totalRows)
+      return format(Math.min(totalRows, Math.max(r,0)));
     }
   }
 



Mime
View raw message