CPC G06F 16/2365 (2019.01) [G06F 3/0604 (2013.01); G06F 3/0638 (2013.01); G06F 3/067 (2013.01); G06F 16/2358 (2019.01)] | 16 Claims |
1. An apparatus for managing a data storage device storing data entries, the apparatus comprising:
the data storage device storing a log-structure, the log-structure comprising a log head and segments each storing data entries, each data entry of the data entries comprising a data field storing data and a time parameter indicative of an age of the data stored in the data field; and
a processor configured to:
receive an instruction to modify the data stored in the data field of a certain data entry, of the data entries, of a certain data segment, of the segments, of the log-structure;
perform a lookup in an index-structure to determine a location of the certain data entry to be modified within the segments of the log-structure;
determine whether a length of the data field of the certain data entry is sufficiently long to accommodate a modification, and if it is determined that the length of the data field is not sufficiently long, determine whether a next sequential data entry includes sufficient free space to accommodate the modification;
upon determining that the length of the data field of the certain data entry is sufficiently long or the next sequential data entry includes sufficient free space, execute an in-place modification by writing over existing data or changing the existing data with modified data without appending the modified data to the log head of the log-structure, the existing data being stored in the data field associated with the determined location of the certain data entry of the certain segment of the log-structure prior to the modification;
upon determining that the length of the data field of the certain data entry is not sufficiently long and the next sequential data entry does not include sufficient free space, append the modified data to the log head of the log-structure; and
update the time parameter of the certain data entry and/or the time parameter of the next sequential data entry according to the modified data.
|