hbase-commits mailing list archives

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

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

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

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java?rev=1569126&r1=1569125&r2=1569126&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java
Mon Feb 17 22:33:21 2014
@@ -349,10 +349,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");
@@ -366,7 +363,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