SteveYurongSu commented on code in PR #12217:
URL: https://github.com/apache/iotdb/pull/12217#discussion_r1538967601


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/subscription/SubscriptionMetaSyncer.java:
##########
@@ -0,0 +1,118 @@
+/*
+ * 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.subscription;
+
+import org.apache.iotdb.common.rpc.thrift.TSStatus;
+import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.commons.concurrent.ThreadName;
+import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
+import org.apache.iotdb.commons.pipe.config.PipeConfig;
+import org.apache.iotdb.confignode.manager.ConfigManager;
+import org.apache.iotdb.confignode.manager.ProcedureManager;
+import org.apache.iotdb.rpc.TSStatusCode;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+public class SubscriptionMetaSyncer {
+
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SubscriptionMetaSyncer.class);
+
+  private static final ScheduledExecutorService SYNC_EXECUTOR =
+      IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor(
+          ThreadName.SUBSCRIPTION_RUNTIME_META_SYNCER.getName());
+  private static final long INITIAL_SYNC_DELAY_MINUTES =
+      PipeConfig.getInstance().getPipeMetaSyncerInitialSyncDelayMinutes();
+  private static final long SYNC_INTERVAL_MINUTES =
+      PipeConfig.getInstance().getPipeMetaSyncerSyncIntervalMinutes();
+
+  private final ConfigManager configManager;
+
+  private Future<?> metaSyncFuture;
+
+  // This variable is used to record whether the last sync operation was 
successful. If successful,
+  // before the next sync operation, it can be determined based on 
SubscriptionInfoVersion whether
+  // the
+  // metadata in DN and the latest metadata in CN have been synchronized, 
thereby skipping
+  // unnecessary sync operations.
+  private boolean isLastSubscriptionSyncSuccessful = false;
+
+  SubscriptionMetaSyncer(ConfigManager configManager) {

Review Comment:
   TODO: enable



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to