You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/07/12 09:51:22 UTC

[GitHub] [iotdb] yunchan86 opened a new pull request, #6652: [IOTDB-3756]Support mount template and query mount info

yunchan86 opened a new pull request, #6652:
URL: https://github.com/apache/iotdb/pull/6652

   Support mount template and query mount info
   ```sql
   IoTDB> create schema template t1 (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
   Msg: The statement is executed successfully.
   IoTDB> create schema template t2 aligned (lat FLOAT encoding=Gorilla, lon FLOAT encoding=Gorilla);
   Msg: The statement is executed successfully.
   IoTDB> show schema templates;
   +-------------+
   |template name|
   +-------------+
   |           t1|
   |           t2|
   +-------------+
   Total line number = 2
   It costs 0.080s
   IoTDB> show paths set schema template t1
   +-----+
   |paths|
   +-----+
   +-----+
   Empty set.
   It costs 0.044s
   IoTDB> set schema template t1 to root.sg1.d1;
   Msg: The statement is executed successfully.
   IoTDB> show paths set schema template t1
   +-----------+
   |      paths|
   +-----------+
   |root.sg1.d1|
   +-----------+
   Total line number = 1
   It costs 0.006s
   IoTDB> set schema template t2 to root.sg1.d2;
   Msg: The statement is executed successfully.
   IoTDB> show paths set schema template t2
   +-----------+
   |      paths|
   +-----------+
   |root.sg1.d2|
   +-----------+
   Total line number = 1
   It costs 0.004s
   ```


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] MarcosZyk merged pull request #6652: [IOTDB-3756]Support mount template and query mount info

Posted by GitBox <gi...@apache.org>.
MarcosZyk merged PR #6652:
URL: https://github.com/apache/iotdb/pull/6652


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #6652: [IOTDB-3756]Support mount template and query mount info

Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #6652:
URL: https://github.com/apache/iotdb/pull/6652#discussion_r919547823


##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java:
##########
@@ -373,6 +376,34 @@ public TGetTemplateResp getTemplate(String req) {
     return resp;
   }
 
+  /**
+   * mount template
+   *
+   * @param templateName
+   * @param path
+   * @return
+   */
+  public TSStatus setSchemaTemplate(String templateName, String path) {
+    SetSchemaTemplatePlan setSchemaTemplatePlan = new SetSchemaTemplatePlan(templateName, path);
+    return getConsensusManager().write(setSchemaTemplatePlan).getStatus();
+  }
+
+  /**
+   * show path set template xx
+   *
+   * @param templateName
+   * @return
+   */
+  public List<String> getPathsSetTemplate(String templateName) {
+    GetPathsSetTemplatePlan getPathsSetTemplatePlan = new GetPathsSetTemplatePlan(templateName);
+    PathInfoResp resp =
+        (PathInfoResp) getConsensusManager().read(getPathsSetTemplatePlan).getDataset();
+    if (resp.getStatus().getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      return resp.getPathList();
+    }
+    return null;

Review Comment:
   If not success, shall we throw an exception or return a failure TSStatus?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org