Skip to content

Commit

Permalink
[Sequencer] Scaffolding Leader Sequencer
Browse files Browse the repository at this point in the history
  • Loading branch information
muhamadazmy committed Sep 17, 2024
1 parent d4568a9 commit 77e567b
Show file tree
Hide file tree
Showing 8 changed files with 1,365 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/bifrost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ futures = { workspace = true }
metrics = { workspace = true }
parking_lot = { workspace = true }
pin-project = { workspace = true }
rand = { workspace = true }
rocksdb = { workspace = true }
serde = { workspace = true }
smallvec = { workspace = true }
Expand All @@ -40,6 +41,7 @@ tracing = { workspace = true }

[dev-dependencies]
restate-core = { workspace = true, features = ["test-util"] }
restate-log-server = { workspace = true }
restate-metadata-store = { workspace = true }
restate-test-util = { workspace = true }
restate-types = { workspace = true, features = ["test-util"] }
Expand Down
19 changes: 19 additions & 0 deletions crates/bifrost/src/loglet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ pub trait LogletReadStream: Stream<Item = Result<LogEntry<LogletOffset>, Operati

pub type SendableLogletReadStream = Pin<Box<dyn LogletReadStream + Send>>;

pub(crate) struct Resolver {

Check failure on line 157 in crates/bifrost/src/loglet/mod.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-22.04)

struct `Resolver` is never constructed
tx: oneshot::Sender<Result<LogletOffset, AppendError>>,
}

impl Resolver {
pub fn sealed(self) {

Check failure on line 162 in crates/bifrost/src/loglet/mod.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-22.04)

methods `sealed` and `offset` are never used
let _ = self.tx.send(Err(AppendError::Sealed));
}

pub fn offset(self, offset: LogletOffset) {
let _ = self.tx.send(Ok(offset));
}
}

pub struct LogletCommit {
rx: oneshot::Receiver<Result<LogletOffset, AppendError>>,
}
Expand All @@ -170,6 +184,11 @@ impl LogletCommit {
let _ = tx.send(Ok(offset));
Self { rx }
}

pub(crate) fn later() -> (Self, Resolver) {

Check failure on line 188 in crates/bifrost/src/loglet/mod.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-22.04)

associated function `later` is never used
let (tx, rx) = oneshot::channel();
(Self { rx }, Resolver { tx })
}
}

impl std::future::Future for LogletCommit {
Expand Down
1 change: 1 addition & 0 deletions crates/bifrost/src/providers/replicated_loglet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

pub(crate) mod metric_definitions;
mod provider;
mod sequencer;

pub use provider::Factory;
Loading

0 comments on commit 77e567b

Please sign in to comment.