Fix the names of function objects added in PR 12681 (#12689)

Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/12689

These should be in `snake_case` (not `camelCase`) per our style guide.

Reviewed By: jowlyzhang

Differential Revision: D57676418

fbshipit-source-id: 82ad6a87d1540f0b29c2f864ca0128287fe95a9e
This commit is contained in:
Levi Tamasi 2024-05-22 11:06:52 -07:00 committed by Facebook GitHub Bot
parent 1827f3f983
commit 014368f62c
1 changed files with 25 additions and 24 deletions

View File

@ -2124,12 +2124,12 @@ class MemTableInserter : public WriteBatch::Handler {
template <typename RebuildTxnOp>
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();