From e93e1ea73c6ce5f632636c613068ddd877ebb60d Mon Sep 17 00:00:00 2001 From: tedyu Date: Fri, 22 May 2015 19:32:51 -0700 Subject: [PATCH] HBASE-13671 More classes to add to org.apache.hadoop.hbase.mapreduce.driver (li xiang) --- .../org/apache/hadoop/hbase/mapreduce/Driver.java | 12 +++++++++--- .../apache/hadoop/hbase/snapshot/ExportSnapshot.java | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Driver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Driver.java index 4371894a9ee..9737b557b16 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Driver.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Driver.java @@ -22,6 +22,7 @@ import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.mapreduce.replication.VerifyReplication; +import org.apache.hadoop.hbase.snapshot.ExportSnapshot; import org.apache.hadoop.util.ProgramDriver; /** @@ -37,21 +38,26 @@ public class Driver { */ public static void main(String[] args) throws Throwable { ProgramDriver pgd = new ProgramDriver(); + pgd.addClass(RowCounter.NAME, RowCounter.class, - "Count rows in HBase table"); + "Count rows in HBase table."); pgd.addClass(CellCounter.NAME, CellCounter.class, - "Count cells in HBase table"); + "Count cells in HBase table."); pgd.addClass(Export.NAME, Export.class, "Write table data to HDFS."); pgd.addClass(Import.NAME, Import.class, "Import data written by Export."); pgd.addClass(ImportTsv.NAME, ImportTsv.class, "Import data in TSV format."); pgd.addClass(LoadIncrementalHFiles.NAME, LoadIncrementalHFiles.class, "Complete a bulk data load."); pgd.addClass(CopyTable.NAME, CopyTable.class, - "Export a table from local cluster to peer cluster"); + "Export a table from local cluster to peer cluster."); pgd.addClass(VerifyReplication.NAME, VerifyReplication.class, "Compare" + " the data from tables in two different clusters. WARNING: It" + " doesn't work for incrementColumnValues'd cells since the" + " timestamp is changed after being appended to the log."); + pgd.addClass(WALPlayer.NAME, WALPlayer.class, "Replay WAL files."); + pgd.addClass(ExportSnapshot.NAME, ExportSnapshot.class, "Export" + + " the specific snapshot to a given FileSystem."); + ProgramDriver.class.getMethod("driver", new Class [] {String[].class}). invoke(pgd, new Object[]{args}); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java index 2655e2b6db9..5021c74b790 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java @@ -86,6 +86,8 @@ import org.apache.hadoop.util.ToolRunner; @InterfaceAudience.Public @InterfaceStability.Evolving public class ExportSnapshot extends Configured implements Tool { + public static final String NAME = "exportsnapshot"; + private static final Log LOG = LogFactory.getLog(ExportSnapshot.class); private static final String MR_NUM_MAPS = "mapreduce.job.maps";