memgraph/src/database/storage_gc_single_node.hpp
Dominik Gleich 7af80ebb8d Replace command_id_t with CommandId and transaction_id_t with TransactionId.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1367
2018-04-20 13:55:14 +02:00

23 lines
699 B
C++

#pragma once
#include "database/storage_gc.hpp"
namespace database {
class StorageGcSingleNode : public StorageGc {
public:
using StorageGc::StorageGc;
~StorageGcSingleNode() {
// We have to stop scheduler before destroying this class because otherwise
// a task might try to utilize methods in this class which might cause pure
// virtual method called since they are not implemented for the base class.
scheduler_.Stop();
}
void CollectCommitLogGarbage(tx::TransactionId oldest_active) final {
auto safe_to_delete = GetClogSafeTransaction(oldest_active);
if (safe_to_delete) tx_engine_.GarbageCollectCommitLog(*safe_to_delete);
}
};
} // namespace database