From 538ce38b3f9a1c41c9dcd4a957f959b66fa2b5cf Mon Sep 17 00:00:00 2001 From: Mathieu Dutour Sikiric Date: Thu, 4 Apr 2024 22:54:32 +0200 Subject: [PATCH] Update to the `README.md` and corresponding changes. (#1868) * Update to the README.md and corresponding changes. Co-authored-by: Andreas Fackler --- linera-storage-service/README.md | 3 ++- linera-storage-service/src/lib.rs | 3 ++- linera-views/README.md | 19 +++++++++++-------- linera-views/src/lib.rs | 19 +++++++++++-------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/linera-storage-service/README.md b/linera-storage-service/README.md index 54ee1dba753..356b869f2fa 100644 --- a/linera-storage-service/README.md +++ b/linera-storage-service/README.md @@ -1,6 +1,7 @@ -This module provides a shared key-value store server based on the RocksDB store and the in-memory store of `linera-views`. It also includes the corresponding client and end-to-end tests. +This module provides a shared key-value store server based on the RocksDB store and the in-memory store of `linera-views`. +The corresponding client implements the `KeyValueStore` and `AdminKeyValueStore` traits. diff --git a/linera-storage-service/src/lib.rs b/linera-storage-service/src/lib.rs index 773317f66ef..bb3b615ece9 100644 --- a/linera-storage-service/src/lib.rs +++ b/linera-storage-service/src/lib.rs @@ -1,7 +1,8 @@ // Copyright (c) Zefchain Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//! This module provides a shared key-value store server based on the RocksDB store and the in-memory store of `linera-views`. It also includes the corresponding client and end-to-end tests. +//! This module provides a shared key-value store server based on the RocksDB store and the in-memory store of `linera-views`. +//! The corresponding client implements the `KeyValueStore` and `AdminKeyValueStore` traits. #[allow(clippy::derive_partial_eq_without_eq)] // https://github.com/hyperium/tonic/issues/1056 diff --git a/linera-views/README.md b/linera-views/README.md index f0ae4609053..af984bf7130 100644 --- a/linera-views/README.md +++ b/linera-views/README.md @@ -1,9 +1,8 @@ This module is used in the Linera protocol to map complex data structures onto a -key-value store. The central notion is a [`views::View`](https://docs.rs/linera-views/latest/linera_views/views/trait.View.html) which can -be loaded from storage, modified in memory, then committed (i.e. the changes are -atomically persisted in storage). +key-value store. The central notion is a [`views::View`](https://docs.rs/linera-views/latest/linera_views/views/trait.View.html) +which can be loaded from storage, modified in memory, and then committed (i.e. the changes are atomically persisted in storage). The package provides essentially two functionalities: * An abstraction to access databases. @@ -19,11 +18,15 @@ We provide support for the following databases: * `MemoryStore` is using the memory * `RocksDbStore` is a disk-based key-value store * `DynamoDbStore` is the AWS-based DynamoDB service. -* `ScyllaDbStore` is a cloud based Cassandra compatible database. +* `ScyllaDbStore` is a cloud-based Cassandra-compatible database. +* `ServiceStoreClient` is a gRPC-based storage that uses either memory or RocksDB. It is available in `linera-storage-service`. -The corresponding type in the code is the `KeyValueStore`. -A context is the combination of a client and a path (named `base_key` which is -of type `Vec`). +The corresponding trait in the code is the [`common::KeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.KeyValueStore.html). +The trait decomposes into a [`common::ReadableKeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.ReadableKeyValueStore.html) +and a [`common::WritableKeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.WritableKeyValueStore.html). +In addition, there is a [`common::AdminKeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.AdminKeyValueStore.html) +which gives some functionalities for working with stores. +A context is the combination of a client and a base key (of type `Vec`). ## Views. @@ -32,11 +35,11 @@ When the container is modified the modification lies first in the view before being committed to the database. In technical terms, a view implements the trait `View`. The specific functionalities of the trait `View` are the following: +* `context` for obtaining a reference to the storage context of the view. * `load` for loading the view from a specific context. * `rollback` for canceling all modifications that were not committed thus far. * `clear` for clearing the view, in other words for reverting it to its default state. * `flush` for persisting the changes to storage. -* `delete` for deleting the changes from the database. The following views implement the `View` trait: * `RegisterView` implements the storing of a single data. diff --git a/linera-views/src/lib.rs b/linera-views/src/lib.rs index c58f6499118..65b33108000 100644 --- a/linera-views/src/lib.rs +++ b/linera-views/src/lib.rs @@ -3,9 +3,8 @@ /*! This module is used in the Linera protocol to map complex data structures onto a -key-value store. The central notion is a [`views::View`](crate::views::View) which can -be loaded from storage, modified in memory, then committed (i.e. the changes are -atomically persisted in storage). +key-value store. The central notion is a [`views::View`](https://docs.rs/linera-views/latest/linera_views/views/trait.View.html) +which can be loaded from storage, modified in memory, and then committed (i.e. the changes are atomically persisted in storage). The package provides essentially two functionalities: * An abstraction to access databases. @@ -21,11 +20,15 @@ We provide support for the following databases: * `MemoryStore` is using the memory * `RocksDbStore` is a disk-based key-value store * `DynamoDbStore` is the AWS-based DynamoDB service. -* `ScyllaDbStore` is a cloud based Cassandra compatible database. +* `ScyllaDbStore` is a cloud-based Cassandra-compatible database. +* `ServiceStoreClient` is a gRPC-based storage that uses either memory or RocksDB. It is available in `linera-storage-service`. -The corresponding type in the code is the `KeyValueStore`. -A context is the combination of a client and a path (named `base_key` which is -of type `Vec`). +The corresponding trait in the code is the [`common::KeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.KeyValueStore.html). +The trait decomposes into a [`common::ReadableKeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.ReadableKeyValueStore.html) +and a [`common::WritableKeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.WritableKeyValueStore.html). +In addition, there is a [`common::AdminKeyValueStore`](https://docs.rs/linera-views/latest/linera_views/common/trait.AdminKeyValueStore.html) +which gives some functionalities for working with stores. +A context is the combination of a client and a base key (of type `Vec`). ## Views. @@ -34,11 +37,11 @@ When the container is modified the modification lies first in the view before being committed to the database. In technical terms, a view implements the trait `View`. The specific functionalities of the trait `View` are the following: +* `context` for obtaining a reference to the storage context of the view. * `load` for loading the view from a specific context. * `rollback` for canceling all modifications that were not committed thus far. * `clear` for clearing the view, in other words for reverting it to its default state. * `flush` for persisting the changes to storage. -* `delete` for deleting the changes from the database. The following views implement the `View` trait: * `RegisterView` implements the storing of a single data.