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

Method startReadThreads

fdbserver/KeyValueStoreSQLite.actor.cpp:2197–2212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2195}
2196
2197void KeyValueStoreSQLite::startReadThreads() {
2198 int nReadThreads = readCursors.size();
2199 TaskPriority taskId = g_network->getCurrentTask();
2200 g_network->setCurrentTask(TaskPriority::DiskRead);
2201 for (int i = 0; i < nReadThreads; i++) {
2202 std::string threadName = format("fdb-sqlite-r-%d", i);
2203 if (threadName.size() > 15) {
2204 threadName = "fdb-sqlite-r";
2205 }
2206 // Note: the below is actually a coroutine and not a thread.
2207 readThreads->addThread(
2208 new Reader(filename, type == KeyValueStoreType::SSD_BTREE_V2, readsComplete, logID, &readCursors[i]),
2209 threadName.c_str());
2210 }
2211 g_network->setCurrentTask(taskId);
2212}
2213
2214void KeyValueStoreSQLite::set(KeyValueRef keyValue, const Arena* arena) {
2215 ++writesRequested;

Callers 1

Calls 6

formatFunction · 0.50
sizeMethod · 0.45
getCurrentTaskMethod · 0.45
setCurrentTaskMethod · 0.45
addThreadMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected