]>
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 | |
6 | #include <mutex> | |
7 | ||
8 | #include "db/column_family.h" | |
9 | #include "monitoring/thread_status_updater.h" | |
20effc67 | 10 | #include "util/cast_util.h" |
7c673cae | 11 | |
f67539c2 | 12 | namespace ROCKSDB_NAMESPACE { |
7c673cae FG |
13 | |
14 | #ifndef NDEBUG | |
15 | #ifdef ROCKSDB_USING_THREAD_STATUS | |
16 | void ThreadStatusUpdater::TEST_VerifyColumnFamilyInfoMap( | |
11fdf7f2 | 17 | const std::vector<ColumnFamilyHandle*>& handles, bool check_exist) { |
7c673cae FG |
18 | std::unique_lock<std::mutex> lock(thread_list_mutex_); |
19 | if (check_exist) { | |
20 | assert(cf_info_map_.size() == handles.size()); | |
21 | } | |
22 | for (auto* handle : handles) { | |
20effc67 | 23 | auto* cfd = static_cast_with_check<ColumnFamilyHandleImpl>(handle)->cfd(); |
11fdf7f2 | 24 | auto iter __attribute__((__unused__)) = cf_info_map_.find(cfd); |
7c673cae FG |
25 | if (check_exist) { |
26 | assert(iter != cf_info_map_.end()); | |
11fdf7f2 | 27 | assert(iter->second.cf_name == cfd->GetName()); |
7c673cae FG |
28 | } else { |
29 | assert(iter == cf_info_map_.end()); | |
30 | } | |
31 | } | |
32 | } | |
33 | ||
34 | #else | |
35 | ||
36 | void ThreadStatusUpdater::TEST_VerifyColumnFamilyInfoMap( | |
11fdf7f2 | 37 | const std::vector<ColumnFamilyHandle*>& /*handles*/, bool /*check_exist*/) { |
7c673cae FG |
38 | } |
39 | ||
40 | #endif // ROCKSDB_USING_THREAD_STATUS | |
41 | #endif // !NDEBUG | |
42 | ||
f67539c2 | 43 | } // namespace ROCKSDB_NAMESPACE |