From c31059050e1d4533897587e40a78ba6c0461b2e1 Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Wed, 22 May 2024 09:24:29 -0700 Subject: [PATCH] Fix the names of function objects added in PR 12681 (#12689) Summary: These should be in `snake_case` (not `camelCase`) per our style guide. Differential Revision: D57676418 --- db/write_batch.cc | 49 ++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/db/write_batch.cc b/db/write_batch.cc index e3aac90dd76..640d8cca431 100644 --- a/db/write_batch.cc +++ b/db/write_batch.cc @@ -2124,12 +2124,12 @@ class MemTableInserter : public WriteBatch::Handler { template Status PutCFImpl(uint32_t column_family_id, const Slice& key, const Slice& value, ValueType value_type, - RebuildTxnOp rebuildTxnOp, + RebuildTxnOp rebuild_txn_op, const ProtectionInfoKVOS64* kv_prot_info) { // optimize for non-recovery mode if (UNLIKELY(write_after_commit_ && rebuilding_trx_ != nullptr)) { // TODO(ajkr): propagate `ProtectionInfoKVOS64`. - return rebuildTxnOp(rebuilding_trx_, column_family_id, key, value); + return rebuild_txn_op(rebuilding_trx_, column_family_id, key, value); // else insert the values to the memtable right away } @@ -2141,7 +2141,7 @@ class MemTableInserter : public WriteBatch::Handler { // need to keep track of the keys for upcoming rollback/commit. // TODO(ajkr): propagate `ProtectionInfoKVOS64`. ret_status = - rebuildTxnOp(rebuilding_trx_, column_family_id, key, value); + rebuild_txn_op(rebuilding_trx_, column_family_id, key, value); if (ret_status.ok()) { MaybeAdvanceSeq(IsDuplicateKeySeq(column_family_id, key)); } @@ -2265,7 +2265,8 @@ class MemTableInserter : public WriteBatch::Handler { if (UNLIKELY(ret_status.ok() && rebuilding_trx_ != nullptr)) { assert(!write_after_commit_); // TODO(ajkr): propagate `ProtectionInfoKVOS64`. - ret_status = rebuildTxnOp(rebuilding_trx_, column_family_id, key, value); + ret_status = + rebuild_txn_op(rebuilding_trx_, column_family_id, key, value); } return ret_status; } @@ -2275,8 +2276,8 @@ class MemTableInserter : public WriteBatch::Handler { const auto* kv_prot_info = NextProtectionInfo(); Status ret_status; - auto rebuildTxnOp = [](WriteBatch* rebuilding_trx, uint32_t cf_id, - const Slice& k, const Slice& v) -> Status { + auto rebuild_txn_op = [](WriteBatch* rebuilding_trx, uint32_t cf_id, + const Slice& k, const Slice& v) -> Status { return WriteBatchInternal::Put(rebuilding_trx, cf_id, k, v); }; @@ -2285,10 +2286,10 @@ class MemTableInserter : public WriteBatch::Handler { auto mem_kv_prot_info = kv_prot_info->StripC(column_family_id).ProtectS(sequence_); ret_status = PutCFImpl(column_family_id, key, value, kTypeValue, - rebuildTxnOp, &mem_kv_prot_info); + rebuild_txn_op, &mem_kv_prot_info); } else { ret_status = PutCFImpl(column_family_id, key, value, kTypeValue, - rebuildTxnOp, nullptr /* kv_prot_info */); + rebuild_txn_op, nullptr /* kv_prot_info */); } // TODO: this assumes that if TryAgain status is returned to the caller, // the operation is actually tried again. The proper way to do this is to @@ -2308,21 +2309,21 @@ class MemTableInserter : public WriteBatch::Handler { Slice packed_value = PackValueAndWriteTime(value, unix_write_time, &value_buf); - auto rebuildTxnOp = [](WriteBatch* /* rebuilding_trx */, - uint32_t /* cf_id */, const Slice& /* k */, - const Slice& /* v */) -> Status { + auto rebuild_txn_op = [](WriteBatch* /* rebuilding_trx */, + uint32_t /* cf_id */, const Slice& /* k */, + const Slice& /* v */) -> Status { return Status::NotSupported(); }; if (kv_prot_info != nullptr) { auto mem_kv_prot_info = kv_prot_info->StripC(column_family_id).ProtectS(sequence_); - ret_status = - PutCFImpl(column_family_id, key, packed_value, - kTypeValuePreferredSeqno, rebuildTxnOp, &mem_kv_prot_info); + ret_status = PutCFImpl(column_family_id, key, packed_value, + kTypeValuePreferredSeqno, rebuild_txn_op, + &mem_kv_prot_info); } else { ret_status = PutCFImpl(column_family_id, key, packed_value, - kTypeValuePreferredSeqno, rebuildTxnOp, + kTypeValuePreferredSeqno, rebuild_txn_op, nullptr /* kv_prot_info */); } @@ -2342,8 +2343,8 @@ class MemTableInserter : public WriteBatch::Handler { Status s; - auto rebuildTxnOp = [](WriteBatch* rebuilding_trx, uint32_t cf_id, - const Slice& k, Slice entity) -> Status { + auto rebuild_txn_op = [](WriteBatch* rebuilding_trx, uint32_t cf_id, + const Slice& k, Slice entity) -> Status { WideColumns columns; const Status st = WideColumnSerialization::Deserialize(entity, columns); if (!st.ok()) { @@ -2358,10 +2359,10 @@ class MemTableInserter : public WriteBatch::Handler { auto mem_kv_prot_info = kv_prot_info->StripC(column_family_id).ProtectS(sequence_); s = PutCFImpl(column_family_id, key, value, kTypeWideColumnEntity, - rebuildTxnOp, &mem_kv_prot_info); + rebuild_txn_op, &mem_kv_prot_info); } else { s = PutCFImpl(column_family_id, key, value, kTypeWideColumnEntity, - rebuildTxnOp, + rebuild_txn_op, /* kv_prot_info */ nullptr); } @@ -2806,9 +2807,9 @@ class MemTableInserter : public WriteBatch::Handler { const auto* kv_prot_info = NextProtectionInfo(); Status ret_status; - auto rebuildTxnOp = [](WriteBatch* /* rebuilding_trx */, - uint32_t /* cf_id */, const Slice& /* k */, - const Slice& /* v */) -> Status { + auto rebuild_txn_op = [](WriteBatch* /* rebuilding_trx */, + uint32_t /* cf_id */, const Slice& /* k */, + const Slice& /* v */) -> Status { return Status::NotSupported(); }; @@ -2818,10 +2819,10 @@ class MemTableInserter : public WriteBatch::Handler { kv_prot_info->StripC(column_family_id).ProtectS(sequence_); // Same as PutCF except for value type. ret_status = PutCFImpl(column_family_id, key, value, kTypeBlobIndex, - rebuildTxnOp, &mem_kv_prot_info); + rebuild_txn_op, &mem_kv_prot_info); } else { ret_status = PutCFImpl(column_family_id, key, value, kTypeBlobIndex, - rebuildTxnOp, nullptr /* kv_prot_info */); + rebuild_txn_op, nullptr /* kv_prot_info */); } if (UNLIKELY(ret_status.IsTryAgain())) { DecrementProtectionInfoIdxForTryAgain();