| 227 | } |
| 228 | |
| 229 | capi_return_t tiledb_array_delete_fragments_v2( |
| 230 | tiledb_ctx_t* ctx, |
| 231 | const char* uri_str, |
| 232 | uint64_t timestamp_start, |
| 233 | uint64_t timestamp_end) { |
| 234 | // Allocate an array object |
| 235 | auto uri = tiledb::sm::URI(uri_str, URI::must_be_valid); |
| 236 | tiledb_array_t* array = tiledb_array_t::make_handle(ctx->resources(), uri); |
| 237 | |
| 238 | // Set array open timestamps and open the array for exclusive modification |
| 239 | try { |
| 240 | array->set_timestamp_start(timestamp_start); |
| 241 | array->set_timestamp_end(timestamp_end); |
| 242 | throw_if_not_ok(array->open( |
| 243 | static_cast<QueryType>(TILEDB_MODIFY_EXCLUSIVE), |
| 244 | static_cast<EncryptionType>(TILEDB_NO_ENCRYPTION), |
| 245 | nullptr, |
| 246 | 0)); |
| 247 | } catch (...) { |
| 248 | tiledb_array_t::break_handle(array); |
| 249 | throw; |
| 250 | } |
| 251 | |
| 252 | // Delete fragments |
| 253 | try { |
| 254 | array->delete_fragments(uri, timestamp_start, timestamp_end); |
| 255 | } catch (...) { |
| 256 | throw_if_not_ok(array->close()); |
| 257 | tiledb_array_t::break_handle(array); |
| 258 | throw; |
| 259 | } |
| 260 | |
| 261 | // Close and delete the array |
| 262 | throw_if_not_ok(array->close()); |
| 263 | tiledb_array_t::break_handle(array); |
| 264 | |
| 265 | return TILEDB_OK; |
| 266 | } |
| 267 | |
| 268 | capi_return_t tiledb_array_delete_fragments_list( |
| 269 | tiledb_ctx_t* ctx, |
no test coverage detected