Allow dynamically increasing capacity of storage #15

Open
opened 2026-03-21 23:13:54 +01:00 by AljoschaMeyer · 0 comments

The StorageBackend trait has a commented-out reserve_capacity method for adding more dynamically adding more capacity. The idea is that an application might want to first request a short prefix of some string, and may or may not request a larger prefix later. Optimistically reserving capacity for the full string could be too expensive, the reserve_capacity method would provide the solution. And implementing should be fairly simple for various backends (it definitely is simple for both the Vec-based in-memory backend and for the file-system backend to append more storage space at the end).

Analogously, SingleSliceStore has a commented-out increase_slice_length method stub.

This issue consists of uncommenting these, implementing the StorageBackend::reserve_capacity method on our storage backends, and to implement SingleSliceStore::increase_slice_lengthby callingreserve_capacity` on the storage backend (and adjusting the stored metadata).

The [`StorageBackend`](https://codeberg.org/worm-blossom/bab_rs/src/branch/main/src/generic/storage/storage_backend.rs) trait has a commented-out `reserve_capacity` method for adding more dynamically adding more capacity. The idea is that an application might want to first request a short prefix of some string, and may or may not request a larger prefix later. Optimistically reserving capacity for the full string could be too expensive, the `reserve_capacity` method would provide the solution. And implementing should be fairly simple for various backends (it definitely *is* simple for both the Vec-based in-memory backend and for the file-system backend to append more storage space at the end). Analogously, [`SingleSliceStore`](https://codeberg.org/worm-blossom/bab_rs/src/branch/main/src/generic/storage/single_slice_store.rs) has a commented-out `increase_slice_length` method stub. This issue consists of uncommenting these, implementing the `StorageBackend::reserve_capacity` method on our storage backends, and to implement `SingleSliceStore::`increase_slice_length` by calling `reserve_capacity` on the storage backend (and adjusting the stored metadata).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
worm-blossom/bab_rs#15
No description provided.