MCPcopy Create free account
hub / github.com/bytedance/bolt / rehash

Method rehash

bolt/exec/HashTable.cpp:1400–1427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1398
1399template <bool ignoreNullKeys>
1400void HashTable<ignoreNullKeys>::rehash(bool initNormalizedKeys) {
1401 ++numRehashes_;
1402 constexpr int32_t kHashBatchSize = 1024;
1403 if (canApplyParallelJoinBuild()) {
1404 parallelJoinBuild();
1405 return;
1406 }
1407 raw_vector<uint64_t> hashes;
1408 hashes.resize(kHashBatchSize);
1409 char* groups[kHashBatchSize];
1410 // A join build can have multiple payload tables. Loop over 'this'
1411 // and the possible other tables and put all the data in the table
1412 // of 'this'.
1413 for (int32_t i = 0; i <= otherTables_.size(); ++i) {
1414 RowContainerIterator iterator;
1415 int32_t numGroups;
1416 auto rowContainer = (i == 0 ? this : otherTables_[i - 1].get())->rows();
1417 do {
1418 numGroups = rowContainer->listRows(&iterator, kHashBatchSize, groups);
1419 if (!insertBatch(
1420 groups, numGroups, hashes, initNormalizedKeys || i != 0)) {
1421 BOLT_CHECK_NE(hashMode_, HashMode::kHash);
1422 setHashMode(HashMode::kHash, 0);
1423 return;
1424 }
1425 } while (numGroups > 0);
1426 }
1427}
1428
1429template <bool ignoreNullKeys>
1430void HashTable<ignoreNullKeys>::setHashMode(HashMode mode, int32_t numNew) {

Callers

nothing calls this directly

Calls 5

resizeMethod · 0.45
sizeMethod · 0.45
rowsMethod · 0.45
getMethod · 0.45
listRowsMethod · 0.45

Tested by

no test coverage detected