Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: upgrade grpcio to v0.4 #3650

Merged
merged 9 commits into from Oct 12, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions 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
Expand Up @@ -72,7 +72,7 @@ zipf = "0.2.0"
bitflags = "1.0.1"
fail = "0.2"
uuid = { version = "0.6", features = [ "serde", "v4" ] }
grpcio = { version = "0.3", features = [ "secure" ] }
grpcio = { version = "0.4", features = [ "secure" ] }
raft = "0.3"
crossbeam-channel = "0.2"
crossbeam = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion components/test_raftstore/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ tempdir = "0.3"
raft = "0.3"
futures = "0.1"
tokio-timer = "0.2"
grpcio = { version = "0.3", features = [ "secure" ] }
grpcio = { version = "0.4", features = [ "secure" ] }
rand = "0.3"
log = "0.3.9"

Expand Down
14 changes: 7 additions & 7 deletions src/import/kv_service.rs
Expand Up @@ -53,7 +53,7 @@ impl ImportKVService {

impl ImportKv for ImportKVService {
fn switch_mode(
&self,
&mut self,
ctx: RpcContext,
req: SwitchModeRequest,
sink: UnarySink<SwitchModeResponse>,
Expand Down Expand Up @@ -82,7 +82,7 @@ impl ImportKv for ImportKVService {
}

fn open_engine(
&self,
&mut self,
ctx: RpcContext,
req: OpenEngineRequest,
sink: UnarySink<OpenEngineResponse>,
Expand All @@ -103,7 +103,7 @@ impl ImportKv for ImportKVService {
}

fn write_engine(
&self,
&mut self,
ctx: RpcContext,
stream: RequestStream<WriteEngineRequest>,
sink: ClientStreamingSink<WriteEngineResponse>,
Expand Down Expand Up @@ -160,7 +160,7 @@ impl ImportKv for ImportKVService {
}

fn close_engine(
&self,
&mut self,
ctx: RpcContext,
req: CloseEngineRequest,
sink: UnarySink<CloseEngineResponse>,
Expand Down Expand Up @@ -191,7 +191,7 @@ impl ImportKv for ImportKVService {
}

fn import_engine(
&self,
&mut self,
ctx: RpcContext,
req: ImportEngineRequest,
sink: UnarySink<ImportEngineResponse>,
Expand All @@ -212,7 +212,7 @@ impl ImportKv for ImportKVService {
}

fn cleanup_engine(
&self,
&mut self,
ctx: RpcContext,
req: CleanupEngineRequest,
sink: UnarySink<CleanupEngineResponse>,
Expand All @@ -233,7 +233,7 @@ impl ImportKv for ImportKVService {
}

fn compact_cluster(
&self,
&mut self,
ctx: RpcContext,
req: CompactClusterRequest,
sink: UnarySink<CompactClusterResponse>,
Expand Down
8 changes: 4 additions & 4 deletions src/import/sst_service.rs
Expand Up @@ -71,7 +71,7 @@ impl<Router: RaftStoreRouter> ImportSSTService<Router> {

impl<Router: RaftStoreRouter> ImportSst for ImportSSTService<Router> {
fn switch_mode(
&self,
&mut self,
ctx: RpcContext,
req: SwitchModeRequest,
sink: UnarySink<SwitchModeResponse>,
Expand Down Expand Up @@ -100,7 +100,7 @@ impl<Router: RaftStoreRouter> ImportSst for ImportSSTService<Router> {

/// Receive SST from client and save the file for later ingesting.
fn upload(
&self,
&mut self,
ctx: RpcContext,
stream: RequestStream<UploadRequest>,
sink: ClientStreamingSink<UploadResponse>,
Expand Down Expand Up @@ -154,7 +154,7 @@ impl<Router: RaftStoreRouter> ImportSst for ImportSSTService<Router> {
/// If the ingestion fails because the region is not found or the epoch does
/// not match, the remaining files will eventually be cleaned up by
/// CleanupSSTWorker.
fn ingest(&self, ctx: RpcContext, mut req: IngestRequest, sink: UnarySink<IngestResponse>) {
fn ingest(&mut self, ctx: RpcContext, mut req: IngestRequest, sink: UnarySink<IngestResponse>) {
let label = "ingest";
let timer = Instant::now_coarse();

Expand Down Expand Up @@ -194,7 +194,7 @@ impl<Router: RaftStoreRouter> ImportSst for ImportSSTService<Router> {
)
}

fn compact(&self, ctx: RpcContext, req: CompactRequest, sink: UnarySink<CompactResponse>) {
fn compact(&mut self, ctx: RpcContext, req: CompactRequest, sink: UnarySink<CompactResponse>) {
let label = "compact";
let timer = Instant::now_coarse();
let engine = Arc::clone(&self.engine);
Expand Down
5 changes: 2 additions & 3 deletions src/server/raft_client.rs
Expand Up @@ -71,7 +71,7 @@ impl Conn {
let client = TikvClient::new(channel);
let (tx, rx) = mpsc::unbounded();
let (tx_close, rx_close) = oneshot::channel();
let (sink, _) = client.raft().unwrap();
let (sink, receiver) = client.raft().unwrap();
let addr = addr.to_owned();
client.spawn(
rx_close
Expand All @@ -92,8 +92,7 @@ impl Conn {
warn!("send raftmessage to {} failed: {:?}", addr, e);
}),
)
.map(|_| ())
.map_err(|_| ()),
.then(|_| receiver.then(|_| Ok(()))),
);
Conn {
stream: tx,
Expand Down
26 changes: 13 additions & 13 deletions src/server/service/debug.rs
Expand Up @@ -86,7 +86,7 @@ impl<T: RaftStoreRouter> Service<T> {
}

impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
fn get(&self, ctx: RpcContext, mut req: GetRequest, sink: UnarySink<GetResponse>) {
fn get(&mut self, ctx: RpcContext, mut req: GetRequest, sink: UnarySink<GetResponse>) {
const TAG: &str = "debug_get";

let db = req.get_db();
Expand All @@ -108,7 +108,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
self.handle_response(ctx, sink, f, TAG);
}

fn raft_log(&self, ctx: RpcContext, req: RaftLogRequest, sink: UnarySink<RaftLogResponse>) {
fn raft_log(&mut self, ctx: RpcContext, req: RaftLogRequest, sink: UnarySink<RaftLogResponse>) {
const TAG: &str = "debug_raft_log";

let region_id = req.get_region_id();
Expand All @@ -130,7 +130,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn region_info(
&self,
&mut self,
ctx: RpcContext,
req: RegionInfoRequest,
sink: UnarySink<RegionInfoResponse>,
Expand Down Expand Up @@ -163,7 +163,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn region_size(
&self,
&mut self,
ctx: RpcContext,
mut req: RegionSizeRequest,
sink: UnarySink<RegionSizeResponse>,
Expand Down Expand Up @@ -199,7 +199,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn scan_mvcc(
&self,
&mut self,
_: RpcContext,
mut req: ScanMvccRequest,
sink: ServerStreamingSink<ScanMvccResponse>,
Expand All @@ -226,7 +226,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
self.pool.spawn(future).forget();
}

fn compact(&self, ctx: RpcContext, req: CompactRequest, sink: UnarySink<CompactResponse>) {
fn compact(&mut self, ctx: RpcContext, req: CompactRequest, sink: UnarySink<CompactResponse>) {
let debugger = self.debugger.clone();
let f = self.pool.spawn_fn(move || {
debugger
Expand All @@ -244,7 +244,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn inject_fail_point(
&self,
&mut self,
ctx: RpcContext,
mut req: InjectFailPointRequest,
sink: UnarySink<InjectFailPointResponse>,
Expand All @@ -267,7 +267,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn recover_fail_point(
&self,
&mut self,
ctx: RpcContext,
mut req: RecoverFailPointRequest,
sink: UnarySink<RecoverFailPointResponse>,
Expand All @@ -287,7 +287,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn list_fail_points(
&self,
&mut self,
ctx: RpcContext,
_: ListFailPointsRequest,
sink: UnarySink<ListFailPointsResponse>,
Expand All @@ -310,7 +310,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn get_metrics(
&self,
&mut self,
ctx: RpcContext,
req: GetMetricsRequest,
sink: UnarySink<GetMetricsResponse>,
Expand All @@ -335,7 +335,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn check_region_consistency(
&self,
&mut self,
ctx: RpcContext,
req: RegionConsistencyCheckRequest,
sink: UnarySink<RegionConsistencyCheckResponse>,
Expand All @@ -356,7 +356,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn modify_tikv_config(
&self,
&mut self,
ctx: RpcContext,
mut req: ModifyTikvConfigRequest,
sink: UnarySink<ModifyTikvConfigResponse>,
Expand All @@ -378,7 +378,7 @@ impl<T: RaftStoreRouter + 'static + Send> debugpb_grpc::Debug for Service<T> {
}

fn get_region_properties(
&self,
&mut self,
ctx: RpcContext,
req: GetRegionPropertiesRequest,
sink: UnarySink<GetRegionPropertiesResponse>,
Expand Down