Skip to content

Commit

Permalink
fixup! fixup! Add durable Raft metadata storage
Browse files Browse the repository at this point in the history
  • Loading branch information
tillrohrmann committed Aug 8, 2024
1 parent e6144f2 commit 6b19d9d
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions crates/metadata-store/src/raft/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DB>,
rocksdb: Arc<RocksDb>,
}

impl RocksDbStorage {
pub fn new() -> Self {
unimplemented!()
}
}

impl Storage for RocksDbStorage {
fn initial_state(&self) -> raft::Result<RaftState> {
todo!()
}

fn entries(&self, low: u64, high: u64, max_size: impl Into<Option<u64>>, context: GetEntriesContext) -> raft::Result<Vec<Entry>> {
todo!()
}

fn term(&self, idx: u64) -> raft::Result<u64> {
todo!()
}

fn first_index(&self) -> raft::Result<u64> {
todo!()
}

fn last_index(&self) -> raft::Result<u64> {
todo!()
}

fn snapshot(&self, request_index: u64, to: u64) -> raft::Result<Snapshot> {
todo!()
}
}

0 comments on commit 6b19d9d

Please sign in to comment.