You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by lt...@apache.org on 2019/05/10 12:10:42 UTC

[incubator-iotdb] branch cluster updated: fix some issues

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

lta pushed a commit to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/cluster by this push:
     new f3d5167  fix some issues
f3d5167 is described below

commit f3d5167af1865c823e1c3a3e8dd27bc97afca298
Author: lta <li...@163.com>
AuthorDate: Fri May 10 20:10:30 2019 +0800

    fix some issues
---
 .../ClusterExecutorWithoutTimeGenerator.java       |  4 +--
 .../querynode/ClusterLocalSingleQueryManager.java  |  4 +--
 .../cluster/service/TSServiceClusterImpl.java      |  6 ++--
 ...a => AbstractExecutorWithoutTimeGenerator.java} |  2 +-
 .../EngineExecutorWithoutTimeGenerator.java        |  2 +-
 .../org/apache/iotdb/db/service/TSServiceImpl.java | 37 +++++++++++-----------
 6 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/executor/ClusterExecutorWithoutTimeGenerator.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/executor/ClusterExecutorWithoutTimeGenerator.java
index 65bd87b..8f42c9f 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/executor/ClusterExecutorWithoutTimeGenerator.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/executor/ClusterExecutorWithoutTimeGenerator.java
@@ -28,7 +28,7 @@ import org.apache.iotdb.db.exception.FileNodeManagerException;
 import org.apache.iotdb.db.query.context.QueryContext;
 import org.apache.iotdb.db.query.control.QueryResourceManager;
 import org.apache.iotdb.db.query.dataset.EngineDataSetWithoutTimeGenerator;
-import org.apache.iotdb.db.query.executor.ExecutorWithoutTimeGenerator;
+import org.apache.iotdb.db.query.executor.AbstractExecutorWithoutTimeGenerator;
 import org.apache.iotdb.db.query.reader.IPointReader;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.read.common.Path;
@@ -37,7 +37,7 @@ import org.apache.iotdb.tsfile.read.expression.impl.GlobalTimeExpression;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
 
-public class ClusterExecutorWithoutTimeGenerator extends ExecutorWithoutTimeGenerator {
+public class ClusterExecutorWithoutTimeGenerator extends AbstractExecutorWithoutTimeGenerator {
 
   /**
    * Query expression
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/manager/querynode/ClusterLocalSingleQueryManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/manager/querynode/ClusterLocalSingleQueryManager.java
index 559575a..37e3c57 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/manager/querynode/ClusterLocalSingleQueryManager.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/manager/querynode/ClusterLocalSingleQueryManager.java
@@ -50,7 +50,7 @@ import org.apache.iotdb.db.qp.physical.crud.GroupByPlan;
 import org.apache.iotdb.db.qp.physical.crud.QueryPlan;
 import org.apache.iotdb.db.query.context.QueryContext;
 import org.apache.iotdb.db.query.control.QueryResourceManager;
-import org.apache.iotdb.db.query.executor.ExecutorWithoutTimeGenerator;
+import org.apache.iotdb.db.query.executor.AbstractExecutorWithoutTimeGenerator;
 import org.apache.iotdb.db.query.reader.IPointReader;
 import org.apache.iotdb.db.query.reader.merge.EngineReaderByTimeStamp;
 import org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException;
@@ -185,7 +185,7 @@ public class ClusterLocalSingleQueryManager implements IClusterLocalSingleQueryM
         .beginQueryOfGivenQueryPaths(context.getJobId(), plan.getPaths());
     for (int i = 0; i < paths.size(); i++) {
       String fullPath = paths.get(i).getFullPath();
-      IPointReader reader = ExecutorWithoutTimeGenerator
+      IPointReader reader = AbstractExecutorWithoutTimeGenerator
           .createSeriesReader(context, paths.get(i), dataTypes, timeFilter);
       selectSeriesReaders
           .put(fullPath, new ClusterBatchReaderWithoutTimeGenerator(dataTypes.get(i), reader));
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/service/TSServiceClusterImpl.java b/cluster/src/main/java/org/apache/iotdb/cluster/service/TSServiceClusterImpl.java
index bfc74c1..4f3b442 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/service/TSServiceClusterImpl.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/service/TSServiceClusterImpl.java
@@ -270,11 +270,11 @@ public class TSServiceClusterImpl extends TSServiceImpl {
    * It's unnecessary to do this check. It has benn checked in transforming query physical plan.
    */
   @Override
-  public void checkFileLevelSet(List<Path> paths) throws PathErrorException {
+  protected void checkFileLevelSet(List<Path> paths) throws PathErrorException {
   }
 
   @Override
-  public void releaseQueryResource(TSCloseOperationReq req) throws Exception {
+  protected void releaseQueryResource(TSCloseOperationReq req) throws Exception {
     Map<Long, QueryContext> contextMap = contextMapLocal.get();
     if (contextMap == null) {
       return;
@@ -294,7 +294,7 @@ public class TSServiceClusterImpl extends TSServiceImpl {
   }
 
   @Override
-  public QueryDataSet createNewDataSet(String statement, int fetchSize, TSFetchResultsReq req)
+  protected QueryDataSet createNewDataSet(String statement, int fetchSize, TSFetchResultsReq req)
       throws PathErrorException, QueryFilterOptimizationException, FileNodeManagerException,
       ProcessorException, IOException {
     PhysicalPlan physicalPlan = queryStatus.get().get(statement);
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/executor/ExecutorWithoutTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/AbstractExecutorWithoutTimeGenerator.java
similarity index 98%
rename from iotdb/src/main/java/org/apache/iotdb/db/query/executor/ExecutorWithoutTimeGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/executor/AbstractExecutorWithoutTimeGenerator.java
index 4e5a66a..a37d182 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/query/executor/ExecutorWithoutTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/AbstractExecutorWithoutTimeGenerator.java
@@ -35,7 +35,7 @@ import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.read.common.Path;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 
-public abstract class ExecutorWithoutTimeGenerator {
+public abstract class AbstractExecutorWithoutTimeGenerator {
   /**
    * Create reader of a series
    *
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithoutTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithoutTimeGenerator.java
index b9464ba..4ad28ab 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithoutTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithoutTimeGenerator.java
@@ -37,7 +37,7 @@ import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
 /**
  * IoTDB query executor with global time filter.
  */
-public class EngineExecutorWithoutTimeGenerator extends ExecutorWithoutTimeGenerator {
+public class EngineExecutorWithoutTimeGenerator extends AbstractExecutorWithoutTimeGenerator {
 
   private QueryExpression queryExpression;
 
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index b9dbf04..8c9415d 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -42,7 +42,6 @@ import org.apache.iotdb.db.exception.PathErrorException;
 import org.apache.iotdb.db.exception.ProcessorException;
 import org.apache.iotdb.db.exception.qp.IllegalASTFormatException;
 import org.apache.iotdb.db.exception.qp.QueryProcessorException;
-import org.apache.iotdb.db.metadata.MGraph;
 import org.apache.iotdb.db.metadata.MManager;
 import org.apache.iotdb.db.metadata.Metadata;
 import org.apache.iotdb.db.qp.QueryProcessor;
@@ -111,7 +110,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
   protected ThreadLocal<Map<Long, QueryContext>> contextMapLocal = new ThreadLocal<>();
 
   public TSServiceImpl() throws IOException {
-     processor = new QueryProcessor(new OverflowQPExecutor());
+    processor = new QueryProcessor(new OverflowQPExecutor());
   }
 
   @Override
@@ -199,7 +198,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     return new TSCloseOperationResp(new TS_Status(TS_StatusCode.SUCCESS_STATUS));
   }
 
-  public void releaseQueryResource(TSCloseOperationReq req) throws Exception {
+  protected void releaseQueryResource(TSCloseOperationReq req) throws Exception {
     Map<Long, QueryContext> contextMap = contextMapLocal.get();
     if (contextMap == null) {
       return;
@@ -216,7 +215,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     }
   }
 
-  public void clearAllStatusForCurrentRequest() {
+  private void clearAllStatusForCurrentRequest() {
     if (this.queryRet.get() != null) {
       this.queryRet.get().clear();
     }
@@ -225,7 +224,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     }
   }
 
-  public TS_Status getErrorStatus(String message) {
+  private TS_Status getErrorStatus(String message) {
     TS_Status status = new TS_Status(TS_StatusCode.ERROR_STATUS);
     status.setErrorMessage(message);
     return status;
@@ -402,7 +401,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
    * @return true if the statement is ADMIN COMMAND
    * @throws IOException exception
    */
-  public boolean execAdminCommand(String statement) throws IOException {
+  private boolean execAdminCommand(String statement) throws IOException {
     if (!"root".equals(username.get())) {
       return false;
     }
@@ -528,7 +527,8 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
         return executeUpdateStatement(physicalPlan);
       }
     } catch (Exception e) {
-      LOGGER.info("meet error: {}  while executing statement: {}", e.getMessage(), req.getStatement());
+      LOGGER.info("meet error: {}  while executing statement: {}", e.getMessage(),
+          req.getStatement());
       return getTSExecuteStatementResp(TS_StatusCode.ERROR_STATUS, e.getMessage());
     }
   }
@@ -654,8 +654,8 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     }
   }
 
-  public void checkFileLevelSet(List<Path> paths) throws PathErrorException {
-      MManager.getInstance().checkFileLevel(paths);
+  protected void checkFileLevelSet(List<Path> paths) throws PathErrorException {
+    MManager.getInstance().checkFileLevel(paths);
   }
 
   @Override
@@ -693,7 +693,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     }
   }
 
-  public QueryDataSet createNewDataSet(String statement, int fetchSize, TSFetchResultsReq req)
+  protected QueryDataSet createNewDataSet(String statement, int fetchSize, TSFetchResultsReq req)
       throws PathErrorException, QueryFilterOptimizationException, FileNodeManagerException,
       ProcessorException, IOException {
     PhysicalPlan physicalPlan = queryStatus.get().get(statement);
@@ -710,7 +710,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     return queryDataSet;
   }
 
-  public void initContextMap(){
+  protected void initContextMap() {
     Map<Long, QueryContext> contextMap = contextMapLocal.get();
     if (contextMap == null) {
       contextMap = new HashMap<>();
@@ -736,7 +736,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     }
   }
 
-  public TSExecuteStatementResp executeUpdateStatement(PhysicalPlan plan) {
+  private TSExecuteStatementResp executeUpdateStatement(PhysicalPlan plan) {
     List<Path> paths = plan.getPaths();
 
     try {
@@ -795,7 +795,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     return executeUpdateStatement(physicalPlan);
   }
 
-  public void recordANewQuery(String statement, PhysicalPlan physicalPlan) {
+  private void recordANewQuery(String statement, PhysicalPlan physicalPlan) {
     queryStatus.get().put(statement, physicalPlan);
     // refresh current queryRet for statement
     if (queryRet.get().containsKey(statement)) {
@@ -808,11 +808,11 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
    *
    * @return true: If logined; false: If not logined
    */
-  public boolean checkLogin() {
+  protected boolean checkLogin() {
     return username.get() != null;
   }
 
-  public boolean checkAuthorization(List<Path> paths, PhysicalPlan plan) throws AuthException {
+  protected boolean checkAuthorization(List<Path> paths, PhysicalPlan plan) throws AuthException {
     String targetUser = null;
     if (plan instanceof AuthorPlan) {
       targetUser = ((AuthorPlan) plan).getUserName();
@@ -820,7 +820,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     return AuthorityChecker.check(username.get(), paths, plan.getOperatorType(), targetUser);
   }
 
-  public TSExecuteStatementResp getTSExecuteStatementResp(TS_StatusCode code, String msg) {
+  private TSExecuteStatementResp getTSExecuteStatementResp(TS_StatusCode code, String msg) {
     TSExecuteStatementResp resp = new TSExecuteStatementResp();
     TS_Status tsStatus = new TS_Status(code);
     tsStatus.setErrorMessage(msg);
@@ -833,7 +833,8 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     return resp;
   }
 
-  public TSExecuteBatchStatementResp getTSBathExecuteStatementResp(TS_StatusCode code, String msg,
+  protected TSExecuteBatchStatementResp getTSBathExecuteStatementResp(TS_StatusCode code,
+      String msg,
       List<Integer> result) {
     TSExecuteBatchStatementResp resp = new TSExecuteBatchStatementResp();
     TS_Status tsStatus = new TS_Status(code);
@@ -843,7 +844,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     return resp;
   }
 
-  public TSFetchResultsResp getTSFetchResultsResp(TS_StatusCode code, String msg) {
+  private TSFetchResultsResp getTSFetchResultsResp(TS_StatusCode code, String msg) {
     TSFetchResultsResp resp = new TSFetchResultsResp();
     TS_Status tsStatus = new TS_Status(code);
     tsStatus.setErrorMessage(msg);