| 346 | } |
| 347 | |
| 348 | bool BlockSplitBloomFilter::FindHash(uint64_t hash) const { |
| 349 | const uint32_t bucket_index = |
| 350 | static_cast<uint32_t>(((hash >> 32) * (num_bytes_ / kBytesPerFilterBlock)) >> 32); |
| 351 | const uint32_t key = static_cast<uint32_t>(hash); |
| 352 | const uint32_t* bitset32 = reinterpret_cast<const uint32_t*>(data_->data()); |
| 353 | |
| 354 | for (int i = 0; i < kBitsSetPerBlock; ++i) { |
| 355 | // Calculate mask for key in the given bitset. |
| 356 | const uint32_t mask = UINT32_C(0x1) << ((key * SALT[i]) >> 27); |
| 357 | if (ARROW_PREDICT_FALSE(0 == |
| 358 | (bitset32[kBitsSetPerBlock * bucket_index + i] & mask))) { |
| 359 | return false; |
| 360 | } |
| 361 | } |
| 362 | return true; |
| 363 | } |
| 364 | |
| 365 | void BlockSplitBloomFilter::InsertHashImpl(uint64_t hash) { |
| 366 | const uint32_t bucket_index = |