-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d4a276
commit a65b992
Showing
56 changed files
with
673 additions
and
5,949 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ members = [ | |
"src/client", | ||
"src/engine", | ||
"src/runtime", | ||
"src/interface", | ||
"src/util/pro-macro", | ||
] | ||
|
||
|
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2022 The template Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
package memtable; | ||
|
||
service MemtableService { | ||
rpc ListKV (ListKVRequest) returns (ListKVResponse); | ||
rpc UpdateKV (UpdateKVRequest) returns (UpdateKVResponse); | ||
} | ||
|
||
message ListKVRequest { | ||
string tenant = 1; | ||
uint64 seq = 2; | ||
string key = 3; | ||
} | ||
|
||
message ListKVResponse { | ||
string value = 1; | ||
} | ||
|
||
enum ValueType { | ||
NormalValue = 0; | ||
Deletion = 1; | ||
Unknown = 2; | ||
} | ||
|
||
message UpdateKVRequest { | ||
string tenant = 1; | ||
uint64 seq = 2; | ||
ValueType value_type = 3; | ||
string key = 4; | ||
optional string value = 5; | ||
} | ||
|
||
message UpdateKVResponse { | ||
string tenant = 1; | ||
uint64 seq = 2; | ||
ValueType value_type = 3; | ||
bool ack = 4; | ||
} | ||
|
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,34 @@ | ||
// Copyright 2022 The template Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use actix::{Actor, System}; | ||
use engine::BytewiseComparator; | ||
use engine::db::format::InternalKeyComparator; | ||
use engine::mem::MemTable; | ||
use engine::mem::handler::MemtableServiceHandler; | ||
use engine::mem::memtable_actor::MemTableActor; | ||
|
||
fn main() { | ||
let system = System::new(); | ||
system.block_on(async { | ||
let add = "[::1]:50051".to_string(); | ||
let icmp = InternalKeyComparator::new(BytewiseComparator::default()); | ||
let mem = MemTable::new(1 << 32, icmp); | ||
let memtable_handler = MemtableServiceHandler::new_with_memtable(mem); | ||
let memtable_actor = MemTableActor::new(memtable_handler, add); | ||
memtable_actor.start(); | ||
futures::future::pending::<()>().await; | ||
}); | ||
system.run().unwrap(); | ||
} |
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
Oops, something went wrong.