[Feature] Configure starlet cache in storage dir (#19778)

* [Feature] Configure starlet cache in storage dir

Signed-off-by: Zijie Lu <wslzj40@gmail.com>
This commit is contained in:
Zijie Lu 2023-03-22 14:50:50 +08:00 committed by GitHub
parent bc2f90fd6a
commit f82af2dce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -53,6 +53,7 @@
#include "exec/workgroup/work_group_fwd.h"
#include "gen_cpp/BackendService.h"
#include "gen_cpp/TFileBrokerService.h"
#include "gutil/strings/join.h"
#include "gutil/strings/substitute.h"
#include "runtime/broker_mgr.h"
#include "runtime/client_cache.h"
@ -323,6 +324,14 @@ Status ExecEnv::_init(const std::vector<StorePath>& store_paths) {
_lake_update_manager = new lake::UpdateManager(_lake_location_provider, update_mem_tracker());
_lake_tablet_manager = new lake::TabletManager(_lake_location_provider, _lake_update_manager,
config::lake_metadata_cache_limit);
if (config::starlet_cache_dir.empty()) {
std::vector<std::string> starlet_cache_paths;
std::for_each(store_paths.begin(), store_paths.end(), [&](StorePath root_path) {
std::string starlet_cache_path = root_path.path + "/starlet_cache";
starlet_cache_paths.emplace_back(starlet_cache_path);
});
config::starlet_cache_dir = JoinStrings(starlet_cache_paths, ":");
}
#elif defined(BE_TEST)
_lake_location_provider = new lake::FixedLocationProvider(_store_paths.front().path);
_lake_update_manager = new lake::UpdateManager(_lake_location_provider, update_mem_tracker());

View File

@ -52,11 +52,6 @@ brpc_port = 8060
# sys_log_verbose_modules = *
# log_buffer_level = -1
# When integrate with STAROS with local disk cache enabled, this is the absolute
# root dir for cache to write, multiple paths can be separated by colon (:).
# e.g. starlet_cache_dir = /data/disk1/cache/:data/disk2/cache/
#starlet_cache_dir =
# JVM options for be
# eg:
# JAVA_OPTS="-Djava.security.krb5.conf=/etc/krb5.conf"