Skip to content
Closed
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
11 changes: 4 additions & 7 deletions cpp/src/arrow/filesystem/gcsfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -784,18 +784,15 @@ Result<std::shared_ptr<io::OutputStream>> GcsFileSystem::OpenAppendStream(
return Status::NotImplemented("Append is not supported in GCS");
}

GcsFileSystem::GcsFileSystem(const GcsOptions& options, const io::IOContext& context)
: FileSystem(context), impl_(std::make_shared<Impl>(options)) {}

namespace internal {

std::shared_ptr<GcsFileSystem> MakeGcsFileSystemForTest(const GcsOptions& options) {
std::shared_ptr<GcsFileSystem> GcsFileSystem::Make(const GcsOptions& options,
const io::IOContext& context) {
// Cannot use `std::make_shared<>` as the constructor is private.
return std::shared_ptr<GcsFileSystem>(
new GcsFileSystem(options, io::default_io_context()));
}

} // namespace internal
GcsFileSystem::GcsFileSystem(const GcsOptions& options, const io::IOContext& context)
: FileSystem(context), impl_(std::make_shared<Impl>(options)) {}

} // namespace fs
} // namespace arrow
10 changes: 3 additions & 7 deletions cpp/src/arrow/filesystem/gcsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ namespace fs {
class GcsFileSystem;
struct GcsOptions;
struct GcsCredentials;
namespace internal {
// TODO(ARROW-1231) - remove, and provide a public API (static GcsFileSystem::Make()).
std::shared_ptr<GcsFileSystem> MakeGcsFileSystemForTest(const GcsOptions& options);
} // namespace internal

/// Options for the GcsFileSystem implementation.
struct ARROW_EXPORT GcsOptions {
Expand Down Expand Up @@ -174,11 +170,11 @@ class ARROW_EXPORT GcsFileSystem : public FileSystem {
const std::string& path,
const std::shared_ptr<const KeyValueMetadata>& metadata) override;

private:
/// Create a GcsFileSystem instance from the given options.
friend std::shared_ptr<GcsFileSystem> internal::MakeGcsFileSystemForTest(
const GcsOptions& options);
static std::shared_ptr<GcsFileSystem> Make(
const GcsOptions& options, const io::IOContext& = io::default_io_context());

private:
explicit GcsFileSystem(const GcsOptions& options, const io::IOContext& io_context);

class Impl;
Expand Down
Loading