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

Method writeRangeFile

fdbclient/BackupContainerFileSystem.actor.cpp:1197–1211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195}
1196
1197Future<Reference<IBackupFile>> BackupContainerFileSystem::writeRangeFile(Version snapshotBeginVersion,
1198 int snapshotFileCount,
1199 Version fileVersion,
1200 int blockSize) {
1201 std::string fileName = format(
1202 "range,%" PRId64 ",%s,%d", fileVersion, deterministicRandom()->randomUniqueID().toString().c_str(), blockSize);
1203
1204 // In order to test backward compatibility in simulation, sometimes write to the old path format
1205 if (g_network->isSimulated() && deterministicRandom()->coinflip()) {
1206 return writeFile(BackupContainerFileSystemImpl::old_rangeVersionFolderString(fileVersion) + fileName);
1207 }
1208
1209 return writeFile(BackupContainerFileSystemImpl::snapshotFolderString(snapshotBeginVersion) +
1210 format("/%d/", snapshotFileCount / (BUGGIFY ? 1 : 5000)) + fileName);
1211}
1212
1213Future<std::pair<std::vector<RangeFile>, std::map<std::string, KeyRange>>>
1214BackupContainerFileSystem::readKeyspaceSnapshot(KeyspaceSnapshotFile snapshot) {

Callers 2

Future<Void> _executeFunction · 0.80

Calls 8

deterministicRandomFunction · 0.85
writeFileFunction · 0.85
randomUniqueIDMethod · 0.80
coinflipMethod · 0.80
formatFunction · 0.50
c_strMethod · 0.45
toStringMethod · 0.45
isSimulatedMethod · 0.45

Tested by

no test coverage detected