Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
Signed-off-by: chenfu <chenfu@yidian-inc.com>
  • Loading branch information
chenfu committed Feb 25, 2020
1 parent 0543abf commit afec18e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tikv"
version = "3.0.7-1"
version = "3.0.7-2"
authors = ["The TiKV Authors"]
description = "A distributed transactional key-value database powered by Rust and Raft"
license = "Apache-2.0"
Expand Down
16 changes: 12 additions & 4 deletions src/server/service/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,13 @@ impl<T: RaftStoreRouter + 'static, E: Engine> tikvpb_grpc::Tikv for Service<T, E
.start_coarse_timer();

let command_duration = tikv_util::time::Instant::now_coarse();
//let default_table = "default".as_bytes().to_vec();
let default_table = "default".as_bytes().to_vec();
//let key = req.get_keys().get(0).unwrap_or(&default_table);
let key = req.get_element_indexes().get(0).unwrap().get_key();
let index = req.get_element_indexes().get(0);
let key = match index {
Some(x) => x.get_key(),
None => &default_table,
};
let table = keys::get_table_from_key(key);
debug!("metric table: {}", table);

Expand Down Expand Up @@ -1431,9 +1435,13 @@ fn handle_batch_commands_request<E: Engine>(
response_batch_commands_request(id, resp, tx, timer, timer3);
}
Some(BatchCommandsRequest_Request_oneof_cmd::RawBatchGetByIndex(req)) => {
//let default_table = "default".as_bytes().to_vec();
let default_table = "default".as_bytes().to_vec();
//let key = req.get_keys().get(0).unwrap_or(&default_table);
let key = req.get_element_indexes().get(0).unwrap().get_key();
let index = req.get_element_indexes().get(0);
let key = match index {
Some(x) => x.get_key(),
None => &default_table,
};
let table = keys::get_table_from_key(key);
debug!("metric table: {}", table);

Expand Down

0 comments on commit afec18e

Please sign in to comment.