Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
lgbo-ustc committed Nov 22, 2022
1 parent 9d66c46 commit 70abaff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/local-engine/Common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void registerAllFunctions()
}
constexpr auto CH_BACKEND_CONF_PREFIX = "spark.gluten.sql.columnar.backend.ch";
constexpr auto CH_RUNTIME_CONF = "runtime_conf";
constexpr auto CH_RUNTIME_SETTINGS = "local_engine.settings";

constexpr auto LOCAL_FILE_CACHE_DIR = "local_cache_root";
constexpr size_t LOCAL_FILE_CACHE_CAPACITY = 10l * (1<<30);
Expand Down Expand Up @@ -129,11 +130,10 @@ static std::map<std::string, std::string> getBackendConf(const std::string & pla
void initCHRuntimeConfig(const std::map<std::string, std::string> & conf)
{}

void initLocalCacheForRemoteFiles(const std::map<std::string, std::string> & backend_conf, Poco::AutoPtr<Poco::Util::AbstractConfiguration> context_conf)
void initLocalCacheForRemoteFiles(Poco::AutoPtr<Poco::Util::AbstractConfiguration> context_conf)
{
std::string conf_prefix = std::string(CH_BACKEND_CONF_PREFIX);
auto conf_iter = backend_conf.find(conf_prefix + ".enable_local_cache");
if (conf_iter == backend_conf.end() || conf_iter->second != "true")
std::string enable_path = std::string(CH_RUNTIME_SETTINGS) + ".use_local_cache_for_remote_storage";
if (!context_conf->has(enable_path) || (context_conf->getString(enable_path) != "true" && context_conf->getString(enable_path) != "1"))
return;
local_engine::registerHDFSMetadata(DB::RemoteFileMetadataFactory::instance());

Expand Down Expand Up @@ -209,7 +209,7 @@ void init(const std::string & plan)

/// Initialize settings
auto settings = Settings();
std::string settings_path = "local_engine.settings";
std::string settings_path = CH_RUNTIME_SETTINGS;
Poco::Util::AbstractConfiguration::Keys config_keys;
config->keys(settings_path, config_keys);
for (const std::string & key : config_keys)
Expand All @@ -235,7 +235,7 @@ void init(const std::string & plan)
}

registerAllFunctions();
initLocalCacheForRemoteFiles(ch_backend_conf, config);
initLocalCacheForRemoteFiles(config);
LOG_INFO(&Poco::Logger::get("ClickHouseBackend"), "Register all functions.");

#if USE_EMBEDDED_COMPILER
Expand Down

0 comments on commit 70abaff

Please sign in to comment.