feat(lander): integrate persistent insert & get lsm store

This commit is contained in:
Jef Roosens 2023-11-08 11:19:33 +01:00
parent 226873219b
commit 535b92a6b6
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
8 changed files with 63 additions and 19 deletions

View file

@ -17,7 +17,8 @@
*/
typedef enum lsm_attr_type : uint64_t {
lsm_attr_type_entry_type = 1 << 0,
lsm_attr_type_content_type = 1 << 1
lsm_attr_type_content_type = 1 << 1,
lsm_attr_type_url = 1 << 2,
} lsm_attr_type;
/**

View file

@ -100,6 +100,9 @@ lsm_error lsm_entry_sync(lsm_store *store, lsm_entry_handle *handle) {
res = lsm_entry_write_uint64_t(store->idx_file, new_block_count);
if (res == lsm_error_ok) {
// Only if we successfully updated the on-disk counter do we make the code
// aware that the file's size has increased. This way, if a write to the
// counter fails, the code will simply reuse the already written content.
store->idx_file_size += entry_size;
store->idx_file_block_count = new_block_count;
}