Skip to content
Snippets Groups Projects
Commit bc203a88 authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

Updated zookeper resolver to new LB API

parent 7496d01a
No related branches found
No related tags found
No related merge requests found
...@@ -182,6 +182,7 @@ static void zookeeper_on_resolved(void *arg, ...@@ -182,6 +182,7 @@ static void zookeeper_on_resolved(void *arg,
grpc_lb_policy *lb_policy; grpc_lb_policy *lb_policy;
size_t i; size_t i;
if (addresses != NULL) { if (addresses != NULL) {
grpc_lb_policy_args lb_policy_args;
config = grpc_client_config_create(); config = grpc_client_config_create();
subchannels = gpr_malloc(sizeof(grpc_subchannel *) * addresses->naddrs); subchannels = gpr_malloc(sizeof(grpc_subchannel *) * addresses->naddrs);
for (i = 0; i < addresses->naddrs; i++) { for (i = 0; i < addresses->naddrs; i++) {
...@@ -191,8 +192,10 @@ static void zookeeper_on_resolved(void *arg, ...@@ -191,8 +192,10 @@ static void zookeeper_on_resolved(void *arg,
subchannels[i] = grpc_subchannel_factory_create_subchannel( subchannels[i] = grpc_subchannel_factory_create_subchannel(
r->subchannel_factory, &args); r->subchannel_factory, &args);
} }
lb_policy_args.subchannels = subchannels;
lb_policy_args.num_subchannels = addresses->naddrs;
lb_policy = lb_policy =
grpc_lb_policy_create(r->lb_policy_name, subchannels, addresses->naddrs); grpc_lb_policy_create(r->lb_policy_name, &lb_policy_args);
grpc_client_config_set_lb_policy(config, lb_policy); grpc_client_config_set_lb_policy(config, lb_policy);
GRPC_LB_POLICY_UNREF(lb_policy, "construction"); GRPC_LB_POLICY_UNREF(lb_policy, "construction");
grpc_resolved_addresses_destroy(addresses); grpc_resolved_addresses_destroy(addresses);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment