hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [37/50] [abbrv] hbase git commit: HBASE-14928 Start row should be set for query through HBase REST gateway involving globbing option
Date Mon, 07 Dec 2015 16:56:14 GMT
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/hbase-12439
Commit: d18c1af3bb12d6bf1800f22a5289bcb71020bb65
Parents: 03e4712
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri Dec 4 12:04:30 2015 -0800
Committer: tedyu <yuzhihong@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(":");


Mime
View raw message