Skip to content

Commit

Permalink
feat: support in synctools
Browse files Browse the repository at this point in the history
  • Loading branch information
dl239 committed Nov 7, 2023
1 parent ff249f9 commit d627094
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class SyncToolConfig {
// public static int CHANNEL_KEEP_ALIVE_TIME;
public static String ZK_CLUSTER;
public static String ZK_ROOT_PATH;
public static String ZK_CERT;
public static String SYNC_TASK_PROGRESS_PATH;

public static String HADOOP_CONF_DIR;
Expand Down Expand Up @@ -86,6 +87,7 @@ private static void parseFromProperties(Properties prop) {
if (ZK_ROOT_PATH.isEmpty()) {
throw new RuntimeException("zookeeper.root_path should not be empty");
}
ZK_CERT = prop.getProperty("zookeeper.cert", "");

HADOOP_CONF_DIR = prop.getProperty("hadoop.conf.dir", "");
if (HADOOP_CONF_DIR.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ public SyncToolImpl(String endpoint) throws SqlException, InterruptedException {
this.zkClient = new ZKClient(ZKConfig.builder()
.cluster(SyncToolConfig.ZK_CLUSTER)
.namespace(SyncToolConfig.ZK_ROOT_PATH)
.cert(SyncToolConfig.ZK_CERT)
.build());
Preconditions.checkState(zkClient.connect(), "zk connect failed");
SdkOption option = new SdkOption();
option.setZkCluster(SyncToolConfig.ZK_CLUSTER);
option.setZkPath(SyncToolConfig.ZK_ROOT_PATH);
option.setZkCert(SyncToolConfig.ZK_CERT);
this.router = new SqlClusterExecutor(option);
this.zkCollectorPath = SyncToolConfig.ZK_ROOT_PATH + "/sync_tool/collector";

Expand Down

0 comments on commit d627094

Please sign in to comment.