Implement SimpleConfigTransaction::getCommittedVersion
This commit is contained in:
parent
a3891a9246
commit
91f6f82cd8
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue