-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor](cloud) Extract SyncPoint to common cpp #37165
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -18,10 +18,10 @@ | |||
#include <gtest/gtest.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^
@@ -18,13 +18,13 @@ | |||
#include <chrono> | |||
|
|||
#include "common/logging.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'common/logging.h' file not found [clang-diagnostic-error]
#include "common/logging.h"
^
@@ -17,7 +17,7 @@ | |||
|
|||
#include "recycler/obj_storage_client.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'recycler/obj_storage_client.h' file not found [clang-diagnostic-error]
#include "recycler/obj_storage_client.h"
^
@@ -71,22 +71,26 @@ int main(int argc, char** argv) { | |||
cloud::config::fdb_cluster_file_path = "fdb.cluster"; | |||
cloud::config::write_schema_kv = true; | |||
|
|||
auto sp = cloud::SyncPoint::get_instance(); | |||
auto sp = SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = SyncPoint::get_instance(); | |
auto *sp = SyncPoint::get_instance(); |
@@ -163,7 +163,7 @@ TEST(MetaServerTest, StartAndStop) { | |||
options.num_threads = 1; | |||
brpc::Server brpc_server; | |||
|
|||
auto sp = cloud::SyncPoint::get_instance(); | |||
auto sp = SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = SyncPoint::get_instance(); | |
auto *sp = SyncPoint::get_instance(); |
[](void* p) { *reinterpret_cast<int*>(p) = 0; }); | ||
sp->set_call_back("decrypt_ak_sk:get_encryption_key", | ||
[](void* p) { *reinterpret_cast<std::string*>(p) = "test"; }); | ||
auto sp = SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = SyncPoint::get_instance(); | |
auto *sp = SyncPoint::get_instance(); |
@@ -58,7 +58,7 @@ void foo() { | |||
} | |||
|
|||
void test_foo_single_thread() { | |||
auto sp = doris::cloud::SyncPoint::get_instance(); | |||
auto sp = doris::SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = doris::SyncPoint::get_instance(); | |
auto *sp = doris::SyncPoint::get_instance(); |
@@ -108,7 +108,7 @@ | |||
|
|||
std::mutex mtx; | |||
std::condition_variable cv; | |||
auto sp = doris::cloud::SyncPoint::get_instance(); | |||
auto sp = doris::SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = doris::SyncPoint::get_instance(); | |
auto *sp = doris::SyncPoint::get_instance(); |
@@ -266,7 +266,7 @@ | |||
} | |||
|
|||
void test_return_point() { | |||
auto sp = doris::cloud::SyncPoint::get_instance(); | |||
auto sp = doris::SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = doris::SyncPoint::get_instance(); | |
auto *sp = doris::SyncPoint::get_instance(); |
@@ -283,9 +283,9 @@ TEST(TxnKvTest, CompatibleGetTest) { | |||
TEST(TxnKvTest, PutLargeValueTest) { | |||
auto txn_kv = std::make_shared<MemTxnKv>(); | |||
|
|||
auto sp = SyncPoint::get_instance(); | |||
auto sp = doris::SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = doris::SyncPoint::get_instance(); | |
auto *sp = doris::SyncPoint::get_instance(); |
common_cpp/sync_point.h
Outdated
# define TEST_INJECTION_POINT_SINGLETON() if (doris::config::enable_injection_point) { LOG_INFO("enter inject point {}", x); SYNC_POINT_SINGLETON(); } | ||
# define TEST_INJECTION_POINT_RETURN_WITH_VALUE(x, default_ret_val, ...) if (doris::config::enable_injection_point) { LOG_INFO("enter inject point {}", x); SYNC_POINT_RETURN_WITH_VALUE(x, default_ret_val, __VA_ARGS__); } | ||
# define TEST_INJECTION_POINT_RETURN_WITH_VOID(x, ...) if (doris::config::enable_injection_point) { LOG_INFO("enter inject point {}", x); SYNC_POINT_RETURN_WITH_VOID(x, __VA_ARGS__); } | ||
# define TEST_INJECTION_POINT(x) SYNC_POINT(x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems all injection points are not functioning any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Injection points will be enabled via http api
common_cpp/CMakeLists.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name the folder "common" or "common/cpp" or "cpp-common"?
and add a README.md to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about naming it as common/rock
and setting the include directory to common
, then the user would locate and identify the included files by #include "rock/sync_point.h"
.
The word rock
is just an example, it could be other words.
TPC-H: Total hot run time: 40765 ms
|
TPC-DS: Total hot run time: 174542 ms
|
ClickBench: Total hot run time: 30.16 s
|
be/CMakeLists.txt
Outdated
@@ -118,6 +118,7 @@ set(BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") | |||
set(ENV{DORIS_HOME} "${BASE_DIR}/..") | |||
set(BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}") | |||
set(GENSRC_DIR "${BASE_DIR}/../gensrc/build/") | |||
set(COMMON_CPP_DIR "${BASE_DIR}/../common_cpp/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common/cpp/xxxx.h
#inlucde "common/cpp/xxx.h"
#include "cpp/xxx.h"
INC_DIR="./common"
INC_DIR="./"
run buildall |
run buildall |
TPC-H: Total hot run time: 39939 ms
|
TPC-DS: Total hot run time: 170447 ms
|
ClickBench: Total hot run time: 30.92 s
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
## Proposed changes Extract SyncPoint to common cpp directory. Some code shared between BE and Cloud will gradually be extracted to the `$repo_root/common/cpp` directory in the future.
Proposed changes
Extract SyncPoint to common cpp directory. Some code shared between BE and Cloud will gradually be extracted to the
$repo_root/common/cpp
directory in the future.