Skip to content

Commit

Permalink
[opt](be/recycler) Add validator for ObjStorageClient RateLimiter con…
Browse files Browse the repository at this point in the history
…fig param
  • Loading branch information
SWJTU-ZhangLei committed Feb 20, 2025
1 parent 1e875e4 commit 399274a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,11 +1294,19 @@ DEFINE_mInt32(s3_read_max_wait_time_ms, "800");

DEFINE_mBool(enable_s3_rate_limiter, "false");
DEFINE_mInt64(s3_get_bucket_tokens, "1000000000000000000");
DEFINE_Validator(s3_get_bucket_tokens, [](int64_t config) -> bool { return config > 0; });

DEFINE_mInt64(s3_get_token_per_second, "1000000000000000000");
DEFINE_Validator(s3_get_token_per_second, [](int64_t config) -> bool { return config > 0; });

DEFINE_mInt64(s3_get_token_limit, "0");

DEFINE_mInt64(s3_put_bucket_tokens, "1000000000000000000");
DEFINE_Validator(s3_put_bucket_tokens, [](int64_t config) -> bool { return config > 0; });

DEFINE_mInt64(s3_put_token_per_second, "1000000000000000000");
DEFINE_Validator(s3_put_token_per_second, [](int64_t config) -> bool { return config > 0; });

DEFINE_mInt64(s3_put_token_limit, "0");

DEFINE_String(trino_connector_plugin_dir, "${DORIS_HOME}/plugins/connectors");
Expand Down
5 changes: 5 additions & 0 deletions cloud/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,16 @@ CONF_Bool(enable_retry_txn_conflict, "true");

CONF_mBool(enable_s3_rate_limiter, "false");
CONF_mInt64(s3_get_bucket_tokens, "1000000000000000000");
CONF_Validator(s3_get_bucket_tokens, [](int64_t config) -> bool { return config > 0; });

CONF_mInt64(s3_get_token_per_second, "1000000000000000000");
CONF_Validator(s3_get_token_per_second, [](int64_t config) -> bool { return config > 0; });
CONF_mInt64(s3_get_token_limit, "0");

CONF_mInt64(s3_put_bucket_tokens, "1000000000000000000");
CONF_Validator(s3_put_bucket_tokens, [](int64_t config) -> bool { return config > 0; });
CONF_mInt64(s3_put_token_per_second, "1000000000000000000");
CONF_Validator(s3_put_token_per_second, [](int64_t config) -> bool { return config > 0; });
CONF_mInt64(s3_put_token_limit, "0");

// The secondary package name of the MetaService.
Expand Down

0 comments on commit 399274a

Please sign in to comment.