]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
11fdf7f2 TL |
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). | |
7c673cae FG |
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" | |
f67539c2 | 13 | #include "logging/event_logger.h" |
7c673cae FG |
14 | #include "rocksdb/listener.h" |
15 | #include "rocksdb/table_properties.h" | |
7c673cae | 16 | |
f67539c2 | 17 | namespace ROCKSDB_NAMESPACE { |
7c673cae FG |
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 | |
11fdf7f2 TL |
28 | static void NotifyOnBackgroundError( |
29 | const std::vector<std::shared_ptr<EventListener>>& listeners, | |
30 | BackgroundErrorReason reason, Status* bg_error, | |
31 | InstrumentedMutex* db_mutex, bool* auto_recovery); | |
7c673cae FG |
32 | static void LogAndNotifyTableFileCreationFinished( |
33 | EventLogger* event_logger, | |
34 | const std::vector<std::shared_ptr<EventListener>>& listeners, | |
35 | const std::string& db_name, const std::string& cf_name, | |
36 | const std::string& file_path, int job_id, const FileDescriptor& fd, | |
f67539c2 | 37 | uint64_t oldest_blob_file_number, const TableProperties& table_properties, |
20effc67 TL |
38 | TableFileCreationReason reason, const Status& s, |
39 | const std::string& file_checksum, | |
40 | const std::string& file_checksum_func_name); | |
7c673cae FG |
41 | static void LogAndNotifyTableFileDeletion( |
42 | EventLogger* event_logger, int job_id, | |
43 | uint64_t file_number, const std::string& file_path, | |
44 | const Status& status, const std::string& db_name, | |
45 | const std::vector<std::shared_ptr<EventListener>>& listeners); | |
11fdf7f2 TL |
46 | static void NotifyOnErrorRecoveryCompleted( |
47 | const std::vector<std::shared_ptr<EventListener>>& listeners, | |
48 | Status bg_error, InstrumentedMutex* db_mutex); | |
7c673cae FG |
49 | |
50 | private: | |
51 | static void LogAndNotifyTableFileCreation( | |
52 | EventLogger* event_logger, | |
53 | const std::vector<std::shared_ptr<EventListener>>& listeners, | |
54 | const FileDescriptor& fd, const TableFileCreationInfo& info); | |
55 | }; | |
56 | ||
f67539c2 | 57 | } // namespace ROCKSDB_NAMESPACE |