]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/event_helpers.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / db / event_helpers.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
5 #pragma once
6
7 #include <memory>
8 #include <string>
9 #include <vector>
10
11 #include "db/column_family.h"
12 #include "db/version_edit.h"
13 #include "rocksdb/listener.h"
14 #include "rocksdb/table_properties.h"
15 #include "util/event_logger.h"
16
17 namespace rocksdb {
18
19 class EventHelpers {
20 public:
21 static void AppendCurrentTime(JSONWriter* json_writer);
22 #ifndef ROCKSDB_LITE
23 static void NotifyTableFileCreationStarted(
24 const std::vector<std::shared_ptr<EventListener>>& listeners,
25 const std::string& db_name, const std::string& cf_name,
26 const std::string& file_path, int job_id, TableFileCreationReason reason);
27 #endif // !ROCKSDB_LITE
28 static void LogAndNotifyTableFileCreationFinished(
29 EventLogger* event_logger,
30 const std::vector<std::shared_ptr<EventListener>>& listeners,
31 const std::string& db_name, const std::string& cf_name,
32 const std::string& file_path, int job_id, const FileDescriptor& fd,
33 const TableProperties& table_properties, TableFileCreationReason reason,
34 const Status& s);
35 static void LogAndNotifyTableFileDeletion(
36 EventLogger* event_logger, int job_id,
37 uint64_t file_number, const std::string& file_path,
38 const Status& status, const std::string& db_name,
39 const std::vector<std::shared_ptr<EventListener>>& listeners);
40
41 private:
42 static void LogAndNotifyTableFileCreation(
43 EventLogger* event_logger,
44 const std::vector<std::shared_ptr<EventListener>>& listeners,
45 const FileDescriptor& fd, const TableFileCreationInfo& info);
46 };
47
48 } // namespace rocksdb