post_memtable_callback.h 850 B

12345678910111213141516171819202122232425
  1. // Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. #pragma once
  6. #include "rocksdb/status.h"
  7. #include "rocksdb/types.h"
  8. namespace ROCKSDB_NAMESPACE {
  9. // Callback invoked after finishing writing to the memtable but before
  10. // publishing the sequence number to readers.
  11. // Note that with write-prepared/write-unprepared transactions with
  12. // two-write-queues, PreReleaseCallback is called before publishing the
  13. // sequence numbers to readers.
  14. class PostMemTableCallback {
  15. public:
  16. virtual ~PostMemTableCallback() {}
  17. virtual Status operator()(SequenceNumber seq, bool disable_memtable) = 0;
  18. };
  19. } // namespace ROCKSDB_NAMESPACE