hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1087586 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java src/site/xdoc/bulk-loads.xml
Date Fri, 01 Apr 2011 05:34:51 GMT
Author: stack
Date: Fri Apr  1 05:34:51 2011
New Revision: 1087586

URL: http://svn.apache.org/viewvc?rev=1087586&view=rev
Log:
HBASE-3705 Allow passing timestamp into importtsv

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
    hbase/trunk/src/site/xdoc/bulk-loads.xml

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1087586&r1=1087585&r2=1087586&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Fri Apr  1 05:34:51 2011
@@ -116,6 +116,7 @@ Release 0.91.0 - Unreleased
                HBaseAdmin methods (David Butler via Stack)
    HBASE-3720  Book.xml - porting conceptual-view / physical-view sections of
                HBaseArchitecture wiki (Doug Meil via Stack)
+   HBASE-3705  Allow passing timestamp into importtsv (Andy Sautins via Stack)
 
   TASK
    HBASE-3559  Move report of split to master OFF the heartbeat channel

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java?rev=1087586&r1=1087585&r2=1087586&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java Fri Apr  1
05:34:51 2011
@@ -63,6 +63,7 @@ public class ImportTsv {
   final static String BULK_OUTPUT_CONF_KEY = "importtsv.bulk.output";
   final static String COLUMNS_CONF_KEY = "importtsv.columns";
   final static String SEPARATOR_CONF_KEY = "importtsv.separator";
+  final static String TIMESTAMP_CONF_KEY = "importtsv.timestamp";
   final static String DEFAULT_SEPARATOR = "\t";
 
   static class TsvParser {
@@ -220,7 +221,7 @@ public class ImportTsv {
       if (parser.getRowKeyColumnIndex() == -1) {
         throw new RuntimeException("No row key column specified");
       }
-      ts = System.currentTimeMillis();
+      ts = conf.getLong(TIMESTAMP_CONF_KEY, System.currentTimeMillis());
 
       skipBadLines = context.getConfiguration().getBoolean(
         SKIP_LINES_CONF_KEY, true);
@@ -356,7 +357,9 @@ public class ImportTsv {
       "\n" +
       "Other options that may be specified with -D include:\n" +
       "  -D" + SKIP_LINES_CONF_KEY + "=false - fail if encountering an invalid line\n" +
-      "  '-D" + SEPARATOR_CONF_KEY + "=|' - eg separate on pipes instead of tabs";
+      "  '-D" + SEPARATOR_CONF_KEY + "=|' - eg separate on pipes instead of tabs\n" +
+      "  -D" + TIMESTAMP_CONF_KEY + "=currentTimeAsLong - use the specified timestamp for
the import\n";
+
     System.err.println(usage);
   }
 

Modified: hbase/trunk/src/site/xdoc/bulk-loads.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/src/site/xdoc/bulk-loads.xml?rev=1087586&r1=1087585&r2=1087586&view=diff
==============================================================================
--- hbase/trunk/src/site/xdoc/bulk-loads.xml (original)
+++ hbase/trunk/src/site/xdoc/bulk-loads.xml Fri Apr  1 05:34:51 2011
@@ -105,6 +105,7 @@ In order to prepare data for a bulk data
 
 Other options that may be specified with -D include:
   -Dimporttsv.skip.bad.lines=false - fail if encountering an invalid line
+  -Dimporttsv.timestamp=currentTimeAsLong - use the specified timestamp for the import
 </pre></code>
     </section>
     <section name="Importing the prepared data using the completebulkload tool">



Mime
View raw message