You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "MiniSho (via GitHub)" <gi...@apache.org> on 2023/03/09 04:16:23 UTC

[GitHub] [iotdb] MiniSho opened a new pull request, #9254: [IOTDB-5650] Pipe Plugin: From SQL to ConfigNode

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

   parse SQL to ConfigNode and implement PipePluginCoordinator.
   


-- 
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] SteveYurongSu commented on a diff in pull request #9254: [IOTDB-5650] Pipe Plugin Coordinator: From SQL to ConfigNode

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #9254:
URL: https://github.com/apache/iotdb/pull/9254#discussion_r1132792063


##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java:
##########
@@ -1226,24 +1234,34 @@ public TGetJarInListResp getTriggerJar(TGetJarInListReq req) {
 
   @Override
   public TSStatus createPipePlugin(TCreatePipePluginReq req) {
-    // TODO: implement PipeManager
     TSStatus status = confirmLeader();
-    LOGGER.info("createPipePlugin: {}", req);
-    return status;
+    return status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
+        ? pipeManager.getPipePluginCoordinator().createPipePlugin(req)
+        : status;
   }
 
   @Override
   public TSStatus dropPipePlugin(String pipePluginName) {
-    // TODO: implement PipeManager
     TSStatus status = confirmLeader();
-    return status;
+    return status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
+        ? pipeManager.getPipePluginCoordinator().dropPipePlugin(pipePluginName)
+        : status;
   }
 
   @Override
   public TGetPipePluginTableResp getPipePluginTable() {
-    // TODO: implement PipeManager
     TSStatus status = confirmLeader();
-    return new TGetPipePluginTableResp(status, Collections.emptyList());
+    return status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
+        ? pipeManager.getPipePluginCoordinator().getPipePluginTable()

Review Comment:
   ```suggestion
           ? pipeManager.getPipePluginCoordinator().showPipePlugins()
   ```



-- 
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] SteveYurongSu commented on a diff in pull request #9254: [IOTDB-5650] Pipe Plugin Coordinator: From SQL to ConfigNode

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #9254:
URL: https://github.com/apache/iotdb/pull/9254#discussion_r1132855229


##########
node-commons/pom.xml:
##########
@@ -157,6 +157,12 @@
             <groupId>com.github.ben-manes.caffeine</groupId>
             <artifactId>caffeine</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>pipe-api</artifactId>
+            <version>1.2.0-SNAPSHOT</version>
+            <scope>compile</scope>

Review Comment:
   ...



-- 
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] SteveYurongSu commented on a diff in pull request #9254: [IOTDB-5650] Pipe Plugin Coordinator: From SQL to ConfigNode

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #9254:
URL: https://github.com/apache/iotdb/pull/9254#discussion_r1132815144


##########
pipe-api/src/main/java/org/apache/iotdb/pipe/api/PipePlugin.java:
##########
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.pipe.api;
+
+public interface PipePlugin {}

Review Comment:
   ```suggestion
   public interface PipePlugin extends AutoCloseable {}
   ```



-- 
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] SteveYurongSu commented on a diff in pull request #9254: [IOTDB-5650] Pipe Plugin Coordinator: From SQL to ConfigNode

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #9254:
URL: https://github.com/apache/iotdb/pull/9254#discussion_r1131936845


##########
confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/read/pipe/plugin/GetPipePluginTablePlan.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.confignode.consensus.request.read.pipe.plugin;
+
+import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlan;
+import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlanType;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+public class GetPipePluginTablePlan extends ConfigPhysicalPlan {
+
+  public GetPipePluginTablePlan() {
+    super(ConfigPhysicalPlanType.GetPipePluginTable);
+  }
+
+  @Override
+  protected void serializeImpl(DataOutputStream stream) throws IOException {
+    stream.writeShort(getType().getPlanType());

Review Comment:
   Empty logic? What is this plan used for?



-- 
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] SteveYurongSu commented on a diff in pull request #9254: [IOTDB-5650] Pipe Plugin Coordinator: From SQL to ConfigNode

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #9254:
URL: https://github.com/apache/iotdb/pull/9254#discussion_r1132808407


##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/PipeManager.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.confignode.manager.pipe;
+
+import org.apache.iotdb.confignode.manager.ConfigManager;
+import org.apache.iotdb.confignode.manager.pipe.plugin.PipePluginCoordinator;
+import org.apache.iotdb.confignode.persistence.pipe.PipeInfo;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PipeManager {
+  private static final Logger LOGGER = LoggerFactory.getLogger(PipeManager.class);
+
+  private final ConfigManager configManager;
+
+  private final PipeInfo pipeInfo;
+
+  private final PipePluginCoordinator pipePluginCoordinator;
+
+  public PipeManager(ConfigManager configManager, PipeInfo pipeInfo) {
+    this.configManager = configManager;
+    this.pipeInfo = pipeInfo;
+    this.pipePluginCoordinator = new PipePluginCoordinator(this, pipeInfo.getPipePluginInfo());

Review Comment:
   Kind of ugly...



-- 
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] SteveYurongSu merged pull request #9254: [IOTDB-5650] Pipe Plugin Coordinator: From SQL to ConfigNode

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu merged PR #9254:
URL: https://github.com/apache/iotdb/pull/9254


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