hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject hbase git commit: HBASE-13352 Add hbase.import.version to Import usage (Lars Hofhansl)
Date Mon, 06 Jul 2015 23:04:15 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.0 4b934b573 -> 955d02a87


HBASE-13352 Add hbase.import.version to Import usage (Lars Hofhansl)

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/955d02a8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/955d02a8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/955d02a8

Branch: refs/heads/branch-1.0
Commit: 955d02a873a1bd06fa5c127f808e817655ed2c97
Parents: 4b934b5
Author: Enis Soztutar <enis@apache.org>
Authored: Mon Jul 6 15:39:19 2015 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Mon Jul 6 16:03:06 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/mapreduce/Import.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/955d02a8/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
index 399d607..d4a6cba 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
@@ -54,6 +54,7 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.zookeeper.ZKClusterId;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.TaskCounter;
 import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
 import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
@@ -482,6 +483,8 @@ public class Import {
         + " Filter#filterKeyValue(KeyValue) method to determine if the KeyValue should be
added;"
         + " Filter.ReturnCode#INCLUDE and #INCLUDE_AND_NEXT_COL will be considered as including"
         + " the KeyValue.");
+    System.err.println("To import data exported from HBase 0.94, use");
+    System.err.println("  -Dhbase.import.version=0.94");
     System.err.println("For performance consider the following options:\n"
         + "  -Dmapreduce.map.speculative=false\n"
         + "  -Dmapreduce.reduce.speculative=false\n"
@@ -538,6 +541,16 @@ public class Import {
       // Flush all the regions of the table
       flushRegionsIfNecessary(conf);
     }
+    long inputRecords = job.getCounters().findCounter(TaskCounter.MAP_INPUT_RECORDS).getValue();
+    long outputRecords = job.getCounters().findCounter(TaskCounter.MAP_OUTPUT_RECORDS).getValue();
+    if (outputRecords < inputRecords) {
+      System.err.println("Warning, not all records were imported (maybe filtered out).");
+      if (outputRecords == 0) {
+        System.err.println("If the data was exported from HBase 0.94 "+
+            "consider using -Dhbase.import.version=0.94.");
+      }
+    }
+
     System.exit(job.waitForCompletion(true) ? 0 : 1);
   }
 }


Mime
View raw message