[refactor](cloud) Extract SyncPoint to common cpp#37165
[refactor](cloud) Extract SyncPoint to common cpp#37165dataroaring merged 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
| @@ -18,10 +18,10 @@ | |||
| #include <gtest/gtest.h> | |||
There was a problem hiding this comment.
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.
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.
warning: 'recycler/obj_storage_client.h' file not found [clang-diagnostic-error]
#include "recycler/obj_storage_client.h"
^| cloud::config::write_schema_kv = true; | ||
|
|
||
| auto sp = cloud::SyncPoint::get_instance(); | ||
| auto sp = SyncPoint::get_instance(); |
There was a problem hiding this comment.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
| auto sp = SyncPoint::get_instance(); | |
| auto *sp = SyncPoint::get_instance(); |
| brpc::Server brpc_server; | ||
|
|
||
| auto sp = cloud::SyncPoint::get_instance(); | ||
| auto sp = SyncPoint::get_instance(); |
There was a problem hiding this comment.
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.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
| auto sp = SyncPoint::get_instance(); | |
| auto *sp = SyncPoint::get_instance(); |
|
|
||
| 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.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
| auto sp = doris::SyncPoint::get_instance(); | |
| auto *sp = doris::SyncPoint::get_instance(); |
| 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.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
| auto sp = doris::SyncPoint::get_instance(); | |
| auto *sp = doris::SyncPoint::get_instance(); |
|
|
||
| void test_return_point() { | ||
| auto sp = doris::cloud::SyncPoint::get_instance(); | ||
| auto sp = doris::SyncPoint::get_instance(); |
There was a problem hiding this comment.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
| auto sp = doris::SyncPoint::get_instance(); | |
| auto *sp = doris::SyncPoint::get_instance(); |
| 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.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
| auto sp = doris::SyncPoint::get_instance(); | |
| auto *sp = doris::SyncPoint::get_instance(); |
| # 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.
it seems all injection points are not functioning any more?
There was a problem hiding this comment.
Injection points will be enabled via http api
There was a problem hiding this comment.
name the folder "common" or "common/cpp" or "cpp-common"?
and add a README.md to it.
There was a problem hiding this comment.
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 |
| 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.
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/cppdirectory in the future.