MCPcopy Create free account
hub / github.com/apache/arrow / Move

Method Move

cpp/src/arrow/filesystem/s3fs.cc:3401–3418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3399}
3400
3401Status S3FileSystem::Move(const std::string& src, const std::string& dest) {
3402 // XXX We don't implement moving directories as it would be too expensive:
3403 // one must copy all directory contents one by one (including object data),
3404 // then delete the original contents.
3405
3406 ARROW_ASSIGN_OR_RAISE(auto src_path, S3Path::FromString(src));
3407 RETURN_NOT_OK(ValidateFilePath(src_path));
3408 ARROW_ASSIGN_OR_RAISE(auto dest_path, S3Path::FromString(dest));
3409 RETURN_NOT_OK(ValidateFilePath(dest_path));
3410
3411 if (src_path == dest_path) {
3412 return Status::OK();
3413 }
3414 RETURN_NOT_OK(impl_->CopyObject(src_path, dest_path));
3415 RETURN_NOT_OK(impl_->DeleteObject(src_path.bucket, src_path.key));
3416 // Source parent may be implicitly deleted if it became empty, recreate it
3417 return impl_->EnsureParentExists(src_path);
3418}
3419
3420Status S3FileSystem::CopyFile(const std::string& src, const std::string& dest) {
3421 ARROW_ASSIGN_OR_RAISE(auto src_path, S3Path::FromString(src));

Callers 15

garrow_file_system_moveFunction · 0.45
TEST_FFunction · 0.45
InitMethod · 0.45
CreateMultipartUploadMethod · 0.45
AbortMethod · 0.45
TriggerUploadRequestMethod · 0.45
GetBackendMethod · 0.45
BucketExistsMethod · 0.45
CreateBucketMethod · 0.45
CreateEmptyDirMethod · 0.45
DeleteObjectMethod · 0.45

Calls 5

ValidateFilePathFunction · 0.85
CopyObjectMethod · 0.80
DeleteObjectMethod · 0.80
EnsureParentExistsMethod · 0.80
OKFunction · 0.50

Tested by 10

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TestMoveFileMethod · 0.36
TestMoveDirMethod · 0.36
TEST_FFunction · 0.36
TestBucketFunction · 0.36
TestMoveContainerToPathFunction · 0.36
TestMovePathFunction · 0.36