hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1524295 - in /hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal: HLogPerformanceEvaluation.java TestHLog.java
Date Wed, 18 Sep 2013 05:09:14 GMT
Author: stack
Date: Wed Sep 18 05:09:14 2013
New Revision: 1524295

URL: http://svn.apache.org/r1524295
Log:
HBASE-9569 TestHLog is broken

Modified:
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/HLogPerformanceEvaluation.java
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/HLogPerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/HLogPerformanceEvaluation.java?rev=1524295&r1=1524294&r2=1524295&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/HLogPerformanceEvaluation.java
(original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/HLogPerformanceEvaluation.java
Wed Sep 18 05:09:14 2013
@@ -28,6 +28,7 @@ import java.util.UUID;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -128,6 +129,7 @@ public final class HLogPerformanceEvalua
     boolean verify = false;
     boolean verbose = false;
     boolean cleanup = true;
+    boolean noclosefs = false;
     long roll = Long.MAX_VALUE;
     // Process command line args
     for (int i = 0; i < args.length; i++) {
@@ -155,6 +157,8 @@ public final class HLogPerformanceEvalua
           verbose = true;
         } else if (cmd.equals("-nocleanup")) {
           cleanup = false;
+        } else if (cmd.equals("-noclosefs")) {
+          noclosefs = true;
         } else if (cmd.equals("-roll")) {
           roll = Long.parseLong(args[++i]);
         } else if (cmd.equals("-h")) {
@@ -231,7 +235,8 @@ public final class HLogPerformanceEvalua
         if (cleanup) cleanRegionRootDir(fs, rootRegionDir);
       }
     } finally {
-      fs.close();
+      // We may be called inside a test that wants to keep on using the fs.
+      if (!noclosefs) fs.close();
     }
 
     return(0);
@@ -297,6 +302,7 @@ public final class HLogPerformanceEvalua
     System.err.println("  -keySize <N>     Row key size in byte.");
     System.err.println("  -valueSize <N>   Row/Col value size in byte.");
     System.err.println("  -nocleanup       Do NOT remove test data when done.");
+    System.err.println("  -noclosefs       Do NOT close the filesystem when done.");
     System.err.println("  -nosync          Append without syncing");
     System.err.println("  -verify          Verify edits written in sequence");
     System.err.println("  -verbose         Output extra info; e.g. all edit seq ids when
verifying");
@@ -372,11 +378,11 @@ public final class HLogPerformanceEvalua
    * @return errCode
    * @throws Exception
    */
-  static int innerMain(final String [] args) throws Exception {
-    return ToolRunner.run(HBaseConfiguration.create(), new HLogPerformanceEvaluation(), args);
+  static int innerMain(final Configuration c, final String [] args) throws Exception {
+    return ToolRunner.run(c, new HLogPerformanceEvaluation(), args);
   }
 
   public static void main(String[] args) throws Exception {
-     System.exit(innerMain(args));
+     System.exit(innerMain(HBaseConfiguration.create(), args));
   }
 }

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java?rev=1524295&r1=1524294&r2=1524295&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
(original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
Wed Sep 18 05:09:14 2013
@@ -145,8 +145,9 @@ public class TestHLog  {
     // Run the HPE tool with three threads writing 3000 edits each concurrently.
     // When done, verify that all edits were written and that the order in the
     // WALs is of ascending edit sequence ids.
-    int errCode =
-      HLogPerformanceEvaluation.innerMain(new String [] {"-threads", "3", "-verify", "-iterations",
"3000"});
+    int errCode = HLogPerformanceEvaluation.
+      innerMain(new Configuration(TEST_UTIL.getConfiguration()),
+        new String [] {"-threads", "3", "-verify", "-noclosefs", "-iterations", "3000"});
     assertEquals(0, errCode);
   }
 



Mime
View raw message