| 58 | } while (0) |
| 59 | |
| 60 | Result<std::shared_ptr<FileSystem>> MakeRootFileSystem() { |
| 61 | S3Options options; |
| 62 | if (!FLAGS_access_key.empty()) { |
| 63 | options = S3Options::FromAccessKey(FLAGS_access_key, FLAGS_secret_key); |
| 64 | } else { |
| 65 | options = S3Options::Defaults(); |
| 66 | } |
| 67 | options.endpoint_override = FLAGS_endpoint; |
| 68 | options.scheme = FLAGS_scheme; |
| 69 | options.region = FLAGS_region; |
| 70 | options.allow_bucket_creation = FLAGS_create; |
| 71 | return S3FileSystem::Make(options); |
| 72 | } |
| 73 | |
| 74 | Result<std::shared_ptr<FileSystem>> MakeFileSystem() { |
| 75 | ARROW_ASSIGN_OR_RAISE(auto fs, MakeRootFileSystem()); |