diff --git a/src/iceberg/catalog/rest/resource_paths.cc b/src/iceberg/catalog/rest/resource_paths.cc index 462b03763..f86a75ec0 100644 --- a/src/iceberg/catalog/rest/resource_paths.cc +++ b/src/iceberg/catalog/rest/resource_paths.cc @@ -38,14 +38,6 @@ Result> ResourcePaths::Make(std::string base_uri, ResourcePaths::ResourcePaths(std::string base_uri, const std::string& prefix) : base_uri_(std::move(base_uri)), prefix_(prefix.empty() ? "" : (prefix + "/")) {} -Status ResourcePaths::SetBaseUri(const std::string& base_uri) { - if (base_uri.empty()) { - return InvalidArgument("Base URI is empty"); - } - base_uri_ = base_uri; - return {}; -} - Result ResourcePaths::Config() const { return std::format("{}/v1/config", base_uri_); } diff --git a/src/iceberg/catalog/rest/resource_paths.h b/src/iceberg/catalog/rest/resource_paths.h index 069711794..1b502aaa7 100644 --- a/src/iceberg/catalog/rest/resource_paths.h +++ b/src/iceberg/catalog/rest/resource_paths.h @@ -23,7 +23,6 @@ #include #include "iceberg/catalog/rest/iceberg_rest_export.h" -#include "iceberg/catalog/rest/type_fwd.h" #include "iceberg/result.h" #include "iceberg/type_fwd.h" @@ -44,9 +43,6 @@ class ICEBERG_REST_EXPORT ResourcePaths { static Result> Make(std::string base_uri, const std::string& prefix); - /// \brief Set the base URI of the REST catalog server. - Status SetBaseUri(const std::string& base_uri); - /// \brief Get the /v1/config endpoint path. Result Config() const; diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index cbd38c5ae..d75da6404 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -132,7 +132,9 @@ Result> RestCatalog::Make( // Update resource paths based on the final config ICEBERG_ASSIGN_OR_RAISE(auto final_uri, final_config->Uri()); - ICEBERG_RETURN_UNEXPECTED(paths->SetBaseUri(std::string(TrimTrailingSlash(final_uri)))); + ICEBERG_ASSIGN_OR_RAISE( + paths, ResourcePaths::Make(std::string(TrimTrailingSlash(final_uri)), + final_config->Get(RestCatalogProperties::kPrefix))); return std::shared_ptr( new RestCatalog(std::move(final_config), std::move(file_io), std::move(paths),