Skip to content
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

add sql.scan_default_parallel config. param. #128

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/service_benchmark/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ DEFINE_bool(ddl, false, "issue ddl instead of using built-in table. Required for
DEFINE_bool(secondary, false, "use secondary index"); //NOLINT
DEFINE_int64(scan_block_size, 100, "max records processed by scan operator before yielding to other tasks"); //NOLINT
DEFINE_int64(scan_yield_interval, 1, "max time (ms) processed by scan operator before yielding to other tasks"); //NOLINT
DEFINE_int64(scan_default_parallel, 1, "max parallel execution count of scan tasks"); //NOLINT

namespace tateyama::service_benchmark {

Expand Down
10 changes: 10 additions & 0 deletions include/jogasaki/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@ class configuration {
direct_commit_callback_ = arg;
}

[[nodiscard]] std::size_t scan_default_parallel() const noexcept {
return scan_default_parallel_;
}

void scan_default_parallel(std::size_t arg) noexcept {
scan_default_parallel_ = arg;
}

friend inline std::ostream& operator<<(std::ostream& out, configuration const& cfg) {

//NOLINTBEGIN
Expand Down Expand Up @@ -546,6 +554,7 @@ class configuration {
print_non_default(rtx_parallel_scan);
print_non_default(thousandths_ratio_check_local_first);
print_non_default(direct_commit_callback);
print_non_default(scan_default_parallel);

if(cfg.req_cancel_config()) {
out << "req_cancel_config:" << *cfg.req_cancel_config() << " "; \
Expand Down Expand Up @@ -606,6 +615,7 @@ class configuration {
bool rtx_parallel_scan_ = false;
std::size_t thousandths_ratio_check_local_first_ = 100;
bool direct_commit_callback_ = false;
std::size_t scan_default_parallel_ = 1;

};

Expand Down
1 change: 1 addition & 0 deletions src/jogasaki/api/impl/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ void dump_public_configurations(configuration const& cfg) {
LOGCFG << "(dev_rtx_parallel_scan) " << cfg.rtx_parallel_scan() << " : whether to enable parallel scan for RTX";
LOGCFG << "(dev_thousandths_ratio_check_local_first) " << cfg.thousandths_ratio_check_local_first() << " : how frequently (represented as count out of 1000 executions) task scheduler checks local task queue first";
LOGCFG << "(dev_direct_commit_callback) " << cfg.direct_commit_callback() << " : whether to make callback directly from shirakami to client on pre-commit response (only for `available` and `accepted`)";
LOGCFG << "(scan_default_parallel) " << cfg.scan_default_parallel() << " : max parallel execution count of scan tasks";
}

status database::start() {
Expand Down
3 changes: 3 additions & 0 deletions src/jogasaki/api/resource/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ bool process_sql_config(std::shared_ptr<jogasaki::configuration>& ret, tateyama:
if (auto v = jogasaki_config->get<bool>("dev_direct_commit_callback")) {
ret->direct_commit_callback(v.value());
}
if (auto v = jogasaki_config->get<std::size_t>("scan_default_parallel")) {
ret->scan_default_parallel(v.value());
}
return true;
}

Expand Down