You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2021/12/21 01:51:16 UTC

[pinot] branch master updated: Move decode method before calling acquireSegment to avoid reference count leak (#7938)

This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 58e7f10  Move decode method before calling acquireSegment to avoid reference count leak (#7938)
58e7f10 is described below

commit 58e7f10c7a0bb8e9137377e913797d54f9b89f8a
Author: Jialiang Li <jl...@linkedin.com>
AuthorDate: Mon Dec 20 17:51:00 2021 -0800

    Move decode method before calling acquireSegment to avoid reference count leak (#7938)
    
    Co-authored-by: Jack Li(Analytics Engineering) <jl...@jlli-mn1.linkedin.biz>
---
 .../pinot/server/api/resources/TablesResource.java       | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java b/pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java
index d353da1..693cabc 100644
--- a/pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java
+++ b/pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java
@@ -259,6 +259,14 @@ public class TablesResource {
       @ApiParam(value = "Segment name", required = true) @PathParam("segmentName") String segmentName,
       @ApiParam(value = "Column name", allowMultiple = true) @QueryParam("columns") @DefaultValue("")
           List<String> columns) {
+    for (int i = 0; i < columns.size(); i++) {
+      try {
+        columns.set(i, URLDecoder.decode(columns.get(i), StandardCharsets.UTF_8.name()));
+      } catch (UnsupportedEncodingException e) {
+        throw new RuntimeException(e.getCause());
+      }
+    }
+
     TableDataManager tableDataManager = ServerResourceUtils.checkGetTableDataManager(_serverInstance, tableName);
     try {
       segmentName = URLDecoder.decode(segmentName, StandardCharsets.UTF_8.name());
@@ -271,14 +279,6 @@ public class TablesResource {
           Response.Status.NOT_FOUND);
     }
 
-    for (int i = 0; i < columns.size(); i++) {
-      try {
-        columns.set(i, URLDecoder.decode(columns.get(i), StandardCharsets.UTF_8.name()));
-      } catch (UnsupportedEncodingException e) {
-        throw new RuntimeException(e.getCause());
-      }
-    }
-
     try {
       return SegmentMetadataFetcher.getSegmentMetadata(segmentDataManager, columns);
     } catch (Exception e) {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org