Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ clap = { version = "4.6" }
color-eyre = { version = "0.6" }
config = { version = "0.15" }
criterion = { version = "0.8" }
dashmap = "6.1"
derive_builder = { version = "0.20" }
dyn-clone = { version = "1.0" }
eyre = { version = "0.6" }
Expand Down
8 changes: 7 additions & 1 deletion crates/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,25 @@ workspace = true
[dependencies]
async-trait.workspace = true
byteorder.workspace = true
dashmap.workspace = true
eyre.workspace = true
fjall = { version = "3.1" }
futures.workspace = true
http.workspace = true
openraft = { workspace = true, features = ["serde", "type-alias"] }
openstack-keystone-config = { version = "0.1", path = "../config/" }
prost.workspace = true
rand.workspace = true
rmp.workspace = true
rmp-serde = "1.3"
serde = { workspace = true, features = ["derive"] }
serde_bytes.workspace = true
serde_json.workspace = true
tracing.workspace = true
thiserror.workspace = true
tonic = { workspace = true, features = ["router", "_tls-any"] }
tonic-prost.workspace = true
tracing.workspace = true
tokio.workspace = true

[dev-dependencies]
rcgen = "0.14.7"
Expand Down
21 changes: 17 additions & 4 deletions crates/storage/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
let proto_files = [
"proto/raft.proto",
"proto/identity_types.proto",
"proto/identity.proto",
"proto/storage_types.proto",
"proto/storage.proto",
];

tonic_prost_build::configure()
Expand All @@ -23,11 +23,24 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
"#[derive(Deserialize, Serialize)]",
)
.type_attribute("keystone.raft.Vote", "#[derive(Deserialize, Serialize)]")
.type_attribute("keystone.api.Response", "#[derive(Deserialize, Serialize)]")
.type_attribute(
"keystone.api.SetRequest",
"keystone.api.CommandRequest",
"#[derive(Deserialize, Serialize)]",
)
.type_attribute("keystone.api.Response", "#[derive(Deserialize, Serialize)]")
// .type_attribute(
// "keystone.api.DeleteRequest",
// "#[derive(Deserialize, Serialize)]",
// )
// .type_attribute(
// "keystone.api.StoreRequest",
// "#[derive(Deserialize, Serialize)]",
// )
// .type_attribute(
// "keystone.api.StoreRequest.request",
// "#[derive(serde::Deserialize, serde::Serialize)]",
// )
//.type_attribute("keystone.api.Response", "#[derive(Deserialize, Serialize)]")
.compile_protos(&proto_files, &["proto"])?;
Ok(())
}
18 changes: 0 additions & 18 deletions crates/storage/proto/identity.proto

This file was deleted.

23 changes: 0 additions & 23 deletions crates/storage/proto/identity_types.proto

This file was deleted.

19 changes: 10 additions & 9 deletions crates/storage/proto/raft.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ syntax = "proto3";
package keystone.raft;

import "google/protobuf/empty.proto";
import "identity_types.proto";
import "storage_types.proto";


// Node represents a single node in the Raft cluster.
Expand All @@ -30,11 +30,11 @@ message Entry {
uint64 term = 1;
uint64 index = 2;

// Optional Application data.
keystone.api.SetRequest app_data = 12;

// Optional Membership config.
Membership membership = 13;
Membership membership = 3;

// Optional Store request.
optional bytes app_data = 4;
}

// NodeIds is a set of NodeIds.
Expand Down Expand Up @@ -190,11 +190,11 @@ message AdminResponse {
// The log id of the committed log entry.
keystone.raft.LogId log_id = 1;

// If the committed log entry is a normal one.
keystone.api.Response data = 2;

// If the committed log entry is a change-membership entry.
keystone.raft.Membership membership = 3;
keystone.raft.Membership membership = 2;

// If the committed log entry is a normal one.
keystone.api.Response data = 3;
}

message MetricsResponse {
Expand Down Expand Up @@ -224,3 +224,4 @@ service ClusterAdminService {
// Metrics retrieves cluster metrics and status information.
rpc Metrics(google.protobuf.Empty) returns (MetricsResponse) {}
}

13 changes: 13 additions & 0 deletions crates/storage/proto/storage.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package keystone.api;

import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "storage_types.proto";

// StorageService provides the key-value store API operations.
service StorageService {
// Write the command
rpc Command(keystone.api.CommandRequest) returns (keystone.api.Response) {}
}
14 changes: 14 additions & 0 deletions crates/storage/proto/storage_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";

package keystone.api;

message CommandRequest {
// Store request.
bytes payload = 1;
}

// GetResponse contains the value associated with the requested key.
message Response {
// Retrieved value.
optional bytes value = 1;
}
Loading
Loading