plusplusjiajia commented on code in PR #828:
URL: https://github.com/apache/iceberg-cpp/pull/828#discussion_r3650027144


##########
src/iceberg/resolving_file_io.h:
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+/// \file iceberg/resolving_file_io.h
+/// \brief FileIO that resolves the concrete implementation per file-path 
scheme.
+
+#include <memory>
+#include <mutex>
+#include <string>
+#include <string_view>
+#include <unordered_map>
+#include <vector>
+
+#include "iceberg/file_io.h"
+#include "iceberg/iceberg_export.h"
+#include "iceberg/result.h"
+#include "iceberg/storage_credential.h"
+#include "iceberg/util/string_util.h"
+
+namespace iceberg {
+
+/// \brief FileIO that uses the location scheme to choose the concrete FileIO,
+/// mirroring Java's ResolvingFileIO.
+///
+/// Resolution is per file path and independent of `warehouse` (often a logical
+/// identifier rather than a storage URI). Implementations are loaded lazily
+/// from FileIORegistry with this FileIO's properties and cached. Vended
+/// credentials are forwarded in full to every resolved FileIO that supports
+/// them; each applies the prefixes it understands and ignores the rest.
+class ICEBERG_EXPORT ResolvingFileIO final : public FileIO,
+                                             public SupportsStorageCredentials 
{
+ public:
+  explicit ResolvingFileIO(std::unordered_map<std::string, std::string> 
properties);
+  ~ResolvingFileIO() override;
+
+  /// \brief The FileIORegistry name of the implementation serving `location`.
+  static Result<std::string_view> ResolveFileIOName(std::string_view location);

Review Comment:
   @wgtmac Done — now a free function in `resolving_file_io_internal.h` (not 
installed), so  the scheme mapping is no longer public API. It keeps 
`ICEBERG_EXPORT` only so tests link in shared builds, as 
`arrow/arrow_io_internal.h` does.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to