You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2015/12/04 21:04:40 UTC

hbase git commit: HBASE-14928 Start row should be set for query through HBase REST gateway involving globbing option

Repository: hbase
Updated Branches:
  refs/heads/master 03e4712f0 -> d18c1af3b


HBASE-14928 Start row should be set for query through HBase REST gateway involving globbing option


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

Branch: refs/heads/master
Commit: d18c1af3bb12d6bf1800f22a5289bcb71020bb65
Parents: 03e4712
Author: tedyu <yu...@gmail.com>
Authored: Fri Dec 4 12:04:30 2015 -0800
Committer: tedyu <yu...@gmail.com>
Committed: Fri Dec 4 12:04:30 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/rest/TableResource.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d18c1af3/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
index 556425f..f87ef7e 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
@@ -137,20 +137,26 @@ public class TableResource extends ResourceBase {
       @DefaultValue("") @QueryParam(Constants.SCAN_FILTER) String filters) {
     try {
       Filter filter = null;
+      Scan tableScan = new Scan();
       if (scanSpec.indexOf('*') > 0) {
         String prefix = scanSpec.substring(0, scanSpec.indexOf('*'));
+        byte[] prefixBytes = Bytes.toBytes(prefix);
         filter = new PrefixFilter(Bytes.toBytes(prefix));
+        if (startRow.isEmpty()) {
+          tableScan.setStartRow(prefixBytes);
+        }
       }
       LOG.debug("Query parameters  : Table Name = > " + this.table + " Start Row => " + startRow
           + " End Row => " + endRow + " Columns => " + column + " Start Time => " + startTime
           + " End Time => " + endTime + " Cache Blocks => " + cacheBlocks + " Max Versions => "
           + maxVersions + " Batch Size => " + batchSize);
       Table hTable = RESTServlet.getInstance().getTable(this.table);
-      Scan tableScan = new Scan();
       tableScan.setBatch(batchSize);
       tableScan.setMaxVersions(maxVersions);
       tableScan.setTimeRange(startTime, endTime);
-      tableScan.setStartRow(Bytes.toBytes(startRow));
+      if (!startRow.isEmpty()) {
+        tableScan.setStartRow(Bytes.toBytes(startRow));
+      }
       tableScan.setStopRow(Bytes.toBytes(endRow));
       for (String csplit : column) {
         String[] familysplit = csplit.trim().split(":");