Open
Conversation
|
@joshkang97 has imported this pull request. If you are a Meta employee, you can view this in D98343170. |
|
| Check | Count |
|---|---|
cert-err58-cpp |
1 |
| Total | 1 |
Details
table/table_properties.cc (1 warning(s))
table/table_properties.cc:287:41: warning: initialization of 'kNumUniformBlocks' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
64f4df6 to
cb10d07
Compare
cb10d07 to
f369465
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add tracking of uniform index blocks as a table property (
num_uniform_blocks). Whenuniform_cv_thresholdis set, the block builder detects uniformly distributed keys via coefficient of variation of key gaps. This information is now surfaced end-to-end: from block building through index builders to SST table properties.Key changes
ScanForUniformity()as a member (is_uniform_) exposed viaIsUniform(), rather than a local variable discarded afterFinish().ShortenedIndexBuilder,HashIndexBuilder,PartitionedIndexBuilder) implementNumUniformIndexBlocks(). For partitioned indexes, the count accumulates across partitionFinish()calls.TablePropertiesNames::kNumUniformBlocks("rocksdb.num.uniform.blocks") with full serialization/deserialization support. Without this, the property was computed in memory but never persisted to SST files.num_uniform_blocksincluded inAdd()andGetAggregatablePropertiesAsMap()for correct cross-SST aggregation.Test Plan
block_test(7504 passed),table_test(6917 passed),table_properties_collector_test(8 passed)../db_bench --benchmarks=fillseq,compact --num=10000 --uniform_cv_threshold=0.2 --index_shortening_mode=0 --compression_type=noneproduces SST with# uniform blocks: 1.--uniform_cv_threshold=-1(disabled) produces# uniform blocks: 0.