FIXME: Merge this function with IAsyncFileSystem::incrementalDeleteFile().
| 299 | |
| 300 | // FIXME: Merge this function with IAsyncFileSystem::incrementalDeleteFile(). |
| 301 | ACTOR static void incrementalTruncate(Reference<IAsyncFile> file) { |
| 302 | state int64_t remainingFileSize = wait(file->size()); |
| 303 | |
| 304 | for (; remainingFileSize > 0; remainingFileSize -= FLOW_KNOBS->INCREMENTAL_DELETE_TRUNCATE_AMOUNT) { |
| 305 | wait(file->truncate(remainingFileSize)); |
| 306 | wait(file->sync()); |
| 307 | wait(delay(FLOW_KNOBS->INCREMENTAL_DELETE_INTERVAL)); |
| 308 | } |
| 309 | |
| 310 | TraceEvent("DiskQueueReplaceTruncateEnded").detail("Filename", file->getFilename()); |
| 311 | } |
| 312 | |
| 313 | #if defined(_WIN32) |
| 314 | ACTOR static Future<Reference<IAsyncFile>> replaceFile(Reference<IAsyncFile> toReplace) { |
nothing calls this directly
no test coverage detected