Implement SimpleConfigTransaction::getCommittedVersion

This commit is contained in:
sfc-gh-tclinkenbeard 2021-04-30 09:43:18 -07:00
parent a3891a9246
commit 91f6f82cd8
1 changed files with 5 additions and 2 deletions

View File

@ -31,6 +31,7 @@ class SimpleConfigTransactionImpl {
ConfigTransactionInterface cti;
int numRetries{ 0 };
Error deferredError{ success() };
bool committed{ false };
ACTOR static Future<Version> getReadVersion(SimpleConfigTransactionImpl* self) {
ConfigTransactionGetVersionRequest req;
@ -64,6 +65,7 @@ class SimpleConfigTransactionImpl {
}
Version version = wait(self->version);
wait(self->cti.commit.getReply(ConfigTransactionCommitRequest(version, self->mutations)));
self->committed = true;
return Void();
}
@ -108,6 +110,8 @@ public:
return version;
}
Version getCommittedVersion() const { return committed ? version.get() : ::invalidVersion; }
void reset() {
version = Future<Version>{};
mutations = Standalone<VectorRef<MutationRef>>{};
@ -209,8 +213,7 @@ Future<Void> SimpleConfigTransaction::commit() {
}
Version SimpleConfigTransaction::getCommittedVersion() {
// TODO: Implement
return ::invalidVersion;
return impl->getCommittedVersion();
}
int64_t SimpleConfigTransaction::getApproximateSize() {