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

caogaofei pushed a commit to branch beyyes/0.13/double_live_sync
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/beyyes/0.13/double_live_sync 
by this push:
     new c65a160f2a add sync conf get rpc
c65a160f2a is described below

commit c65a160f2a5d5ea107af494060d567be395fa2a0
Author: Beyyes <[email protected]>
AuthorDate: Sun Oct 23 13:22:24 2022 +0800

    add sync conf get rpc
---
 .../org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java   | 9 +++++++++
 thrift/src/main/thrift/rpc.thrift                                | 8 ++++++++
 2 files changed, 17 insertions(+)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java
 
b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java
index 7e862e532f..cafeb879d5 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java
@@ -127,6 +127,7 @@ import 
org.apache.iotdb.service.rpc.thrift.TSSetSchemaTemplateReq;
 import org.apache.iotdb.service.rpc.thrift.TSSetTimeZoneReq;
 import org.apache.iotdb.service.rpc.thrift.TSSetUsingTemplateReq;
 import org.apache.iotdb.service.rpc.thrift.TSStatus;
+import org.apache.iotdb.service.rpc.thrift.TSSyncConfigurationResp;
 import org.apache.iotdb.service.rpc.thrift.TSTracingInfo;
 import org.apache.iotdb.service.rpc.thrift.TSUnsetSchemaTemplateReq;
 import 
org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException;
@@ -2193,6 +2194,14 @@ public class TSServiceImpl implements TSIService.Iface {
     }
   }
 
+  @Override
+  public TSSyncConfigurationResp getSyncConfigurationResp() {
+    IoTDBConfig conf = IoTDBDescriptor.getInstance().getConfig();
+    TSSyncConfigurationResp syncConf = new 
TSSyncConfigurationResp(conf.isEnableOperationSync());
+    syncConf.setSecondaryAddress(conf.getSecondaryAddress());
+    syncConf.setSecondaryPort(conf.getSecondaryPort());
+    return syncConf;
+  }
   protected TSStatus executeNonQueryPlan(PhysicalPlan plan) {
     try {
       if (isEnableOperationSync) {
diff --git a/thrift/src/main/thrift/rpc.thrift 
b/thrift/src/main/thrift/rpc.thrift
index fbcabef7f2..9d53b7c464 100644
--- a/thrift/src/main/thrift/rpc.thrift
+++ b/thrift/src/main/thrift/rpc.thrift
@@ -432,6 +432,12 @@ struct TSOperationSyncWriteReq {
   3: required binary physicalPlan
 }
 
+struct TSSyncConfigurationResp {
+  1: required bool enableOperationSync
+  2: optional string secondaryAddress
+  3: optional i32 secondaryPort
+}
+
 service TSIService {
   TSOpenSessionResp openSession(1:TSOpenSessionReq req);
 
@@ -530,4 +536,6 @@ service TSIService {
   TSStatus dropSchemaTemplate(1:TSDropSchemaTemplateReq req);
 
   TSStatus executeOperationSync(1:TSOperationSyncWriteReq req);
+
+  TSSyncConfigurationResp getSyncConfigurationResp();
 }
\ No newline at end of file

Reply via email to