CPC G06F 16/2255 (2019.01) [G06F 3/0608 (2013.01); G06F 3/0659 (2013.01); G06F 3/0679 (2013.01)] | 20 Claims |
1. A device for managing key-value (KV) data in non-volatile memory, comprising:
a controller; and
volatile memory storing a hash table,
wherein the controller is configured to:
generate a first key from a key-value (KV) pair;
read, based on the first key, a first entry of the hash table, wherein the first entry is located in a non-overflow portion of the hash table;
read, based on the first entry of the hash table, a first page including a set of KV hash entries, each KV hash entry of the set of KV hash entries containing a length of KV data and an address of the KV data in the non-volatile memory;
determine whether a number of KV hash entries of the first page reaches a predetermined number;
in response to determining that the number of KV hash entries of the first page reaches the predetermined number, store KV data corresponding to the KV pair in a first location of the non-volatile memory, write a first KV hash entry containing the first location of the non-volatile memory as the address in the first KV hash entry, and write a location of the first KV hash entry in a second entry of the hash table, wherein the second entry is located in an overflow portion of the hash table that has a size that is less than the non-overflow portion of the hash table, and wherein the location of the first KV hash entry written in the second entry of the hash table corresponds to a second page of KV hash entries that is separate from the first page of KV hash entries; and
in response to determining that the number of KV hash entries of the first page does not reach the predetermined number, store KV data corresponding to the KV pair in a second location of the non-volatile memory, and add to the set of KV hash entries in the first page a new KV hash entry containing the second location of the non-volatile memory as the address in the new KV hash entry.
|