Skip to content

Commit 2a73e13

Browse files
committed
allow customized schedulergrpcclient
1 parent 336bb6e commit 2a73e13

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

ballista/core/src/serde/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ use crate::remote_catalog::remote_table_provider::RemoteTableProvider;
5050
use crate::serde::protobuf::ballista_physical_plan_node::PhysicalPlanType;
5151
use crate::serde::scheduler::PartitionLocation;
5252
use datafusion::catalog::TableProvider;
53-
use datafusion::logical_expr::UserDefinedLogicalNode;
5453
pub use generated::ballista as protobuf;
5554
use prost::Message;
5655
use std::fmt::Debug;

ballista/executor/src/execution_loop.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,20 @@ use std::time::{SystemTime, UNIX_EPOCH};
4545
use std::{sync::Arc, time::Duration};
4646
use tokio::sync::oneshot::Sender as OneShotSender;
4747
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
48-
use tonic::transport::Channel;
4948

50-
pub async fn poll_loop<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>(
51-
mut scheduler: SchedulerGrpcClient<Channel>,
49+
pub async fn poll_loop<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan, C>(
50+
mut scheduler: SchedulerGrpcClient<C>,
5251
executor: Arc<Executor>,
5352
codec: BallistaCodec<T, U>,
5453
readiness: Option<OneShotSender<String>>,
55-
) -> Result<(), BallistaError> {
54+
) -> Result<(), BallistaError>
55+
where
56+
C: tonic::client::GrpcService<tonic::body::Body> + Send + 'static,
57+
C::Error: Into<Box<dyn Error + Send + Sync>>,
58+
C::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
59+
<C::ResponseBody as tonic::codegen::Body>::Error:
60+
Into<Box<dyn Error + Send + Sync>> + Send,
61+
{
5662
let executor_specification: ExecutorSpecification = executor
5763
.metadata
5864
.specification

0 commit comments

Comments
 (0)