From 6b19d9db7e84307fb2af6e48eb245e278342bfe0 Mon Sep 17 00:00:00 2001 From: Till Rohrmann Date: Wed, 7 Aug 2024 13:03:21 +0200 Subject: [PATCH] fixup! fixup! Add durable Raft metadata storage --- crates/metadata-store/src/raft/storage.rs | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/crates/metadata-store/src/raft/storage.rs b/crates/metadata-store/src/raft/storage.rs index 2944dfa88..801707056 100644 --- a/crates/metadata-store/src/raft/storage.rs +++ b/crates/metadata-store/src/raft/storage.rs @@ -8,3 +8,45 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0. +use std::sync::Arc; +use raft::{GetEntriesContext, RaftState, Storage}; +use raft::eraftpb::{Entry, Snapshot}; +use rocksdb::DB; +use restate_rocksdb::RocksDb; + +struct RocksDbStorage { + db: Arc, + rocksdb: Arc, +} + +impl RocksDbStorage { + pub fn new() -> Self { + unimplemented!() + } +} + +impl Storage for RocksDbStorage { + fn initial_state(&self) -> raft::Result { + todo!() + } + + fn entries(&self, low: u64, high: u64, max_size: impl Into>, context: GetEntriesContext) -> raft::Result> { + todo!() + } + + fn term(&self, idx: u64) -> raft::Result { + todo!() + } + + fn first_index(&self) -> raft::Result { + todo!() + } + + fn last_index(&self) -> raft::Result { + todo!() + } + + fn snapshot(&self, request_index: u64, to: u64) -> raft::Result { + todo!() + } +} \ No newline at end of file