Skip to content

Commit

Permalink
resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer committed Jan 12, 2022
1 parent e80d5aa commit 3814c3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions components/br-stream/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use bytes::{Buf, Bytes};
use std::io::prelude::*;
use std::io::Cursor;
use tikv_util::Either;

pub struct Encoder;

Expand All @@ -26,7 +27,7 @@ impl Encoder {
buf.read_exact(key.as_mut_slice()).unwrap();
let len = buf.get_u32_le() as usize;
let mut val = vec![0; len];
buf.read_exact(buffer.as_mut_slice()).unwrap();
buf.read_exact(val.as_mut_slice()).unwrap();
(key, val)
}
}
Expand All @@ -45,7 +46,7 @@ mod tests {
let e = Encoder::encode_event(&key, &val);
let mut event = vec![];
for s in e {
event.push(s.into());
event.extend_from_slice(s.as_ref());
}
let (decoded_key, decoded_val) = Encoder::decode_event(&event);
assert_eq!(key, decoded_key);
Expand Down
2 changes: 1 addition & 1 deletion components/br-stream/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use raftstore::coprocessor::CmdBatch;
use tikv::config::BackupStreamConfig;

use tikv_util::worker::{Runnable, Scheduler};
use tikv_util::{debug, error, info, Either};
use tikv_util::{debug, error, info};

use super::metrics::{HANDLE_EVENT_DURATION_HISTOGRAM, HANDLE_KV_HISTOGRAM};

Expand Down
2 changes: 1 addition & 1 deletion components/br-stream/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
time::Duration,
};

use crate::{codec::Encoder, endpoint::Task, errors::Error};
use crate::{codec::Encoder, endpoint::Task, errors::Error, utils::SlotMap};

use super::errors::Result;
use engine_traits::{CF_DEFAULT, CF_WRITE};
Expand Down

0 comments on commit 3814c3b

Please sign in to comment.