Skip to main content

coven_replication/sync/store/commit_publication/
mod.rs

1use super::*;
2use crate::sync::store::authorization::history::AuthorizedStoreHistory;
3use crate::sync::store::pull;
4use std::sync::Arc;
5pub(crate) mod operation;
6mod signing;
7
8pub(crate) use signing::LocalStoreWriter;
9pub(crate) use signing::LocalWriterKeyrings;
10use signing::StoreOperationSigningContext;
11
12pub(crate) use operation::prepare_partition_blob_locator;
13pub use operation::StoreWriterAuthorizationError;
14
15#[derive(Clone, Copy)]
16pub(crate) struct SnapshotHistoryConstruction;
17
18pub struct AuthorizedWriterOperation<'storage> {
19    database: StoreDatabase,
20    history: AuthorizedStoreHistory<'storage>,
21    storage: &'storage Arc<dyn CloudSyncObjectStorage>,
22    store_dir: &'storage StoreDir,
23    membership: coven_protocol::membership::MembershipChain,
24    writer: Arc<LocalStoreWriter>,
25    keyrings: LocalWriterKeyrings<'storage>,
26}
27
28impl<'storage> AuthorizedWriterOperation<'storage> {
29    /// The provider-operation counter of the storage this operation publishes
30    /// through, so a run over it can report each stage's count beside its time.
31    pub(crate) fn provider_requests(
32        &self,
33    ) -> Option<Arc<dyn coven_foundation::stage_timing::ProviderRequests>> {
34        self.storage.provider_requests()
35    }
36
37    pub(super) fn from_parts(
38        database: StoreDatabase,
39        history: AuthorizedStoreHistory<'storage>,
40        storage: &'storage Arc<dyn CloudSyncObjectStorage>,
41        store_dir: &'storage StoreDir,
42        membership: coven_protocol::membership::MembershipChain,
43        writer: Arc<LocalStoreWriter>,
44        keyrings: LocalWriterKeyrings<'storage>,
45    ) -> Self {
46        Self {
47            database,
48            history,
49            storage,
50            store_dir,
51            membership,
52            writer,
53            keyrings,
54        }
55    }
56}