From dce252082870660d22017313dcd10099e316f428 Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Sun, 29 Jun 2014 18:09:18 +0000 Subject: [PATCH] HBASE-11436 Support start Row and stop Row in HBase Export (Ward Viaene) --- .../java/org/apache/hadoop/hbase/mapreduce/Export.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java index e926f767e72..a69d4e44211 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Export.java @@ -95,6 +95,13 @@ public class Export { s.setTimeRange(startTime, endTime); // Set cache blocks s.setCacheBlocks(false); + // set Start and Stop row + if (conf.get(TableInputFormat.SCAN_ROW_START) != null) { + s.setStartRow(Bytes.toBytes(conf.get(TableInputFormat.SCAN_ROW_START))); + } + if (conf.get(TableInputFormat.SCAN_ROW_STOP) != null) { + s.setStopRow(Bytes.toBytes(conf.get(TableInputFormat.SCAN_ROW_STOP))); + } // Set Scan Column Family boolean raw = Boolean.parseBoolean(conf.get(RAW_SCAN)); if (raw) { @@ -155,6 +162,8 @@ public class Export { System.err.println(" to control/limit what is exported.."); System.err.println(" -D " + TableInputFormat.SCAN_COLUMN_FAMILY + "="); System.err.println(" -D " + RAW_SCAN + "=true"); + System.err.println(" -D " + TableInputFormat.SCAN_ROW_START + "="); + System.err.println(" -D " + TableInputFormat.SCAN_ROW_STOP + "="); System.err.println("For performance consider the following properties:\n" + " -Dhbase.client.scanner.caching=100\n" + " -Dmapreduce.map.speculative=false\n"