MCPcopy Create free account
hub / github.com/apache/arrow / ComputeBitsShiftForBlockAndStamp

Function ComputeBitsShiftForBlockAndStamp

cpp/src/arrow/compute/key_map_internal.h:264–269  ·  view source on GitHub ↗

When log_blocks is greater than 25, there will be overlapping bits between block id and stamp within a 32-bit hash value. So we must check if this is the case when right shifting a hash value to retrieve block id and stamp. The following two functions derive the number of bits to right shift from the given log_blocks.

Source from the content-addressed store, hash-verified

262 // right shifting a hash value to retrieve block id and stamp. The following two
263 // functions derive the number of bits to right shift from the given log_blocks.
264 static int ComputeBitsShiftForBlockAndStamp(int log_blocks) {
265 if (ARROW_PREDICT_FALSE(log_blocks + bits_stamp_ > bits_hash_)) {
266 return 0;
267 }
268 return bits_hash_ - log_blocks - bits_stamp_;
269 }
270 static int ComputeBitsShiftForBlock(int log_blocks) {
271 if (ARROW_PREDICT_FALSE(log_blocks + bits_stamp_ > bits_hash_)) {
272 return bits_hash_ - log_blocks;

Callers 4

grow_doubleMethod · 0.85
initMethod · 0.85
cleanupMethod · 0.85
key_map_internal.hFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected