Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config for metaclient #2807

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ public LeaderElectionClient(MetaClientConfig metaClientConfig, String participan
LOG.info("Creating MetaClient for LeaderElectionClient");
if (MetaClientConfig.StoreType.ZOOKEEPER.equals(metaClientConfig.getStoreType())) {
ZkMetaClientConfig zkMetaClientConfig = new ZkMetaClientConfig.ZkMetaClientConfigBuilder().setConnectionAddress(
metaClientConfig.getConnectionAddress()).setZkSerializer((new LeaderInfoSerializer())).build();
metaClientConfig.getConnectionAddress())
.setZkSerializer((new LeaderInfoSerializer()))
.setSessionTimeoutInMillis(metaClientConfig.getSessionTimeoutInMillis())
.setMetaClientReconnectPolicy(metaClientConfig.getMetaClientReconnectPolicy())
.setConnectionInitTimeoutInMillis(metaClientConfig.getConnectionInitTimeoutInMillis())
.setAuthEnabled(metaClientConfig.isAuthEnabled())
.build();
Comment on lines +100 to +106
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we don't have config validator? Or these are the optional fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are optional fields. If user do not populate, they will have default values.

_metaClient = new ZkMetaClientFactory().getMetaClient(zkMetaClientConfig);
_metaClient.connect();
_metaClient.subscribeStateChanges(_connectStateListener);
Expand Down
Loading