-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New `log-server` role and associated service to serve as the server-side of the replicated loglet
- Loading branch information
1 parent
c8999d8
commit a40701e
Showing
12 changed files
with
266 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
|
||
pub mod local_loglet; | ||
pub mod memory_loglet; | ||
pub mod replicated_loglet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH. | ||
// All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
[package] | ||
name = "restate-log-server" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
license.workspace = true | ||
publish = false | ||
|
||
[features] | ||
default = [] | ||
options_schema = ["dep:schemars"] | ||
test-util = [] | ||
|
||
[dependencies] | ||
restate-core = { workspace = true } | ||
restate-rocksdb = { workspace = true } | ||
restate-types = { workspace = true } | ||
|
||
anyhow = { workspace = true } | ||
async-trait = { workspace = true } | ||
bytes = { workspace = true } | ||
bytestring = { workspace = true, features = ["serde"] } | ||
codederror = { workspace = true } | ||
derive_builder = { workspace = true } | ||
derive_more = { workspace = true } | ||
enum-map = { workspace = true, features = ["serde"] } | ||
futures = { workspace = true } | ||
humantime = { workspace = true } | ||
metrics = { workspace = true } | ||
once_cell = { workspace = true } | ||
pin-project = { workspace = true } | ||
rocksdb = { workspace = true } | ||
schemars = { workspace = true, optional = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
serde_with = { workspace = true } | ||
smallvec = { workspace = true } | ||
static_assertions = { workspace = true } | ||
strum = { workspace = true } | ||
strum_macros = { workspace = true } | ||
thiserror = { workspace = true } | ||
tokio = { workspace = true } | ||
tokio-stream = { workspace = true, features = ["sync"] } | ||
tokio-util = { workspace = true } | ||
tracing = { workspace = true } | ||
|
||
|
||
[dev-dependencies] | ||
restate-core = { workspace = true, features = ["test-util"] } | ||
restate-metadata-store = { workspace = true } | ||
restate-test-util = { workspace = true } | ||
restate-types = { workspace = true, features = ["test-util"] } | ||
|
||
criterion = { workspace = true, features = ["async_tokio"] } | ||
googletest = { workspace = true } | ||
test-log = { workspace = true } | ||
tempfile = { workspace = true } | ||
tokio = { workspace = true, features = ["test-util"] } | ||
tracing-subscriber = { workspace = true } | ||
tracing-test = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH. | ||
// All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use codederror::CodedError; | ||
|
||
use restate_core::ShutdownError; | ||
|
||
/// Result type for log-server operations. | ||
pub type Result<T, E = LogServerError> = std::result::Result<T, E>; | ||
|
||
#[derive(Debug, thiserror::Error, CodedError)] | ||
pub enum LogServerBuildError { | ||
#[error("unknown")] | ||
#[code(unknown)] | ||
Unknown, | ||
} | ||
|
||
#[derive(thiserror::Error, Debug, Clone)] | ||
pub enum LogServerError { | ||
#[error("operation failed due to an ongoing shutdown")] | ||
Shutdown(#[from] ShutdownError), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH. | ||
// All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
mod error; | ||
mod metric_definitions; | ||
mod service; | ||
|
||
pub use error::{LogServerBuildError, LogServerError, Result}; | ||
pub use service::LogServerService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH. | ||
// All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
pub fn describe_metrics() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH. | ||
// All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use restate_core::network::{MessageRouterBuilder, Networking}; | ||
use restate_core::{Metadata, TaskCenter, TaskKind}; | ||
use restate_types::config::UpdateableConfiguration; | ||
|
||
use crate::error::LogServerBuildError; | ||
use crate::metric_definitions::describe_metrics; | ||
|
||
pub struct LogServerService { | ||
_updateable_config: UpdateableConfiguration, | ||
task_center: TaskCenter, | ||
_metadata: Metadata, | ||
} | ||
|
||
impl LogServerService { | ||
pub async fn create( | ||
updateable_config: UpdateableConfiguration, | ||
task_center: TaskCenter, | ||
metadata: Metadata, | ||
_router_builder: &mut MessageRouterBuilder, | ||
_networking: Networking, | ||
) -> Result<Self, LogServerBuildError> { | ||
describe_metrics(); | ||
|
||
Ok(Self { | ||
_updateable_config: updateable_config, | ||
task_center, | ||
_metadata: metadata, | ||
}) | ||
} | ||
|
||
pub async fn start(self) -> anyhow::Result<()> { | ||
let tc = self.task_center.clone(); | ||
tc.spawn(TaskKind::SystemService, "log-server", None, async { | ||
self.run().await | ||
})?; | ||
|
||
Ok(()) | ||
} | ||
|
||
async fn run(self) -> anyhow::Result<()> { | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters