|
|
|
@ -130,7 +130,7 @@ static void zookeeper_next(grpc_resolver *resolver, |
|
|
|
|
grpc_client_config **target_config, |
|
|
|
|
grpc_iomgr_closure *on_complete) { |
|
|
|
|
zookeeper_resolver *r = (zookeeper_resolver *)resolver; |
|
|
|
|
gpr_log(GPR_INFO, "zookeeper_next"); |
|
|
|
|
gpr_log(GPR_DEBUG, "zookeeper_next"); |
|
|
|
|
gpr_mu_lock(&r->mu); |
|
|
|
|
GPR_ASSERT(r->next_completion == NULL); |
|
|
|
|
r->next_completion = on_complete; |
|
|
|
@ -160,7 +160,7 @@ static void zookeeper_watcher(zhandle_t *zookeeper_handle, int type, int state, |
|
|
|
|
const char *path, void *watcher_ctx) { |
|
|
|
|
if (watcher_ctx != NULL) { |
|
|
|
|
zookeeper_resolver *r = (zookeeper_resolver *)watcher_ctx; |
|
|
|
|
gpr_log(GPR_INFO, "tpye = %d, state = %d", type, state); |
|
|
|
|
gpr_log(GPR_DEBUG, "tpye = %d, state = %d", type, state); |
|
|
|
|
if (state == ZOO_CONNECTED_STATE){ |
|
|
|
|
gpr_mu_lock(&r->mu); |
|
|
|
|
if (r->resolving == 0) { |
|
|
|
@ -299,7 +299,7 @@ static void zookeeper_get_children_node_completion(int rc, const char *value, |
|
|
|
|
gpr_free(buffer); |
|
|
|
|
if (address != NULL) { |
|
|
|
|
/** Further resolve address by DNS */ |
|
|
|
|
gpr_log(GPR_INFO, address); |
|
|
|
|
gpr_log(GPR_DEBUG, address); |
|
|
|
|
grpc_resolve_address(address, NULL, zookeeper_dns_resolved, r); |
|
|
|
|
gpr_free(address); |
|
|
|
|
} else { |
|
|
|
@ -374,7 +374,7 @@ static void zookeeper_get_node_completion(int rc, const char *value, |
|
|
|
|
address = zookeeper_parse_address(buffer, value_len); |
|
|
|
|
gpr_free(buffer); |
|
|
|
|
if (address != NULL) { |
|
|
|
|
gpr_log(GPR_INFO, address); |
|
|
|
|
gpr_log(GPR_DEBUG, address); |
|
|
|
|
r->resolved_addrs = gpr_malloc(sizeof(grpc_resolved_addresses)); |
|
|
|
|
r->resolved_addrs->addrs = NULL; |
|
|
|
|
r->resolved_addrs->naddrs = 0; |
|
|
|
@ -403,7 +403,7 @@ static void zookeeper_start_resolving_locked(zookeeper_resolver *r) { |
|
|
|
|
GRPC_RESOLVER_REF(&r->base, "zookeeper-resolving"); |
|
|
|
|
GPR_ASSERT(r->resolving == 0); |
|
|
|
|
r->resolving = 1; |
|
|
|
|
gpr_log(GPR_INFO, "zookeeper_start_resolving_locked"); |
|
|
|
|
gpr_log(GPR_DEBUG, "zookeeper_start_resolving_locked"); |
|
|
|
|
zookeeper_resolve_address(r); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|