feat(lsm): store iterators
This commit is contained in:
parent
f4d711365d
commit
222b277eef
4 changed files with 100 additions and 0 deletions
|
|
@ -228,4 +228,40 @@ lsm_error lsm_entry_data_read(uint64_t *out, char *buf,
|
|||
*/
|
||||
uint64_t lsm_entry_data_len(lsm_entry_handle *handle);
|
||||
|
||||
/**
|
||||
* Represents an in-flight iterator over an LSM store.
|
||||
*/
|
||||
typedef struct lsm_store_iterator lsm_store_iterator;
|
||||
|
||||
/**
|
||||
* Initialize an iterator to iterate over all entries with keys starting
|
||||
* with the given prefix.
|
||||
*
|
||||
* @param out pointer to store iterator pointer in
|
||||
* @param trie trie to iterate
|
||||
* @param prefix prefix of the keys; a zero-length string means iterating over
|
||||
* the entire trie; NULL is interpreted as a zero-length string
|
||||
*/
|
||||
lsm_error lsm_store_iter(lsm_store_iterator **out, lsm_store *store,
|
||||
const lsm_str *prefix);
|
||||
|
||||
/**
|
||||
* Advance the iterator, returning a read handle to the next entry. The caller
|
||||
* is responsible for closing this handle.
|
||||
*/
|
||||
lsm_error lsm_store_iter_next_read(lsm_entry_handle **out,
|
||||
lsm_store_iterator *iter);
|
||||
|
||||
/**
|
||||
* Advance the iterator, returning a write handle to the next entry. The caller
|
||||
* is responsible for closing this handle.
|
||||
*/
|
||||
/* lsm_error lsm_store_iter_next_write(lsm_entry_handle **out,
|
||||
* lsm_store_iterator *iter); */
|
||||
|
||||
/**
|
||||
* Free the given iterator.
|
||||
*/
|
||||
void lsm_store_iter_free(lsm_store_iterator *iter);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue