You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/01/13 08:31:19 UTC

[incubator-iotdb] branch improve_auto_register created (now 3cc9ca0)

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

qiaojialin pushed a change to branch improve_auto_register
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 3cc9ca0  avoid using String when constructing Path in autoCreateSchema

This branch includes the following new commits:

     new 3cc9ca0  avoid using String when constructing Path in autoCreateSchema

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-iotdb] 01/01: avoid using String when constructing Path in autoCreateSchema

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3cc9ca02211058484af97df8a1ee4afa180a65d0
Author: qiaojialin <64...@qq.com>
AuthorDate: Mon Jan 13 16:30:40 2020 +0800

    avoid using String when constructing Path in autoCreateSchema
---
 .../iotdb/db/qp/executor/QueryProcessExecutor.java | 29 ++++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/QueryProcessExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/QueryProcessExecutor.java
index f2586bf..c5c4db3 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/QueryProcessExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/QueryProcessExecutor.java
@@ -847,11 +847,11 @@ public class QueryProcessExecutor extends AbstractQueryProcessExecutor {
   private void addPathToMTree(String deviceId, String measurementId, Object value)
       throws PathException, MetadataException, StorageEngineException {
     TSDataType predictedDataType = TypeInferenceUtils.getPredictedDataType(value);
-    String fullPath = deviceId + IoTDBConstant.PATH_SEPARATOR + measurementId;
+    Path path = new Path(deviceId, measurementId);
     TSEncoding encoding = getDefaultEncoding(predictedDataType);
     CompressionType compressionType =
         CompressionType.valueOf(TSFileDescriptor.getInstance().getConfig().getCompressor());
-    addPathToMTree(fullPath, predictedDataType, encoding, compressionType);
+    addPathToMTree(path, predictedDataType, encoding, compressionType);
   }
 
   /**
@@ -859,24 +859,37 @@ public class QueryProcessExecutor extends AbstractQueryProcessExecutor {
    */
   private void addPathToMTree(String deviceId, String measurementId, TSDataType dataType)
       throws PathException, MetadataException, StorageEngineException {
-    String fullPath = deviceId + IoTDBConstant.PATH_SEPARATOR + measurementId;
+    Path path = new Path(deviceId, measurementId);
     TSEncoding encoding = getDefaultEncoding(dataType);
     CompressionType compressionType =
         CompressionType.valueOf(TSFileDescriptor.getInstance().getConfig().getCompressor());
-    addPathToMTree(fullPath, dataType, encoding, compressionType);
+    addPathToMTree(path, dataType, encoding, compressionType);
   }
 
   /**
    * Add a seriesPath to MTree, register with datatype, encoding and compression
    */
-  private void addPathToMTree(String fullPath, TSDataType dataType, TSEncoding encoding,
+  private void addPathToMTree(Path path, TSDataType dataType, TSEncoding encoding,
       CompressionType compressionType)
       throws PathException, MetadataException, StorageEngineException {
     boolean result = mManager.addPathToMTree(
-        fullPath, dataType, encoding, compressionType, Collections.emptyMap());
+        path, dataType, encoding, compressionType, Collections.emptyMap());
     if (result) {
-      storageEngine.addTimeSeries(
-          new Path(fullPath), dataType, encoding, compressionType, Collections.emptyMap());
+      storageEngine.addTimeSeries(path, dataType, encoding, compressionType, Collections.emptyMap());
+    }
+  }
+
+  /**
+   * Add a seriesPath to MTree, register with datatype, encoding and compression
+   */
+  private void addPathToMTree(String path, TSDataType dataType, TSEncoding encoding,
+      CompressionType compressionType)
+      throws PathException, MetadataException, StorageEngineException {
+    boolean result = mManager.addPathToMTree(
+        path, dataType, encoding, compressionType, Collections.emptyMap());
+    if (result) {
+      storageEngine.addTimeSeries(new Path(path),
+          dataType, encoding, compressionType, Collections.emptyMap());
     }
   }