Our hash table implementation performs rehashing incrementally while * we write/read from the hash table. Still if the server is idle, the hash * table will use two tables for a long time. So we try to use 1 millisecond * of CPU time at every call of this function to perform some rehashing. * * The function returns the number of rehashes if some rehashing was performed, otherwise 0 * is retu
| 1690 | * The function returns the number of rehashes if some rehashing was performed, otherwise 0 |
| 1691 | * is returned. */ |
| 1692 | int redisDbPersistentData::incrementallyRehash() { |
| 1693 | /* Keys dictionary */ |
| 1694 | int result = 0; |
| 1695 | if (dictIsRehashing(m_pdict)) |
| 1696 | result += dictRehashMilliseconds(m_pdict,1); |
| 1697 | if (dictIsRehashing(m_pdictTombstone)) |
| 1698 | dictRehashMilliseconds(m_pdictTombstone,1); // don't count this |
| 1699 | return result; /* already used our millisecond for this loop... */ |
| 1700 | } |
| 1701 | |
| 1702 | /* This function is called once a background process of some kind terminates, |
| 1703 | * as we want to avoid resizing the hash tables when there is a child in order |
no test coverage detected