Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C.41 compliance: GCS factory constructor. #5393

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions test/src/unit-vfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ TEST_CASE(
"[gcs][credentials][impersonation]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
std::string impersonate_service_account, target_service_account;
std::vector<std::string> delegates;

Expand All @@ -848,9 +847,7 @@ TEST_CASE(

require_tiledb_ok(cfg.set(
"vfs.gcs.impersonate_service_account", impersonate_service_account));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand All @@ -870,16 +867,13 @@ TEST_CASE(
"[gcs][credentials][service-account]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
// The content of the credentials does not matter; it does not get parsed
// until it is used in an API request, which we are not doing.
std::string service_account_key = "{\"foo\": \"bar\"}";

require_tiledb_ok(
cfg.set("vfs.gcs.service_account_key", service_account_key));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand All @@ -896,7 +890,6 @@ TEST_CASE(
"[gcs][credentials][service-account-and-impersonation]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
// The content of the credentials does not matter; it does not get parsed
// until it is used in an API request, which we are not doing.
std::string service_account_key = "{\"foo\": \"bar\"}";
Expand All @@ -906,9 +899,7 @@ TEST_CASE(
cfg.set("vfs.gcs.service_account_key", service_account_key));
require_tiledb_ok(cfg.set(
"vfs.gcs.impersonate_service_account", impersonate_service_account));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand All @@ -934,17 +925,13 @@ TEST_CASE(
"[gcs][credentials][external-account]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
// The content of the credentials does not matter; it does not get parsed
// until it is used in an API request, which we are not doing.
std::string workload_identity_configuration = "{\"foo\": \"bar\"}";

require_tiledb_ok(cfg.set(
"vfs.gcs.workload_identity_configuration",
workload_identity_configuration));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand Down
5 changes: 4 additions & 1 deletion tiledb/api/c_api/config/config_api_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* The MIT License
*
* @copyright Copyright (c) 2023 TileDB, Inc.
* @copyright Copyright (c) 2023-2024 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -455,6 +455,9 @@ TILEDB_EXPORT void tiledb_config_free(tiledb_config_t** config) TILEDB_NOEXCEPT;
* The maximum permissible delay between Azure netwwork request retry
* attempts, in milliseconds.
* **Default**: 60000
* - `vfs.gcs.endpoint` <br>
* The GCS endpoint. <br>
bekadavis9 marked this conversation as resolved.
Show resolved Hide resolved
* **Default**: ""
* - `vfs.gcs.project_id` <br>
* Set the GCS project ID to create new buckets to. Not required unless you
* are going to use the VFS to create buckets. <br>
Expand Down
4 changes: 0 additions & 4 deletions tiledb/common/exception/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ inline Status Status_S3Error(const std::string& msg) {
inline Status Status_AzureError(const std::string& msg) {
return {"[TileDB::Azure] Error", msg};
}
/** Return a FS_GCS error class Status with a given message **/
inline Status Status_GCSError(const std::string& msg) {
return {"[TileDB::GCS] Error", msg};
}
/** Return a FS_HDFS error class Status with a given message **/
inline Status Status_HDFSError(const std::string& msg) {
return {"[TileDB::HDFS] Error", msg};
Expand Down
7 changes: 4 additions & 3 deletions tiledb/sm/cpp_api/config.h
bekadavis9 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/**
* @file config.h
*
* @author Ravi Gaddipati
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2017-2023 TileDB, Inc.
* @copyright Copyright (c) 2017-2024 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -627,6 +625,9 @@ class Config {
* The maximum permissible delay between Azure netwwork request retry
* attempts, in milliseconds.
* **Default**: 60000
* - `vfs.gcs.endpoint` <br>
* The GCS endpoint. <br>
bekadavis9 marked this conversation as resolved.
Show resolved Hide resolved
* **Default**: ""
* - `vfs.gcs.project_id` <br>
* Set the GCS project ID to create new buckets to. Not required unless you
* are going to use the VFS to create buckets. <br>
Expand Down
Loading
Loading