ClickHouse/src/IO/S3Settings.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.1 KiB
C++
Raw Normal View History

2024-05-25 16:46:07 +00:00
#pragma once
#include <map>
#include <mutex>
#include <optional>
#include <base/types.h>
#include <Interpreters/Context_fwd.h>
#include <Common/Throttler_fwd.h>
#include <IO/S3Common.h>
#include <IO/S3Defines.h>
namespace Poco::Util { class AbstractConfiguration; }
namespace DB
{
struct Settings;
struct S3Settings
{
S3::AuthSettings auth_settings;
S3::RequestSettings request_settings;
2024-06-13 12:23:32 +00:00
void loadFromConfig(
const Poco::Util::AbstractConfiguration & config,
const std::string & config_prefix,
const DB::Settings & settings);
void updateIfChanged(const S3Settings & settings);
2024-05-25 16:46:07 +00:00
};
class S3SettingsByEndpoint
{
public:
void loadFromConfig(
const Poco::Util::AbstractConfiguration & config,
const std::string & config_prefix,
const DB::Settings & settings);
std::optional<S3Settings> getSettings(
const std::string & endpoint,
const std::string & user,
bool ignore_user = false) const;
private:
mutable std::mutex mutex;
std::map<const String, const S3Settings> s3_settings;
};
}