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

yuyuankang pushed a commit to branch kyy
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/kyy by this push:
     new 67019f6  remove useless message
67019f6 is described below

commit 67019f603ab49c04487f23980883b23f4f79d395
Author: Ring-k <[email protected]>
AuthorDate: Mon Oct 12 22:27:35 2020 +0800

    remove useless message
---
 .../apache/iotdb/cluster/metadata/CMManager.java   | 53 +++++++++++++---------
 .../iotdb/cluster/query/ClusterPlanExecutor.java   | 20 +++++---
 .../org/apache/iotdb/db/metadata/MManager.java     | 10 ++--
 .../db/query/dataset/ShowTimeseriesDataSet.java    |  4 +-
 .../org/apache/iotdb/db/service/TSServiceImpl.java | 26 +++++++----
 5 files changed, 72 insertions(+), 41 deletions(-)

diff --git 
a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
index c2b3e48..5bb737b 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
@@ -131,6 +131,7 @@ public class CMManager extends MManager {
 
   /**
    * we should not use this function in other place, but only in IoTDB class
+   *
    * @return
    */
   public static CMManager getInstance() {
@@ -178,7 +179,8 @@ public class CMManager extends MManager {
           .pullMeasurementSchemas(Collections.singletonList(path));
       if (!schemas.isEmpty()) {
         MeasurementSchema measurementSchema = schemas.get(0);
-        MeasurementMNode measurementMNode = new MeasurementMNode(null, 
measurementSchema.getMeasurementId(),
+        MeasurementMNode measurementMNode = new MeasurementMNode(null,
+            measurementSchema.getMeasurementId(),
             measurementSchema, null);
         cacheMeta(path, measurementMNode);
         return schemas.get(0).getType();
@@ -190,15 +192,17 @@ public class CMManager extends MManager {
   }
 
   /**
-   *  the org.apache.iotdb.db.writelog.recover.logReplayer will call this to 
get schema after restart
-   *  we should retry to get schema util we get the schema
+   * the org.apache.iotdb.db.writelog.recover.logReplayer will call this to 
get schema after restart
+   * we should retry to get schema util we get the schema
+   *
    * @param deviceId
    * @param measurements
    * @return
    * @throws MetadataException
    */
   @Override
-  public MeasurementMNode[] getMNodes(PartialPath deviceId, String[] 
measurements) throws MetadataException {
+  public MeasurementMNode[] getMNodes(PartialPath deviceId, String[] 
measurements)
+      throws MetadataException {
     try {
       return super.getMNodes(deviceId, measurements);
     } catch (MetadataException e) {
@@ -217,14 +221,13 @@ public class CMManager extends MManager {
       failedMeasurementIndex = getMNodesLocally(deviceId, measurements, 
measurementMNodes);
       if (failedMeasurementIndex != -1) {
         throw new MetadataException(deviceId.getFullPath() + 
IoTDBConstant.PATH_SEPARATOR
-          + measurements[failedMeasurementIndex] + " is not found");
+            + measurements[failedMeasurementIndex] + " is not found");
       }
       return measurementMNodes;
     }
   }
 
   /**
-   *
    * @return -1 if all schemas are found, or the first index of the non-exist 
schema
    */
   private int getMNodesLocally(PartialPath deviceId, String[] measurements,
@@ -248,7 +251,7 @@ public class CMManager extends MManager {
   }
 
   private void pullSeriesSchemas(PartialPath deviceId, String[] 
measurementList)
-    throws MetadataException {
+      throws MetadataException {
     List<PartialPath> schemasToPull = new ArrayList<>();
     for (String s : measurementList) {
       schemasToPull.add(deviceId.concatNode(s));
@@ -303,7 +306,8 @@ public class CMManager extends MManager {
     MeasurementMNode[] measurementMNodes = new 
MeasurementMNode[plan.getMeasurements().length];
     MNode deviceNode = getDeviceNode(plan.getDeviceId());
 
-    int nonExistSchemaIndex = getMNodesLocally(plan.getDeviceId(), 
plan.getMeasurements(), measurementMNodes);
+    int nonExistSchemaIndex = getMNodesLocally(plan.getDeviceId(), 
plan.getMeasurements(),
+        measurementMNodes);
     if (nonExistSchemaIndex == -1) {
       plan.setMeasurementMNodes(measurementMNodes);
       return deviceNode;
@@ -314,7 +318,8 @@ public class CMManager extends MManager {
   }
 
   @Override
-  public MeasurementSchema getSeriesSchema(PartialPath device, String 
measurement) throws MetadataException {
+  public MeasurementSchema getSeriesSchema(PartialPath device, String 
measurement)
+      throws MetadataException {
     try {
       MeasurementSchema measurementSchema = super.getSeriesSchema(device, 
measurement);
       if (measurementSchema != null) {
@@ -508,7 +513,7 @@ public class CMManager extends MManager {
         } else {
           SyncDataClient syncDataClient =
               metaGroupMember.getClientProvider().getSyncDataClient(node,
-              RaftServer.getReadOperationTimeoutMS());
+                  RaftServer.getReadOperationTimeoutMS());
           result = 
syncDataClient.getUnregisteredTimeseries(partitionGroup.getHeader(), 
seriesList);
           ClientUtils.putBackSyncClient(syncDataClient);
         }
@@ -535,9 +540,10 @@ public class CMManager extends MManager {
    * contain a storage group. The pulled schemas will be cache in CMManager.
    *
    * @param ignoredGroup do not pull schema from the group to avoid backward 
dependency. If a user
-   * send an insert request before registering schemas, then this method may 
pull schemas from the
-   * same groups. If this method is called by an applier, it holds the lock of 
LogManager, while the
-   * pulling thread may want this lock too, resulting in a deadlock.
+   *                     send an insert request before registering schemas, 
then this method may
+   *                     pull schemas from the same groups. If this method is 
called by an applier,
+   *                     it holds the lock of LogManager, while the pulling 
thread may want this
+   *                     lock too, resulting in a deadlock.
    */
   public void pullTimeSeriesSchemas(List<PartialPath> prefixPaths,
       Node ignoredGroup)
@@ -559,7 +565,8 @@ public class CMManager extends MManager {
 
     // pull timeseries schema from every group involved
     if (logger.isDebugEnabled()) {
-      logger.debug("{}: pulling schemas of {} and other {} paths from {} 
groups", metaGroupMember.getName(),
+      logger.debug("{}: pulling schemas of {} and other {} paths from {} 
groups",
+          metaGroupMember.getName(),
           prefixPaths.get(0), prefixPaths.size() - 1,
           partitionGroupPathMap.size());
     }
@@ -687,7 +694,8 @@ public class CMManager extends MManager {
     }
   }
 
-  private Pair<List<TSDataType>, List<TSDataType>> 
getSeriesTypesByPathsLocally(List<PartialPath> pathStrs,
+  private Pair<List<TSDataType>, List<TSDataType>> 
getSeriesTypesByPathsLocally(
+      List<PartialPath> pathStrs,
       String aggregation) throws MetadataException {
     List<TSDataType> measurementDataTypes = 
SchemaUtils.getSeriesTypesByPaths(pathStrs,
         (String) null);
@@ -793,7 +801,7 @@ public class CMManager extends MManager {
    * Split the paths by the data group they belong to and query them from the 
groups separately.
    *
    * @param sgPathMap the key is the storage group name and the value is the 
path to be queried with
-   * storage group added
+   *                  storage group added
    * @return a collection of all queried paths
    */
   private List<PartialPath> getMatchedPaths(Map<String, String> sgPathMap)
@@ -805,7 +813,8 @@ public class CMManager extends MManager {
       String storageGroupName = sgPathEntry.getKey();
       PartialPath pathUnderSG = new PartialPath(sgPathEntry.getValue());
       // find the data group that should hold the timeseries schemas of the 
storage group
-      PartitionGroup partitionGroup = 
metaGroupMember.getPartitionTable().route(storageGroupName, 0);
+      PartitionGroup partitionGroup = metaGroupMember.getPartitionTable()
+          .route(storageGroupName, 0);
       if (partitionGroup.contains(metaGroupMember.getThisNode())) {
         // this node is a member of the group, perform a local query after 
synchronizing with the
         // leader
@@ -899,7 +908,7 @@ public class CMManager extends MManager {
    * Split the paths by the data group they belong to and query them from the 
groups separately.
    *
    * @param sgPathMap the key is the storage group name and the value is the 
path to be queried with
-   * storage group added
+   *                  storage group added
    * @return a collection of all queried devices
    */
   private Set<PartialPath> getMatchedDevices(Map<String, String> sgPathMap)
@@ -911,7 +920,8 @@ public class CMManager extends MManager {
       String storageGroupName = sgPathEntry.getKey();
       PartialPath pathUnderSG = new PartialPath(sgPathEntry.getValue());
       // find the data group that should hold the timeseries schemas of the 
storage group
-      PartitionGroup partitionGroup = 
metaGroupMember.getPartitionTable().route(storageGroupName, 0);
+      PartitionGroup partitionGroup = metaGroupMember.getPartitionTable()
+          .route(storageGroupName, 0);
       if (partitionGroup.contains(metaGroupMember.getThisNode())) {
         // this node is a member of the group, perform a local query after 
synchronizing with the
         // leader
@@ -1087,8 +1097,9 @@ public class CMManager extends MManager {
    */
   public List<String> getNodeList(String path, int nodeLevel)
       throws MetadataException {
-    return getNodesList(new PartialPath(path), 
nodeLevel).stream().map(PartialPath::getFullPath).collect(
-        Collectors.toList());
+    return getNodesList(new PartialPath(path), 
nodeLevel).stream().map(PartialPath::getFullPath)
+        .collect(
+            Collectors.toList());
   }
 
   public Set<String> getChildNodePathInNextLevel(String path)
diff --git 
a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
index c13c02e..d14a2fa 100644
--- 
a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
+++ 
b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
@@ -184,7 +184,8 @@ public class ClusterPlanExecutor extends PlanExecutor {
         result.addAndGet(localResult);
       } else {
         // batch the queries of the same group to reduce communication
-        groupPathMap.computeIfAbsent(partitionGroup, p -> new 
ArrayList<>()).add(pathUnderSG.getFullPath());
+        groupPathMap.computeIfAbsent(partitionGroup, p -> new ArrayList<>())
+            .add(pathUnderSG.getFullPath());
       }
     }
     if (groupPathMap.isEmpty()) {
@@ -284,7 +285,8 @@ public class ClusterPlanExecutor extends PlanExecutor {
   }
 
   @Override
-  protected List<PartialPath> getNodesList(PartialPath schemaPattern, int 
level) throws MetadataException {
+  protected List<PartialPath> getNodesList(PartialPath schemaPattern, int 
level)
+      throws MetadataException {
 
     ConcurrentSkipListSet<PartialPath> nodeSet = new ConcurrentSkipListSet<>();
     ExecutorService pool = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
@@ -339,7 +341,8 @@ public class ClusterPlanExecutor extends PlanExecutor {
     localDataMember.syncLeaderWithConsistencyCheck();
     try {
       return IoTDB.metaManager.getNodesList(schemaPattern, level,
-          new SlotSgFilter(((SlotPartitionTable) 
metaGroupMember.getPartitionTable()).getNodeSlots(header)));
+          new SlotSgFilter(
+              ((SlotPartitionTable) 
metaGroupMember.getPartitionTable()).getNodeSlots(header)));
     } catch (MetadataException e) {
       logger
           .error("Cannot not get node list of {}@{} from {} locally", 
schemaPattern, level, group);
@@ -355,8 +358,9 @@ public class ClusterPlanExecutor extends PlanExecutor {
         if (ClusterDescriptor.getInstance().getConfig().isUseAsyncServer()) {
           AsyncDataClient client = metaGroupMember
               .getClientProvider().getAsyncDataClient(node, 
RaftServer.getReadOperationTimeoutMS());
-          paths = SyncClientAdaptor.getNodeList(client, group.getHeader(), 
schemaPattern.getFullPath(),
-              level);
+          paths = SyncClientAdaptor
+              .getNodeList(client, group.getHeader(), 
schemaPattern.getFullPath(),
+                  level);
         } else {
           SyncDataClient syncDataClient = metaGroupMember
               .getClientProvider().getSyncDataClient(node, 
RaftServer.getReadOperationTimeoutMS());
@@ -460,11 +464,13 @@ public class ClusterPlanExecutor extends PlanExecutor {
         if (ClusterDescriptor.getInstance().getConfig().isUseAsyncServer()) {
           AsyncDataClient client = metaGroupMember
               .getClientProvider().getAsyncDataClient(node, 
RaftServer.getReadOperationTimeoutMS());
-          nextChildren = SyncClientAdaptor.getNextChildren(client, 
group.getHeader(), path.getFullPath());
+          nextChildren = SyncClientAdaptor
+              .getNextChildren(client, group.getHeader(), path.getFullPath());
         } else {
           SyncDataClient syncDataClient = metaGroupMember
               .getClientProvider().getSyncDataClient(node, 
RaftServer.getReadOperationTimeoutMS());
-          nextChildren = 
syncDataClient.getChildNodePathInNextLevel(group.getHeader(), 
path.getFullPath());
+          nextChildren = syncDataClient
+              .getChildNodePathInNextLevel(group.getHeader(), 
path.getFullPath());
           ClientUtils.putBackSyncClient(syncDataClient);
         }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java 
b/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
index ace5ced..4422e24 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
@@ -1739,8 +1739,9 @@ public class MManager {
         if (measurementMNode.getSchema().getType() != insertDataType) {
           logger.warn("DataType mismatch, Insert measurement {} type {}, 
metadata tree type {}",
               measurementList[i], insertDataType, 
measurementMNode.getSchema().getType());
-          DataTypeMismatchException mismatchException = new 
DataTypeMismatchException(measurementList[i],
-                  insertDataType, measurementMNode.getSchema().getType());
+          DataTypeMismatchException mismatchException = new 
DataTypeMismatchException(
+              measurementList[i],
+              insertDataType, measurementMNode.getSchema().getType());
           if (!config.isEnablePartialInsert()) {
             throw mismatchException;
           } else {
@@ -1784,8 +1785,9 @@ public class MManager {
           Collections.emptyMap());
     } catch (PathAlreadyExistException | AliasAlreadyExistException e) {
       if (logger.isDebugEnabled()) {
-        logger.debug("Ignore PathAlreadyExistException and 
AliasAlreadyExistException when Concurrent inserting"
-            + " a non-exist time series {}", path);
+        logger.debug(
+            "Ignore PathAlreadyExistException and AliasAlreadyExistException 
when Concurrent inserting"
+                + " a non-exist time series {}", path);
       }
     }
   }
diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java
 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java
index 15e1a55..a8ce003 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java
@@ -27,6 +27,7 @@ import static 
org.apache.iotdb.db.conf.IoTDBConstant.COLUMN_TIMESERIES_ALIAS;
 import static 
org.apache.iotdb.db.conf.IoTDBConstant.COLUMN_TIMESERIES_COMPRESSION;
 import static 
org.apache.iotdb.db.conf.IoTDBConstant.COLUMN_TIMESERIES_DATATYPE;
 import static 
org.apache.iotdb.db.conf.IoTDBConstant.COLUMN_TIMESERIES_ENCODING;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -61,7 +62,8 @@ public class ShowTimeseriesDataSet extends QueryDataSet {
 
   private static Path[] resourcePaths = {new PartialPath(COLUMN_TIMESERIES, 
false),
       new PartialPath(COLUMN_TIMESERIES_ALIAS, false), new 
PartialPath(COLUMN_STORAGE_GROUP, false),
-      new PartialPath(COLUMN_TIMESERIES_DATATYPE, false), new 
PartialPath(COLUMN_TIMESERIES_ENCODING, false),
+      new PartialPath(COLUMN_TIMESERIES_DATATYPE, false),
+      new PartialPath(COLUMN_TIMESERIES_ENCODING, false),
       new PartialPath(COLUMN_TIMESERIES_COMPRESSION, false), new 
PartialPath(COLUMN_TAGS, false),
       new PartialPath(COLUMN_ATTRIBUTES, false)};
   private static TSDataType[] resourceTypes = {TSDataType.TEXT, 
TSDataType.TEXT, TSDataType.TEXT,
diff --git 
a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java 
b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index 1941715..982ae3e 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -351,8 +351,10 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
           status = RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
           break;
         case "ALL_COLUMNS":
-          resp.setColumnsList(getPaths(new 
PartialPath(req.getColumnPath())).stream().map(PartialPath::getFullPath).collect(
-              Collectors.toList()));
+          resp.setColumnsList(
+              getPaths(new 
PartialPath(req.getColumnPath())).stream().map(PartialPath::getFullPath)
+                  .collect(
+                      Collectors.toList()));
           status = RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
           break;
         default:
@@ -682,7 +684,12 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
           logger.error("Error happened while releasing query resource: ", ex);
         }
       }
-      return 
RpcUtils.getTSExecuteStatementResp(TSStatusCode.INTERNAL_SERVER_ERROR, 
e.getMessage());
+      Throwable cause = e;
+      while (cause.getCause() != null) {
+        cause = cause.getCause();
+      }
+      return RpcUtils
+          .getTSExecuteStatementResp(TSStatusCode.INTERNAL_SERVER_ERROR, 
cause.getMessage());
     } finally {
       Measurement.INSTANCE.addOperationLatency(Operation.EXECUTE_QUERY, 
startTime);
     }
@@ -816,7 +823,8 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
         for (PartialPath path : paths) {
           String column = path.getTsAlias();
           if (column == null) {
-            column = path.getMeasurementAlias() != null ? 
path.getFullPathWithAlias() : path.getFullPath();
+            column = path.getMeasurementAlias() != null ? 
path.getFullPathWithAlias()
+                : path.getFullPath();
           }
           respColumns.add(column);
           seriesTypes.add(getSeriesTypeByPath(path));
@@ -1024,7 +1032,6 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
   private QueryDataSet createQueryDataSet(long queryId, PhysicalPlan 
physicalPlan)
       throws QueryProcessException, QueryFilterOptimizationException, 
StorageEngineException,
       IOException, MetadataException, SQLException, TException, 
InterruptedException {
-
     QueryContext context = genQueryContext(queryId);
     QueryDataSet queryDataSet = executor.processQuery(physicalPlan, context);
     queryId2DataSet.put(queryId, queryDataSet);
@@ -1372,7 +1379,8 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
         return RpcUtils.getStatus(TSStatusCode.NOT_LOGIN_ERROR);
       }
 
-      InsertTabletPlan insertTabletPlan = new InsertTabletPlan(new 
PartialPath(req.deviceId), req.measurements);
+      InsertTabletPlan insertTabletPlan = new InsertTabletPlan(new 
PartialPath(req.deviceId),
+          req.measurements);
       
insertTabletPlan.setTimes(QueryDataSetUtils.readTimesFromBuffer(req.timestamps, 
req.size));
       insertTabletPlan.setColumns(
           QueryDataSetUtils.readValuesFromBuffer(
@@ -1406,7 +1414,8 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
 
       List<TSStatus> statusList = new ArrayList<>();
       for (int i = 0; i < req.deviceIds.size(); i++) {
-        InsertTabletPlan insertTabletPlan = new InsertTabletPlan(new 
PartialPath(req.deviceIds.get(i)),
+        InsertTabletPlan insertTabletPlan = new InsertTabletPlan(
+            new PartialPath(req.deviceIds.get(i)),
             req.measurementsList.get(i));
         insertTabletPlan.setTimes(
             QueryDataSetUtils.readTimesFromBuffer(req.timestampsList.get(i), 
req.sizeList.get(i)));
@@ -1656,7 +1665,8 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
     return QueryResourceManager.getInstance().assignQueryId(isDataQuery);
   }
 
-  protected List<TSDataType> getSeriesTypesByPaths(List<PartialPath> paths, 
List<String> aggregations)
+  protected List<TSDataType> getSeriesTypesByPaths(List<PartialPath> paths,
+      List<String> aggregations)
       throws MetadataException {
     return SchemaUtils.getSeriesTypesByPaths(paths, aggregations);
   }

Reply via email to