]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/utilities/blob_db/blob_db_listener.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).
12 #include "rocksdb/listener.h"
13 #include "util/mutexlock.h"
14 #include "utilities/blob_db/blob_db_impl.h"
19 class BlobDBListener
: public EventListener
{
21 explicit BlobDBListener(BlobDBImpl
* blob_db_impl
)
22 : blob_db_impl_(blob_db_impl
) {}
24 void OnFlushBegin(DB
* /*db*/, const FlushJobInfo
& /*info*/) override
{
25 assert(blob_db_impl_
!= nullptr);
26 blob_db_impl_
->SyncBlobFiles();
29 void OnFlushCompleted(DB
* /*db*/, const FlushJobInfo
& /*info*/) override
{
30 assert(blob_db_impl_
!= nullptr);
31 blob_db_impl_
->UpdateLiveSSTSize();
34 void OnCompactionCompleted(DB
* /*db*/,
35 const CompactionJobInfo
& /*info*/) override
{
36 assert(blob_db_impl_
!= nullptr);
37 blob_db_impl_
->UpdateLiveSSTSize();
41 BlobDBImpl
* blob_db_impl_
;
44 } // namespace blob_db
45 } // namespace rocksdb
46 #endif // !ROCKSDB_LITE