hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1457632 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
Date Mon, 18 Mar 2013 04:04:34 GMT
Author: stack
Date: Mon Mar 18 04:04:17 2013
New Revision: 1457632

URL: http://svn.apache.org/r1457632
Log:
HBASE-8077 Configure the job name in ImportTsv

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java?rev=1457632&r1=1457631&r2=1457632&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
Mon Mar 18 04:04:17 2013
@@ -73,6 +73,7 @@ public class ImportTsv extends Configure
   public final static String MAPPER_CONF_KEY = "importtsv.mapper.class";
   public final static String BULK_OUTPUT_CONF_KEY = "importtsv.bulk.output";
   public final static String TIMESTAMP_CONF_KEY = "importtsv.timestamp";
+  public final static String JOB_NAME_CONF_KEY = "mapred.job.name";
   // TODO: the rest of these configs are used exclusively by TsvImporterMapper.
   // Move them out of the tool and let the mapper handle its own validation.
   public final static String SKIP_LINES_CONF_KEY = "importtsv.skip.bad.lines";
@@ -279,7 +280,8 @@ public class ImportTsv extends Configure
 
     String tableName = args[0];
     Path inputDir = new Path(args[1]);
-    Job job = new Job(conf, NAME + "_" + tableName);
+    String jobName = conf.get(JOB_NAME_CONF_KEY,NAME + "_" + tableName);
+    Job job = new Job(conf, jobName);
     job.setJarByClass(mapperClass);
     FileInputFormat.setInputPaths(job, inputDir);
     job.setInputFormatClass(TextInputFormat.class);
@@ -370,6 +372,7 @@ public class ImportTsv extends Configure
       "  -D" + TIMESTAMP_CONF_KEY + "=currentTimeAsLong - use the specified timestamp for
the import\n" +
       "  -D" + MAPPER_CONF_KEY + "=my.Mapper - A user-defined Mapper to use instead of "
+
       DEFAULT_MAPPER.getName() + "\n" +
+      "  -D" + JOB_NAME_CONF_KEY + "=jobName - use the specified mapreduce job name for the
import\n" +
       "For performance consider the following options:\n" +
       "  -Dmapred.map.tasks.speculative.execution=false\n" +
       "  -Dmapred.reduce.tasks.speculative.execution=false";



Mime
View raw message