MCPcopy Create free account
hub / github.com/apache/brpc / init

Method init

tools/rpc_press/rpc_press_impl.cpp:58–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56};
57
58int PressClient::init() {
59 brpc::ChannelOptions rpc_options;
60 rpc_options.connect_timeout_ms = _options->connect_timeout_ms;
61 rpc_options.timeout_ms = _options->timeout_ms;
62 rpc_options.max_retry = _options->max_retry;
63 rpc_options.protocol = _options->protocol;
64 rpc_options.connection_type = _options->connection_type;
65 if (_options->attachment_size > 0) {
66 _attachment.clear();
67 _attachment.assign(_options->attachment_size, 'a');
68 }
69 if (_rpc_client.Init(_options->host.c_str(), _options->lb_policy.c_str(),
70 &rpc_options) != 0){
71 LOG(ERROR) << "Fail to initialize channel";
72 return -1;
73 }
74 _method_descriptor = find_method_by_name(
75 _options->service, _options->method, _importer);
76 if (NULL == _method_descriptor) {
77 LOG(ERROR) << "Fail to find method=" << _options->service << '.'
78 << _options->method;
79 return -1;
80 }
81 _response_prototype = get_prototype_by_method_descriptor(
82 _method_descriptor, false, _factory);
83 return 0;
84}
85
86void PressClient::call_method(brpc::Controller* cntl, Message* request,
87 Message* response, Closure* done) {

Callers 13

mainFunction · 0.45
runMethod · 0.45
TESTFunction · 0.45
install_debug_allocatorFunction · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
fill_position_hint_mapFunction · 0.45
RemoveHintedOnPauseMethod · 0.45
perf_insert_eraseFunction · 0.45

Calls 15

find_method_by_nameFunction · 0.85
PathExistsFunction · 0.85
find_last_ofMethod · 0.80
substrMethod · 0.80
fieldMethod · 0.80
DirNameMethod · 0.80
load_messagesMethod · 0.80
FilePathClass · 0.50
clearMethod · 0.45
assignMethod · 0.45

Tested by 11

TESTFunction · 0.36
install_debug_allocatorFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
fill_position_hint_mapFunction · 0.36
RemoveHintedOnPauseMethod · 0.36
perf_insert_eraseFunction · 0.36
perf_seekFunction · 0.36