MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / delete_array

Method delete_array

tiledb/sm/array/array.cc:714–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714void Array::delete_array(ContextResources& resources, const URI& uri) {
715 auto& vfs = resources.vfs();
716 auto array_dir =
717 ArrayDirectory(resources, uri, 0, std::numeric_limits<uint64_t>::max());
718
719 // Delete fragments and commits
720 Array::delete_fragments(resources, array_dir);
721
722 // Delete array metadata, fragment metadata and array schema files
723 // Note: metadata files may not be present, try to delete anyway
724 vfs.remove_files(&resources.compute_tp(), array_dir.array_meta_uris());
725 vfs.remove_files(&resources.compute_tp(), array_dir.fragment_meta_uris());
726 vfs.remove_files(&resources.compute_tp(), array_dir.array_schema_uris());
727
728 // Delete all tiledb child directories
729 // Note: using vfs.ls() here could delete user data
730 std::vector<URI> dirs;
731 auto parent_dir = array_dir.uri().c_str();
732 for (auto array_dir_name : constants::array_dir_names) {
733 dirs.emplace_back(URI(parent_dir + array_dir_name));
734 }
735 vfs.remove_dirs(&resources.compute_tp(), dirs);
736 vfs.remove_dir_if_empty(array_dir.uri());
737}
738
739void Array::delete_array(const URI& uri) {
740 // Check that data deletion is allowed

Callers

nothing calls this directly

Calls 15

closeMethod · 0.95
ArrayExceptionClass · 0.85
throw_if_not_okFunction · 0.85
vfsMethod · 0.80
remove_filesMethod · 0.80
compute_tpMethod · 0.80
c_strMethod · 0.80
remove_dirsMethod · 0.80
is_tiledbMethod · 0.80
ArrayDirectoryClass · 0.70
URIClass · 0.50
uriMethod · 0.45

Tested by

no test coverage detected