/src/rocksdb/util/write_batch_util.cc
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) Meta Platforms, Inc. and affiliates. |
2 | | // |
3 | | // This source code is licensed under both the GPLv2 (found in the |
4 | | // COPYING file in the root directory) and Apache 2.0 License |
5 | | // (found in the LICENSE.Apache file in the root directory). |
6 | | |
7 | | #include "util/write_batch_util.h" |
8 | | |
9 | | namespace ROCKSDB_NAMESPACE { |
10 | | |
11 | | Status CollectColumnFamilyIdsFromWriteBatch( |
12 | 0 | const WriteBatch& batch, std::vector<uint32_t>* column_family_ids) { |
13 | 0 | assert(column_family_ids != nullptr); |
14 | 0 | column_family_ids->clear(); |
15 | 0 | ColumnFamilyCollector handler; |
16 | 0 | Status s = batch.Iterate(&handler); |
17 | 0 | if (s.ok()) { |
18 | 0 | for (const auto& cf : handler.column_families()) { |
19 | 0 | column_family_ids->push_back(cf); |
20 | 0 | } |
21 | 0 | } |
22 | 0 | return s; |
23 | 0 | } |
24 | | |
25 | | } // namespace ROCKSDB_NAMESPACE |