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 2020/05/07 03:48:34 UTC

[GitHub] [incubator-iotdb] Ring-k commented on a change in pull request #1161: [IOTDB-348] Fix DeleteTimeseriesPlan result inconsistent problem

Ring-k commented on a change in pull request #1161:
URL: https://github.com/apache/incubator-iotdb/pull/1161#discussion_r421222398



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
##########
@@ -373,8 +373,85 @@ protected void loadConfiguration(LoadConfigurationPlan plan) throws QueryProcess
         break;
       default:
         throw new QueryProcessException(String
-            .format("Unrecognized load configuration plan type: %s",
-                plan.getLoadConfigurationPlanType()));
+                .format("Unrecognized load configuration plan type: %s",
+                        plan.getLoadConfigurationPlanType()));
+    }
+  }
+
+  @Override
+  protected Pair<Set<String>, String> deleteTimeseries(String path) throws MetadataException {
+    ConcurrentHashMap<String, Set<String>> resultPair = new ConcurrentHashMap<>();
+    Pair<Set<String>, String> localPair = MManager.getInstance().deleteTimeseries(path);
+    resultPair.put(localPair.right, localPair.left);
+
+    ExecutorService pool = new ScheduledThreadPoolExecutor(THREAD_POOL_SIZE);
+
+    for (PartitionGroup group : metaGroupMember.getPartitionTable().getGlobalGroups()) {
+      Node header = group.getHeader();
+      if (header.equals(metaGroupMember.getThisNode())) {
+        continue;
+      }
+      pool.submit(() -> {
+        DeleteTimeseriesHandler handler = new DeleteTimeseriesHandler();
+        AtomicReference<DeleteTimeseriesRespPair> response = new AtomicReference<>(null);
+        handler.setResponse(response);
+
+        for (Node node : group) {

Review comment:
       Thanks for your advice. I've changed the logic.




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

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