You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2022/01/15 11:28:20 UTC
[iotdb] branch master updated: [IOTDB-2313] REST: GC overhead limit when select * from root.** (#4845)
This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 138d14c [IOTDB-2313] REST: GC overhead limit when select * from root.** (#4845)
138d14c is described below
commit 138d14ce1dc5dc1e8e67b9bbd1f4f562003c1af5
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Sat Jan 15 19:27:45 2022 +0800
[IOTDB-2313] REST: GC overhead limit when select * from root.** (#4845)
---
.../protocol/rest/handler/RequestValidationHandler.java | 6 +++---
.../iotdb/db/protocol/rest/impl/RestApiServiceImpl.java | 16 ++++------------
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/protocol/rest/handler/RequestValidationHandler.java b/server/src/main/java/org/apache/iotdb/db/protocol/rest/handler/RequestValidationHandler.java
index 4c678dc..2837fbc 100644
--- a/server/src/main/java/org/apache/iotdb/db/protocol/rest/handler/RequestValidationHandler.java
+++ b/server/src/main/java/org/apache/iotdb/db/protocol/rest/handler/RequestValidationHandler.java
@@ -31,9 +31,9 @@ public class RequestValidationHandler {
public static void validateSQL(SQL sql) {
Objects.requireNonNull(sql.getSql(), "sql should not be null");
- Validate.isTrue(
- sql.getRowLimit() != null && sql.getRowLimit() > 0,
- "rowLimit can not be null and should be positive");
+ if (sql.getRowLimit() != null) {
+ Validate.isTrue(sql.getRowLimit() > 0, "rowLimit should be positive");
+ }
}
public static void validateInsertTabletRequest(InsertTabletRequest insertTabletRequest) {
diff --git a/server/src/main/java/org/apache/iotdb/db/protocol/rest/impl/RestApiServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/protocol/rest/impl/RestApiServiceImpl.java
index 1308d2a..caf37aa 100644
--- a/server/src/main/java/org/apache/iotdb/db/protocol/rest/impl/RestApiServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/protocol/rest/impl/RestApiServiceImpl.java
@@ -110,17 +110,6 @@ public class RestApiServiceImpl extends RestApiService {
return response;
}
- // set max row limit to avoid OOM
- Integer rowLimitInRequest = sql.getRowLimit();
- if (rowLimitInRequest == null) {
- rowLimitInRequest = defaultQueryRowLimit;
- }
- int rowLimitInQueryPlan = queryPlan.getRowLimit();
- if (rowLimitInQueryPlan <= 0) {
- rowLimitInQueryPlan = defaultQueryRowLimit;
- }
- final int actualRowSizeLimit = Math.min(rowLimitInRequest, rowLimitInQueryPlan);
-
final long queryId = QueryResourceManager.getInstance().assignQueryId(true);
try {
QueryContext queryContext =
@@ -133,7 +122,10 @@ public class RestApiServiceImpl extends RestApiService {
QueryDataSet queryDataSet =
serviceProvider.createQueryDataSet(
queryContext, physicalPlan, IoTDBConstant.DEFAULT_FETCH_SIZE);
- return QueryDataSetHandler.fillDateSet(queryDataSet, queryPlan, actualRowSizeLimit);
+ return QueryDataSetHandler.fillDateSet(
+ queryDataSet,
+ queryPlan,
+ sql.getRowLimit() != null ? sql.getRowLimit() : defaultQueryRowLimit);
} finally {
ServiceProvider.SESSION_MANAGER.releaseQueryResourceNoExceptions(queryId);
}