hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1067235 - /hbase/trunk/src/test/java/org/apache/hadoop/hbase/filter/TestRandomRowFilter.java
Date Fri, 04 Feb 2011 17:35:51 GMT
Author: apurtell
Date: Fri Feb  4 17:35:51 2011
New Revision: 1067235

URL: http://svn.apache.org/viewvc?rev=1067235&view=rev
Log:
HBASE-2824  A filter that randomly includes rows based on a configured chance; Clarify test

Modified:
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/filter/TestRandomRowFilter.java

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/filter/TestRandomRowFilter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/filter/TestRandomRowFilter.java?rev=1067235&r1=1067234&r2=1067235&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/filter/TestRandomRowFilter.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/filter/TestRandomRowFilter.java Fri
Feb  4 17:35:51 2011
@@ -30,12 +30,12 @@ import junit.framework.TestCase;
 import org.apache.hadoop.hbase.util.Bytes;
 
 public class TestRandomRowFilter extends TestCase {
-  protected RandomRowFilter halfChanceFilter;
+  protected RandomRowFilter quarterChanceFilter;
 
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    halfChanceFilter = new RandomRowFilter(0.25f);
+    quarterChanceFilter = new RandomRowFilter(0.25f);
   }
 
   /**
@@ -47,7 +47,7 @@ public class TestRandomRowFilter extends
     int included = 0;
     int max = 1000000;
     for (int i = 0; i < max; i++) {
-      if (!halfChanceFilter.filterRowKey(Bytes.toBytes("row"), 0, Bytes
+      if (!quarterChanceFilter.filterRowKey(Bytes.toBytes("row"), 0, Bytes
           .toBytes("row").length)) {
         included++;
       }
@@ -66,10 +66,10 @@ public class TestRandomRowFilter extends
    * @throws Exception
    */
   public void testSerialization() throws Exception {
-    RandomRowFilter newFilter = serializationTest(halfChanceFilter);
+    RandomRowFilter newFilter = serializationTest(quarterChanceFilter);
     // use epsilon float comparison
     assertTrue("float should be equal", Math.abs(newFilter.getChance()
-        - halfChanceFilter.getChance()) < 0.000001f);
+        - quarterChanceFilter.getChance()) < 0.000001f);
   }
 
   private RandomRowFilter serializationTest(RandomRowFilter filter)



Mime
View raw message