Storage::RecordAccessor - added SwitchNew, SwitchOld and Reconstruct API and placeholder implementations

Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D205
This commit is contained in:
florijan 2017-03-30 12:44:41 +02:00
parent d3692d439c
commit 078b50a154
2 changed files with 42 additions and 0 deletions

View File

@ -61,6 +61,23 @@ const uint64_t RecordAccessor<TRecord>::temporary_id() const {
return (uint64_t) vlist_;
}
template <typename TRecord>
RecordAccessor<TRecord> &RecordAccessor<TRecord>::SwitchNew() {
// TODO implement
return *this;
}
template <typename TRecord>
RecordAccessor<TRecord> &RecordAccessor<TRecord>::SwitchOld() {
// TODO implement
return *this;
}
template <typename TRecord>
void RecordAccessor<TRecord>::Reconstruct() {
// TODO implement
}
template <typename TRecord>
TRecord &RecordAccessor<TRecord>::update() {
db_accessor().update(*this);

View File

@ -148,6 +148,31 @@ class RecordAccessor {
*/
const uint64_t temporary_id() const;
/*
* Switches this record accessor to use the latest
* version (visible to the current transaction+command).
*
* @return A reference to this.
*/
RecordAccessor<TRecord> &SwitchNew();
/**
* Switches this record accessor to use the old
* (not updated) version visible to the current transaction+command.
*
* @return A reference to this.
*/
RecordAccessor<TRecord> &SwitchOld();
/**
* Reconstructs the internal state of the record
* accessor so it uses the versions appropriate
* to this transaction+command.
*
* TODO consider what it does after delete+advance_command
*/
void Reconstruct();
protected:
/**
* Returns the update-ready version of the record.