HBASE-5814 Make HLogPerformanceEvaluation work on top of hdfs

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1327322 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-04-17 23:23:29 +00:00
parent b10f06129b
commit 2a3ca44ea4
1 changed files with 15 additions and 3 deletions

View File

@ -36,6 +36,7 @@ import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
@ -129,7 +130,6 @@ public final class HLogPerformanceEvaluation extends Configured implements Tool
// Process command line args // Process command line args
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
String cmd = args[i]; String cmd = args[i];
try { try {
if (cmd.equals("-threads")) { if (cmd.equals("-threads")) {
numThreads = Integer.parseInt(args[++i]); numThreads = Integer.parseInt(args[++i]);
@ -153,7 +153,12 @@ public final class HLogPerformanceEvaluation extends Configured implements Tool
verbose = true; verbose = true;
} else if (cmd.equals("-roll")) { } else if (cmd.equals("-roll")) {
roll = Long.parseLong(args[++i]); roll = Long.parseLong(args[++i]);
} else if (cmd.equals("-h")) {
printUsageAndExit();
} else if (cmd.equals("--help")) {
printUsageAndExit();
} else { } else {
System.err.println("UNEXPECTED: " + cmd);
printUsageAndExit(); printUsageAndExit();
} }
} catch (Exception e) { } catch (Exception e) {
@ -163,6 +168,7 @@ public final class HLogPerformanceEvaluation extends Configured implements Tool
// Run HLog Performance Evaluation // Run HLog Performance Evaluation
FileSystem fs = FileSystem.get(getConf()); FileSystem fs = FileSystem.get(getConf());
LOG.info("" + fs);
try { try {
if (rootRegionDir == null) { if (rootRegionDir == null) {
rootRegionDir = TEST_UTIL.getDataTestDir("HLogPerformanceEvaluation"); rootRegionDir = TEST_UTIL.getDataTestDir("HLogPerformanceEvaluation");
@ -280,6 +286,12 @@ public final class HLogPerformanceEvaluation extends Configured implements Tool
System.err.println(" -verify Verify edits written in sequence"); System.err.println(" -verify Verify edits written in sequence");
System.err.println(" -verbose Output extra info; e.g. all edit seq ids when verifying"); System.err.println(" -verbose Output extra info; e.g. all edit seq ids when verifying");
System.err.println(" -roll <N> Roll the way every N appends"); System.err.println(" -roll <N> Roll the way every N appends");
System.err.println("");
System.err.println("Examples:");
System.err.println("");
System.err.println(" To run 100 threads on hdfs with log rolling every 10k edits and verification afterward do:");
System.err.println(" $ ./bin/hbase org.apache.hadoop.hbase.regionserver.wal.HLogPerformanceEvaluation \\");
System.err.println(" -conf ./core-site.xml -path hdfs://example.org:7000/tmp -threads 100 -roll 10000 -verify");
System.exit(1); System.exit(1);
} }
@ -337,7 +349,7 @@ public final class HLogPerformanceEvaluation extends Configured implements Tool
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
int exitCode = ToolRunner.run(new HLogPerformanceEvaluation(), args); int exitCode = ToolRunner.run(HBaseConfiguration.create(), new HLogPerformanceEvaluation(), args);
System.exit(exitCode); System.exit(exitCode);
} }
} }