MCPcopy Create free account
hub / github.com/apple/foundationdb / incrementalTruncate

Method incrementalTruncate

fdbserver/DiskQueue.actor.cpp:301–311  ·  view source on GitHub ↗

FIXME: Merge this function with IAsyncFileSystem::incrementalDeleteFile().

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 7

delayFunction · 0.85
TraceEventClass · 0.85
detailMethod · 0.80
sizeMethod · 0.45
truncateMethod · 0.45
syncMethod · 0.45
getFilenameMethod · 0.45

Tested by

no test coverage detected