You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/10/27 23:47:31 UTC

svn commit: r1190048 - in /hbase/trunk: CHANGES.txt src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java

Author: stack
Date: Thu Oct 27 21:47:31 2011
New Revision: 1190048

URL: http://svn.apache.org/viewvc?rev=1190048&view=rev
Log:
HBASE-4685 TestDistributedLogSplitting.testOrphanLogCreation failing because of ArithmeticException: / by zero.

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1190048&r1=1190047&r2=1190048&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Oct 27 21:47:31 2011
@@ -410,6 +410,8 @@ Release 0.92.0 - Unreleased
    HBASE-4634  "test.build.data" property overused leading to write data at the
                wrong place (nkeywal)
    HBASE-4388  Second start after migration from 90 to trunk crashes
+   HBASE-4685  TestDistributedLogSplitting.testOrphanLogCreation failing because
+               of ArithmeticException: / by zero.
 
   TESTS
    HBASE-4450  test for number of blocks read: to serve as baseline for expected

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java?rev=1190048&r1=1190047&r2=1190048&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java Thu Oct 27 21:47:31 2011
@@ -360,20 +360,22 @@ public class TestDistributedLogSplitting
     int n = hris.size();
     int[] counts = new int[n];
     int j = 0;
-    for (int i = 0; i < num_edits; i += 1) {
-      WALEdit e = new WALEdit();
-      byte [] row = Bytes.toBytes("r" + Integer.toString(i));
-      byte [] family = Bytes.toBytes("f");
-      byte [] qualifier = Bytes.toBytes("c" + Integer.toString(i));
-      e.add(new KeyValue(row, family, qualifier,
-          System.currentTimeMillis(), value));
-      // LOG.info("Region " + i + ": " + e);
-      j++;
-      log.append(hris.get(j % n), table, e, System.currentTimeMillis(), htd);
-      counts[j % n] += 1;
-      // if ((i % 8096) == 0) {
+    if (n > 0) {
+      for (int i = 0; i < num_edits; i += 1) {
+        WALEdit e = new WALEdit();
+        byte [] row = Bytes.toBytes("r" + Integer.toString(i));
+        byte [] family = Bytes.toBytes("f");
+        byte [] qualifier = Bytes.toBytes("c" + Integer.toString(i));
+        e.add(new KeyValue(row, family, qualifier,
+            System.currentTimeMillis(), value));
+        // LOG.info("Region " + i + ": " + e);
+        j++;
+        log.append(hris.get(j % n), table, e, System.currentTimeMillis(), htd);
+        counts[j % n] += 1;
+        // if ((i % 8096) == 0) {
         // log.sync();
-      //  }
+        //  }
+      }
     }
     log.sync();
     log.close();