@@ -119,48 +119,38 @@ OpenedArray::load_delete_and_update_conditions() {
119119 auto conditions = std::vector<QueryCondition>(locations.size ());
120120 auto update_values = std::vector<std::vector<UpdateValue>>(locations.size ());
121121
122- auto status = parallel_for (
123- &resources_.compute_tp (), 0 , locations.size (), [&](size_t i) {
124- // Get condition marker.
125- auto & uri = locations[i].uri ();
122+ parallel_for (&resources_.compute_tp (), 0 , locations.size (), [&](size_t i) {
123+ // Get condition marker.
124+ auto & uri = locations[i].uri ();
126125
127- // Read the condition from storage.
128- auto tile = GenericTileIO::load (
129- resources_,
130- uri,
131- locations[i].offset (),
132- *(encryption_key ()),
133- resources_.ephemeral_memory_tracker ());
134-
135- if (tiledb::sm::utils::parse::ends_with (
136- locations[i].condition_marker (),
137- tiledb::sm::constants::delete_file_suffix)) {
138- conditions[i] = tiledb::sm::deletes_and_updates::serialization::
139- deserialize_condition (
140- i,
141- locations[i].condition_marker (),
142- tile->data (),
143- tile->size ());
144- } else if (tiledb::sm::utils::parse::ends_with (
145- locations[i].condition_marker (),
146- tiledb::sm::constants::update_file_suffix)) {
147- auto && [cond, uvs] = tiledb::sm::deletes_and_updates::serialization::
148- deserialize_update_condition_and_values (
149- i,
150- locations[i].condition_marker (),
151- tile->data (),
152- tile->size ());
153- conditions[i] = std::move (cond);
154- update_values[i] = std::move (uvs);
155- } else {
156- throw ArrayException (" Unknown condition marker extension" );
157- }
158-
159- throw_if_not_ok (conditions[i].check (array_schema_latest ()));
160- return Status::Ok ();
161- });
162- RETURN_NOT_OK_TUPLE (status, nullopt , nullopt );
126+ // Read the condition from storage.
127+ auto tile = GenericTileIO::load (
128+ resources_,
129+ uri,
130+ locations[i].offset (),
131+ *(encryption_key ()),
132+ resources_.ephemeral_memory_tracker ());
133+
134+ if (tiledb::sm::utils::parse::ends_with (
135+ locations[i].condition_marker (),
136+ tiledb::sm::constants::delete_file_suffix)) {
137+ conditions[i] =
138+ tiledb::sm::deletes_and_updates::serialization::deserialize_condition (
139+ i, locations[i].condition_marker (), tile->data (), tile->size ());
140+ } else if (tiledb::sm::utils::parse::ends_with (
141+ locations[i].condition_marker (),
142+ tiledb::sm::constants::update_file_suffix)) {
143+ auto && [cond, uvs] = tiledb::sm::deletes_and_updates::serialization::
144+ deserialize_update_condition_and_values (
145+ i, locations[i].condition_marker (), tile->data (), tile->size ());
146+ conditions[i] = std::move (cond);
147+ update_values[i] = std::move (uvs);
148+ } else {
149+ throw ArrayException (" Unknown condition marker extension" );
150+ }
163151
152+ throw_if_not_ok (conditions[i].check (array_schema_latest ()));
153+ });
164154 return {Status::Ok (), conditions, update_values};
165155}
166156
@@ -738,16 +728,14 @@ void Array::delete_fragments(
738728
739729 // Delete fragments and commits
740730 auto vfs = &(resources.vfs ());
741- throw_if_not_ok (parallel_for (
742- &resources.compute_tp (), 0 , fragment_uris.size (), [&](size_t i) {
743- throw_if_not_ok (vfs->remove_dir (fragment_uris[i].uri_ ));
744- bool is_file = false ;
745- throw_if_not_ok (vfs->is_file (commit_uris_to_delete[i], &is_file));
746- if (is_file) {
747- throw_if_not_ok (vfs->remove_file (commit_uris_to_delete[i]));
748- }
749- return Status::Ok ();
750- }));
731+ parallel_for (&resources.compute_tp (), 0 , fragment_uris.size (), [&](size_t i) {
732+ throw_if_not_ok (vfs->remove_dir (fragment_uris[i].uri_ ));
733+ bool is_file = false ;
734+ throw_if_not_ok (vfs->is_file (commit_uris_to_delete[i], &is_file));
735+ if (is_file) {
736+ throw_if_not_ok (vfs->remove_file (commit_uris_to_delete[i]));
737+ }
738+ });
751739}
752740
753741void Array::delete_fragments (
@@ -1755,7 +1743,7 @@ std::unordered_map<std::string, uint64_t> Array::get_average_var_cell_sizes()
17551743
17561744 // Load all metadata for tile var sizes among fragments.
17571745 for (const auto & var_name : var_names) {
1758- throw_if_not_ok ( parallel_for (
1746+ parallel_for (
17591747 &resources_.compute_tp (),
17601748 0 ,
17611749 fragment_metadata.size (),
@@ -1764,17 +1752,16 @@ std::unordered_map<std::string, uint64_t> Array::get_average_var_cell_sizes()
17641752 // evolution that do not exists in this fragment.
17651753 const auto & schema = fragment_metadata[f]->array_schema ();
17661754 if (!schema->is_field (var_name)) {
1767- return Status::Ok () ;
1755+ return ;
17681756 }
17691757
17701758 fragment_metadata[f]->loaded_metadata ()->load_tile_var_sizes (
17711759 *encryption_key (), var_name);
1772- return Status::Ok ();
1773- }));
1760+ });
17741761 }
17751762
17761763 // Now compute for each var size names, the average cell size.
1777- throw_if_not_ok ( parallel_for (
1764+ parallel_for (
17781765 &resources_.compute_tp (), 0 , var_names.size (), [&](const uint64_t n) {
17791766 uint64_t total_size = 0 ;
17801767 uint64_t cell_num = 0 ;
@@ -1800,9 +1787,7 @@ std::unordered_map<std::string, uint64_t> Array::get_average_var_cell_sizes()
18001787
18011788 uint64_t average_cell_size = total_size / cell_num;
18021789 ret[var_name] = std::max<uint64_t >(average_cell_size, 1 );
1803-
1804- return Status::Ok ();
1805- }));
1790+ });
18061791
18071792 return ret;
18081793}
@@ -2032,15 +2017,12 @@ void Array::do_load_metadata() {
20322017
20332018 auto metadata_num = array_metadata_to_load.size ();
20342019 std::vector<shared_ptr<Tile>> metadata_tiles (metadata_num);
2035- throw_if_not_ok (
2036- parallel_for (&resources_.compute_tp (), 0 , metadata_num, [&](size_t m) {
2037- const auto & uri = array_metadata_to_load[m].uri_ ;
2038-
2039- metadata_tiles[m] = GenericTileIO::load (
2040- resources_, uri, 0 , *encryption_key (), memory_tracker_);
2020+ parallel_for (&resources_.compute_tp (), 0 , metadata_num, [&](size_t m) {
2021+ const auto & uri = array_metadata_to_load[m].uri_ ;
20412022
2042- return Status::Ok ();
2043- }));
2023+ metadata_tiles[m] = GenericTileIO::load (
2024+ resources_, uri, 0 , *encryption_key (), memory_tracker_);
2025+ });
20442026
20452027 // Compute array metadata size for the statistics
20462028 uint64_t meta_size = 0 ;
0 commit comments