|
|
@ -37,6 +37,16 @@ |
|
|
|
#include "src/core/ext/client_config/lb_policy.h" |
|
|
|
#include "src/core/ext/client_config/lb_policy.h" |
|
|
|
#include "src/core/lib/iomgr/resolve_address.h" |
|
|
|
#include "src/core/lib/iomgr/resolve_address.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(roth, ctiller): In the long term, we are considering replacing
|
|
|
|
|
|
|
|
// the resolver_result data structure with grpc_channel_args. The idea is
|
|
|
|
|
|
|
|
// that the resolver will return a set of channel args that contains the
|
|
|
|
|
|
|
|
// information that is currently in the resolver_result struct. For
|
|
|
|
|
|
|
|
// example, there will be specific args indicating the set of addresses
|
|
|
|
|
|
|
|
// and the name of the LB policy to instantiate. Note that if we did
|
|
|
|
|
|
|
|
// this, we would probably want to change the data structure of
|
|
|
|
|
|
|
|
// grpc_channel_args such to a hash table or AVL or some other data
|
|
|
|
|
|
|
|
// structure that does not require linear search to find keys.
|
|
|
|
|
|
|
|
|
|
|
|
/// Used to represent addresses returned by the resolver.
|
|
|
|
/// Used to represent addresses returned by the resolver.
|
|
|
|
typedef struct grpc_address { |
|
|
|
typedef struct grpc_address { |
|
|
|
grpc_resolved_address address; |
|
|
|
grpc_resolved_address address; |
|
|
@ -63,9 +73,10 @@ void grpc_addresses_destroy(grpc_addresses* addresses); |
|
|
|
/// Results reported from a grpc_resolver.
|
|
|
|
/// Results reported from a grpc_resolver.
|
|
|
|
typedef struct grpc_resolver_result grpc_resolver_result; |
|
|
|
typedef struct grpc_resolver_result grpc_resolver_result; |
|
|
|
|
|
|
|
|
|
|
|
/// Takes ownership of \a addresses.
|
|
|
|
/// Takes ownership of \a addresses and \a lb_policy_args.
|
|
|
|
grpc_resolver_result* grpc_resolver_result_create(grpc_addresses* addresses, |
|
|
|
grpc_resolver_result* grpc_resolver_result_create( |
|
|
|
const char* lb_policy_name); |
|
|
|
grpc_addresses* addresses, const char* lb_policy_name, |
|
|
|
|
|
|
|
grpc_channel_args* lb_policy_args); |
|
|
|
void grpc_resolver_result_ref(grpc_resolver_result* result); |
|
|
|
void grpc_resolver_result_ref(grpc_resolver_result* result); |
|
|
|
void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx, |
|
|
|
void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx, |
|
|
|
grpc_resolver_result* result); |
|
|
|
grpc_resolver_result* result); |
|
|
@ -78,4 +89,8 @@ grpc_addresses* grpc_resolver_result_get_addresses( |
|
|
|
const char* grpc_resolver_result_get_lb_policy_name( |
|
|
|
const char* grpc_resolver_result_get_lb_policy_name( |
|
|
|
grpc_resolver_result* result); |
|
|
|
grpc_resolver_result* result); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Caller does NOT take ownership of result.
|
|
|
|
|
|
|
|
grpc_channel_args* grpc_resolver_result_get_lb_policy_args( |
|
|
|
|
|
|
|
grpc_resolver_result* result); |
|
|
|
|
|
|
|
|
|
|
|
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */ |
|
|
|
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */ |
|
|
|