morningman commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1023867940
##########
be/src/service/brpc_service.cpp:
##########
@@ -49,7 +49,18 @@ Status BRpcService::start(int port, int num_threads) {
options.num_threads = num_threads;
}
- if (_server->Start(port, &options) != 0) {
+ butil::EndPoint point;
+ const char* host;
Review Comment:
extract a method
##########
be/src/runtime/data_stream_sender.cpp:
##########
@@ -164,8 +164,14 @@ Status DataStreamSender::Channel::send_batch(PRowBatch*
batch, bool eos) {
RefCountClosure<PTransmitDataResult>>(
&_brpc_request, _closure);
RETURN_IF_ERROR(st);
- std::string brpc_url =
- fmt::format("http://{}:{}", _brpc_dest_addr.hostname,
_brpc_dest_addr.port);
+ std::string brpc_url;
+ //format an ipv6 address
Review Comment:
I think we should extract a method for this.
##########
fe/fe-core/src/main/java/org/apache/doris/qe/HelpModule.java:
##########
@@ -266,7 +266,8 @@ public void setUpModule() throws IOException, UserException
{
URL helpResource = instance.getClass().getClassLoader()
.getResource(HELP_ZIP_FILE_NAME);
if (helpResource == null) {
- throw new IOException("Can not find help zip file: " +
HELP_ZIP_FILE_NAME);
+ return;
+ // throw new IOException("Can not find help zip file: " +
HELP_ZIP_FILE_NAME);
Review Comment:
Why modify this?
##########
be/src/util/brpc_client_cache.h:
##########
@@ -60,7 +60,17 @@ class BrpcClientCache {
std::shared_ptr<T> get_client(const std::string& host, int port) {
std::string host_port = fmt::format("{}:{}", host, port);
- return get_client(host_port);
+ std::shared_ptr<T> stub_ptr;
+ auto get_value = [&stub_ptr](typename StubMap<T>::mapped_type& v) {
stub_ptr = v; };
+ if (LIKELY(_stub_map.if_contains(host_port, get_value))) {
+ return stub_ptr;
+ }
+
+ // new one stub and insert into map
Review Comment:
duplicate code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]