Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions linera-execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repository.workspace = true
version.workspace = true

[features]
smallkeyvaluestoreview = []
test = ["tokio/macros", "linera-base/test", "linera-views/test", "proptest"]
revm = [
"dep:revm",
Expand Down
14 changes: 12 additions & 2 deletions linera-execution/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use linera_base::{
};
use linera_views::{
context::Context,
key_value_store_view::KeyValueStoreView,
map_view::MapView,
reentrant_collection_view::HashedReentrantCollectionView,
views::{ClonableView, ReplaceContext, View},
Expand Down Expand Up @@ -44,7 +43,18 @@ pub struct ExecutionStateView<C> {
/// System application.
pub system: SystemExecutionStateView<C>,
/// User applications.
pub users: HashedReentrantCollectionView<C, ApplicationId, KeyValueStoreView<C>>,
#[cfg(not(feature = "smallkeyvaluestoreview"))]
pub users: HashedReentrantCollectionView<
C,
ApplicationId,
linera_views::small_key_value_store_view::SmallKeyValueStoreView<C>,
>,
#[cfg(feature = "smallkeyvaluestoreview")]
pub users: HashedReentrantCollectionView<
C,
ApplicationId,
linera_views::key_value_store_view::KeyValueStoreView<C>,
>,
/// The number of events in the streams that this chain is writing to.
pub stream_event_counts: MapView<C, StreamId, u32>,
}
Expand Down
2 changes: 1 addition & 1 deletion linera-views/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub use backends::scylla_db;
pub use backends::{journaling, lru_caching, memory, value_splitting};
pub use views::{
bucket_queue_view, collection_view, hashable_wrapper, key_value_store_view, log_view, map_view,
queue_view, reentrant_collection_view, register_view, set_view,
queue_view, reentrant_collection_view, register_view, set_view, small_key_value_store_view,
};
/// Re-exports used by the derive macros of this library.
#[doc(hidden)]
Expand Down
6 changes: 3 additions & 3 deletions linera-views/src/views/key_value_store_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,12 @@ impl<C: Context> KeyValueStoreView<C> {
/// # use linera_views::views::View;
/// # let context = MemoryContext::new_for_testing(());
/// let mut view = KeyValueStoreView::load(context).await.unwrap();
/// let total_size = view.total_size();
/// let total_size = view.total_size().unwrap();
/// assert_eq!(total_size, SizeData::default());
/// # })
/// ```
pub fn total_size(&self) -> SizeData {
self.total_size
pub fn total_size(&self) -> Result<SizeData, ViewError> {
Ok(self.total_size)
}

/// Applies the function f over all indices. If the function f returns
Expand Down
3 changes: 3 additions & 0 deletions linera-views/src/views/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ pub mod reentrant_collection_view;
/// The implementation of a key-value store view.
pub mod key_value_store_view;

/// The implementation of a key-value store view using a single BTreeMap.
pub mod small_key_value_store_view;

/// Wrapping a view to compute a hash.
pub mod hashable_wrapper;

Expand Down
Loading
Loading