Lines Matching full:hash

2  * util/storage/lruhash.h - hashtable, hash function, LRU keeping.
41 * The hash table keeps a maximum memory size. Old entries are removed
47 * o the idea is to move every thread through the hash lock quickly,
49 * o User performs hash function.
53 * o lookup hash bin.
54 * o lock hash bin.
55 * o find entry (if failed, unlock hash, unl bin, exit).
59 * o unlock hash bin.
72 * o lookup hash bin.
73 * o lock hash bin.
74 * o find entry (if failed, unlock hash, unl bin, exit).
78 * o unlock hash bin.
113 /** default start size for hash arrays */
115 /** default max memory for hash arrays */
118 /** the type of a hash value */
145 * Hash table that keeps LRU list of entries.
175 /** the number of entries in the hash table. */
179 /** the amount of space the hash table is maximally allowed to use. */
199 * An entry into the hash table.
209 * Even with a writelock, you cannot change hash and key.
210 * You need to delete it to change hash or key.
219 /** hash value of the key. It may not change, until entry deleted. */
220 hashvalue_type hash;
228 * Create new hash table.
238 * @return: new hash table or NULL on malloc failure.
246 * Delete hash table. Entries are all deleted.
252 * Clear hash table. Entries are all deleted, while locking them before
263 * If necessary the hash array is grown up.
265 * @param table: hash table.
266 * @param hash: hash value. User calculates the hash.
274 void lruhash_insert(struct lruhash* table, hashvalue_type hash,
281 * @param table: hash table.
282 * @param hash: hash of key.
284 * the hash value must be set, and must work with compare function.
291 hashvalue_type hash, void* key, int wr);
295 * Caller must hold hash table lock. The entry must be inserted already.
296 * @param table: hash table.
309 * @param table: hash table.
311 * @param diff_size: difference in size to the hash table storage.
320 * @param table: hash table.
332 * Caller must hold hash table lock. The entry must be inserted already.
333 * @param table: hash table.
346 * If necessary the hash array is grown up.
348 * @param table: hash table.
349 * @param hash: hash value. User calculates the hash.
356 struct lruhash_entry* lruhash_insert_or_retrieve(struct lruhash* table, hashvalue_type hash,
365 * @param table: hash table.
366 * @param hash: hash of key.
369 void lruhash_remove(struct lruhash* table, hashvalue_type hash, void* key);
371 /** init the hash bins for the table */
374 /** delete the hash bin and entries inside it */
378 * Find entry in hash bin. You must have locked the bin.
379 * @param table: hash table with function pointers.
380 * @param bin: hash bin to look into.
381 * @param hash: hash value to look for.
387 struct lruhash_bin* bin, hashvalue_type hash, void* key, size_t* collisions);
392 * @param bin: hash bin to look into.
399 * Split hash bin into two new ones. Based on increased size_mask.
400 * Caller must hold hash table lock.
404 * @param table: hash table with function pointers.
415 * @param table: hash table.
417 * Entries have been removed from the hash table and writelock is held.
423 * Caller must hold the hash table lock. Must not hold any bin locks.
425 * @param table: hash table.
431 * Caller must hold hash table lock.
432 * @param table: hash table with lru head and tail.
439 * Caller must hold hash table lock.
440 * @param table: hash table with lru head and tail.
446 * Output debug info to the log as to state of the hash table.
447 * @param table: hash table.
448 * @param id: string printed with table to identify the hash table.
455 * @param table: hash table. Will be locked before use. And unlocked after.
462 * @param h: hash table. Locked before use.