]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/pre_release_callback.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rocksdb / db / pre_release_callback.h
1 // Copyright (c) 2011-present, Facebook, Inc. 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
6 #pragma once
7
8 #include "rocksdb/status.h"
9
10 namespace rocksdb {
11
12 class DB;
13
14 class PreReleaseCallback {
15 public:
16 virtual ~PreReleaseCallback() {}
17
18 // Will be called while on the write thread after the write and before the
19 // release of the sequence number. This is useful if any operation needs to be
20 // done before the write gets visible to the readers, or if we want to reduce
21 // the overhead of locking by updating something sequentially while we are on
22 // the write thread. If the callback fails, this function returns a non-OK
23 // status, the sequence number will not be released, and same status will be
24 // propagated to all the writers in the write group.
25 // seq is the sequence number that is used for this write and will be
26 // released.
27 // is_mem_disabled is currently used for debugging purposes to assert that
28 // the callback is done from the right write queue.
29 virtual Status Callback(SequenceNumber seq, bool is_mem_disabled) = 0;
30 };
31
32 } // namespace rocksdb