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

Method doClose

fdbserver/KeyValueStoreRocksDB.actor.cpp:1752–1772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1750 Future<Void> getError() const override { return errorFuture; }
1751
1752 ACTOR static void doClose(RocksDBKeyValueStore* self, bool deleteOnClose) {
1753 self->sharedState->setClosing();
1754
1755 // The metrics future retains a reference to the DB, so stop it before we delete it.
1756 self->metrics.reset();
1757
1758 wait(self->readThreads->stop());
1759 self->readIterPool.reset();
1760 auto a = new Writer::CloseAction(self->path, deleteOnClose);
1761 auto f = a->done.getFuture();
1762 self->writeThread->post(a);
1763 wait(f);
1764 wait(self->writeThread->stop());
1765 if (self->closePromise.canBeSet()) {
1766 self->closePromise.send(Void());
1767 }
1768 if (self->db != nullptr) {
1769 delete self->db;
1770 }
1771 delete self;
1772 }
1773
1774 Future<Void> onClosed() const override { return closePromise.getFuture(); }
1775

Callers

nothing calls this directly

Calls 8

setClosingMethod · 0.80
VoidClass · 0.50
resetMethod · 0.45
stopMethod · 0.45
getFutureMethod · 0.45
postMethod · 0.45
canBeSetMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected