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 2013/04/02 19:44:56 UTC

svn commit: r1463642 - /hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java

Author: stack
Date: Tue Apr  2 17:44:56 2013
New Revision: 1463642

URL: http://svn.apache.org/r1463642
Log:
HBASE-8084 Export could be replaced with IdentityTableMapper

Modified:
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java?rev=1463642&r1=1463641&r2=1463642&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java (original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java Tue Apr  2 17:44:56 2013
@@ -56,31 +56,6 @@ public class Export {
   final static String EXPORT_BATCHING = "hbase.export.scanner.batch";
 
   /**
-   * Mapper.
-   */
-  static class Exporter
-  extends TableMapper<ImmutableBytesWritable, Result> {
-    /**
-     * @param row  The current table row key.
-     * @param value  The columns.
-     * @param context  The current context.
-     * @throws IOException When something is broken with the data.
-     * @see org.apache.hadoop.mapreduce.Mapper#map(KEYIN, VALUEIN,
-     *   org.apache.hadoop.mapreduce.Mapper.Context)
-     */
-    @Override
-    public void map(ImmutableBytesWritable row, Result value,
-      Context context)
-    throws IOException {
-      try {
-        context.write(row, value);
-      } catch (InterruptedException e) {
-        e.printStackTrace();
-      }
-    }
-  }
-
-  /**
    * Sets up the actual job.
    *
    * @param conf  The current configuration.
@@ -94,11 +69,10 @@ public class Export {
     Path outputDir = new Path(args[1]);
     Job job = new Job(conf, NAME + "_" + tableName);
     job.setJobName(NAME + "_" + tableName);
-    job.setJarByClass(Exporter.class);
+    job.setJarByClass(Export.class);
     // Set optional scan parameters
     Scan s = getConfiguredScanForJob(conf, args);
-    TableMapReduceUtil.initTableMapperJob(tableName, s, Exporter.class, null,
-      null, job);
+    IdentityTableMapper.initJob(tableName, s, IdentityTableMapper.class, job);
     // No reducers.  Just write straight to output files.
     job.setNumReduceTasks(0);
     job.setOutputFormatClass(SequenceFileOutputFormat.class);