From 940ffa9372ef9ee6596269350c151c42299f0f46 Mon Sep 17 00:00:00 2001 From: Istvan Toth Date: Thu, 25 Apr 2024 15:56:42 +0200 Subject: [PATCH] HBASE-28518 Allow specifying a filter for the REST multiget endpoint (addendum: add back SCAN_FILTER constant) (#5852) Signed-off-by: Duo Zhang --- .../main/java/org/apache/hadoop/hbase/rest/Constants.java | 6 ++++++ .../java/org/apache/hadoop/hbase/rest/MultiRowResource.java | 1 - .../java/org/apache/hadoop/hbase/rest/TableResource.java | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java index 71080de07dd8..8d606793be64 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java @@ -86,6 +86,12 @@ public interface Constants { String SCAN_LIMIT = "limit"; String SCAN_FETCH_SIZE = "hbase.rest.scan.fetchsize"; String FILTER = "filter"; + /** + * @deprecated Since 2.4.18/2.5.9/2.6.0, will be removed in 4.0.0. Please use {@link #FILTER} + * instead. + */ + @Deprecated + String SCAN_FILTER = FILTER; String FILTER_B64 = "filter_b64"; String SCAN_REVERSED = "reversed"; String SCAN_CACHE_BLOCKS = "cacheblocks"; diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/MultiRowResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/MultiRowResource.java index 47b3c22a7c95..4c2f6c3216bd 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/MultiRowResource.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/MultiRowResource.java @@ -87,7 +87,6 @@ public Response get(final @Context UriInfo uriInfo, if (paramFilterB64 != null) { filterBytes = base64Urldecoder.decode(paramFilterB64); } else if (paramFilter != null) { - // Not binary clean filterBytes = paramFilter.getBytes(); } 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 fc3fb6bf7057..b311e7b0eb77 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 @@ -183,7 +183,6 @@ public TableScanResource getScanResource(final @PathParam("scanspec") String sca if (paramFilterB64 != null) { filterBytes = base64Urldecoder.decode(paramFilterB64); } else if (paramFilter != null) { - // Not binary clean filterBytes = paramFilter.getBytes(); } if (filterBytes != null) {