You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2023/06/06 06:12:21 UTC

[GitHub] [arrow] kou commented on a diff in pull request #35701: GH-35903: [C++] Skeleton for Azure Blob Storage filesystem implementation

kou commented on code in PR #35701:
URL: https://github.com/apache/arrow/pull/35701#discussion_r1218955605


##########
.github/workflows/cpp.yml:
##########
@@ -329,6 +331,7 @@ jobs:
           - msystem_lower: clang64
             msystem_upper: CLANG64
     env:
+      ARROW_AZURE: OFF

Review Comment:
   ditto.



##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -0,0 +1,159 @@
+// 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.
+
+#include "arrow/filesystem/azurefs.h"
+
+#include "arrow/result.h"
+#include "arrow/util/checked_cast.h"
+
+namespace arrow {
+namespace fs {
+
+// -----------------------------------------------------------------------
+// AzureOptions Implementation
+
+AzureOptions::AzureOptions() {}
+
+bool AzureOptions::Equals(const AzureOptions& other) const {
+  return (scheme == other.scheme && account_dfs_url == other.account_dfs_url &&
+          account_blob_url == other.account_blob_url &&
+          credentials_kind == other.credentials_kind);
+}
+
+// -----------------------------------------------------------------------
+// AzureFilesystem Implementation
+
+class AzureFileSystem::Impl : public std::enable_shared_from_this<AzureFileSystem::Impl> {

Review Comment:
   Can we remove `std::enable_shared_from_this`?
   
   ```suggestion
   class AzureFileSystem::Impl {
   ```



##########
cpp/src/arrow/filesystem/azurefs.h:
##########
@@ -0,0 +1,152 @@
+// 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
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "arrow/filesystem/filesystem.h"
+#include "arrow/util/macros.h"
+#include "arrow/util/uri.h"
+
+namespace Azure {
+namespace Core {
+namespace Credentials {
+
+class TokenCredential;
+
+}  // namespace Credentials
+}  // namespace Core
+namespace Storage {
+
+class StorageSharedKeyCredential;
+
+}  // namespace Storage
+}  // namespace Azure
+
+namespace arrow {
+namespace fs {
+
+enum class AzureCredentialsKind : int8_t {
+  /// Anonymous access (no credentials used), public
+  Anonymous,
+  /// Use explicitly-provided access key pair
+  StorageCredentials,
+  /// Use ServicePrincipleCredentials
+  ServicePrincipleCredentials,
+  /// Use Sas Token to authenticate
+  Sas,
+  /// Use Connection String
+  ConnectionString
+};
+
+/// Options for the AzureFileSystem implementation.
+struct ARROW_EXPORT AzureOptions {
+  std::string scheme;
+  std::string account_dfs_url;
+  std::string account_blob_url;
+  bool is_azurite = false;
+  AzureCredentialsKind credentials_kind = AzureCredentialsKind::Anonymous;
+
+  std::string sas_token;
+  std::string connection_string;
+  std::shared_ptr<Azure::Storage::StorageSharedKeyCredential>
+      storage_credentials_provider;
+  std::shared_ptr<Azure::Core::Credentials::TokenCredential>
+      service_principle_credentials_provider;
+
+  AzureOptions();
+
+  bool Equals(const AzureOptions& other) const;
+};

Review Comment:
   How about removing `AzureOptions` and related codes for now and adding it as the next step?



##########
.github/workflows/cpp.yml:
##########
@@ -226,6 +227,7 @@ jobs:
           - os: windows-2019
             name: Windows 2019
     env:
+      ARROW_AZURE: OFF

Review Comment:
   Could you revert this because `ARROW_AZURE` is `OFF` by default.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org