Alima777 commented on a change in pull request #2436:
URL: https://github.com/apache/iotdb/pull/2436#discussion_r553087501
##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -653,9 +528,10 @@ public TSExecuteStatementResp
executeRawDataQuery(TSRawDataQueryReq req) {
*/
@SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity
warning
private TSExecuteStatementResp internalExecuteQueryStatement(String
statement,
- long statementId, PhysicalPlan plan, int fetchSize, String username)
throws IOException {
+ long statementId, PhysicalPlan plan, int fetchSize, String username)
+ throws QueryProcessException, SQLException, StorageEngineException,
QueryFilterOptimizationException, MetadataException, IOException,
InterruptedException, TException, AuthException {
Review comment:
I'm not sure about this. Since lots of Exceptions are thrown here and
adopt the same process outside, can we just catch and process them in this
method?
##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -367,21 +346,29 @@ protected void releaseQueryResource(long queryId) throws
StorageEngineException,
QueryResourceManager.getInstance().endQuery(queryId);
}
+ private void releaseQueryResourceNoExceptions(long queryId) {
Review comment:
Rename as `releaseQueryResourceWithoutExceptions` ?
##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -1839,12 +1588,46 @@ private long generateQueryId(boolean isDataQuery, int
fetchSize, int deduplicate
return SchemaUtils.getSeriesTypesByPaths(paths, aggregations);
}
-
protected TSDataType getSeriesTypeByPath(PartialPath path) throws
MetadataException {
return SchemaUtils.getSeriesTypeByPath(path);
}
- public static int getDefaultFetchSize() {
- return DEFAULT_FETCH_SIZE;
+ private TSStatus onException(Exception e, String operation) {
+ TSStatus status = tryCatchQueryException(e);
+ return status != null ? status : onNPEOrUnexpectedException(e, operation,
+ TSStatusCode.INTERNAL_SERVER_ERROR);
+ }
+
+ private TSStatus tryCatchQueryException(Exception e) {
Review comment:
Rename as `onQueryException`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]