Skip to content

Commit

Permalink
Migrate GCSParameters constructor to implementation file.
Browse files Browse the repository at this point in the history
  • Loading branch information
bekadavis9 committed Jan 7, 2025
1 parent 3aeeece commit 5426002
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
25 changes: 25 additions & 0 deletions tiledb/sm/filesystem/gcs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,31 @@ namespace tiledb::sm {
/* CONSTRUCTORS & DESTRUCTORS */
/* ********************************* */

GCSParameters::GCSParameters(const Config& config)
: endpoint_(config.get<std::string>("vfs.gcs.endpoint", Config::must_find))
, project_id_(
config.get<std::string>("vfs.gcs.project_id", Config::must_find))
, service_account_key_(config.get<std::string>(
"vfs.gcs.service_account_key", Config::must_find))
, workload_identity_configuration_(config.get<std::string>(
"vfs.gcs.workload_identity_configuration", Config::must_find))
, impersonate_service_account_(config.get<std::string>(
"vfs.gcs.impersonate_service_account", Config::must_find))
, multi_part_size_(
config.get<uint64_t>("vfs.gcs.multi_part_size", Config::must_find))
, max_parallel_ops_(
config.get<uint64_t>("vfs.gcs.max_parallel_ops", Config::must_find))
, use_multi_part_upload_(
config.get<bool>("vfs.gcs.use_multi_part_upload", Config::must_find))
, request_timeout_ms_(
config.get<uint64_t>("vfs.gcs.request_timeout_ms", Config::must_find))
, max_direct_upload_size_(config.get<uint64_t>(
"vfs.gcs.max_direct_upload_size", Config::must_find)) {
if (endpoint_.empty() && getenv("TILEDB_TEST_GCS_ENDPOINT")) {
endpoint_ = getenv("TILEDB_TEST_GCS_ENDPOINT");
}
}

GCS::GCS(ThreadPool* thread_pool, const Config& config)
: gcs_params_(GCSParameters(config))
, state_(State::UNINITIALIZED)
Expand Down
26 changes: 1 addition & 25 deletions tiledb/sm/filesystem/gcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,7 @@ class GCSException : public StatusException {
struct GCSParameters {
GCSParameters() = delete;

GCSParameters(const Config& config)
: endpoint_(
config.get<std::string>("vfs.gcs.endpoint", Config::must_find))
, project_id_(
config.get<std::string>("vfs.gcs.project_id", Config::must_find))
, service_account_key_(config.get<std::string>(
"vfs.gcs.service_account_key", Config::must_find))
, workload_identity_configuration_(config.get<std::string>(
"vfs.gcs.workload_identity_configuration", Config::must_find))
, impersonate_service_account_(config.get<std::string>(
"vfs.gcs.impersonate_service_account", Config::must_find))
, multi_part_size_(
config.get<uint64_t>("vfs.gcs.multi_part_size", Config::must_find))
, max_parallel_ops_(
config.get<uint64_t>("vfs.gcs.max_parallel_ops", Config::must_find))
, use_multi_part_upload_(config.get<bool>(
"vfs.gcs.use_multi_part_upload", Config::must_find))
, request_timeout_ms_(config.get<uint64_t>(
"vfs.gcs.request_timeout_ms", Config::must_find))
, max_direct_upload_size_(config.get<uint64_t>(
"vfs.gcs.max_direct_upload_size", Config::must_find)) {
if (endpoint_.empty() && getenv("TILEDB_TEST_GCS_ENDPOINT")) {
endpoint_ = getenv("TILEDB_TEST_GCS_ENDPOINT");
}
};
GCSParameters(const Config& config);

~GCSParameters() = default;

Expand Down
5 changes: 4 additions & 1 deletion tiledb/sm/filesystem/vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ class S3_within_VFS {
* This class implements a virtual filesystem that directs filesystem-related
* function execution to the appropriate backend based on the input URI.
*/
class VFS : private VFSBase, protected Azure_within_VFS, GCS_within_VFS, S3_within_VFS {
class VFS : private VFSBase,
protected Azure_within_VFS,
GCS_within_VFS,
S3_within_VFS {
public:
/* ********************************* */
/* TYPE DEFINITIONS */
Expand Down

0 comments on commit 5426002

Please sign in to comment.