This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-ballista.git


The following commit(s) were added to refs/heads/master by this push:
     new d335458e Use bind host rather than the external host for starting a 
local executor service (#245)
d335458e is described below

commit d335458e87132a39970bd9311b44615458a8bc44
Author: yahoNanJing <[email protected]>
AuthorDate: Mon Sep 19 21:32:49 2022 +0800

    Use bind host rather than the external host for starting a local executor 
service (#245)
    
    Co-authored-by: yangzhong <[email protected]>
---
 ballista/rust/executor/src/executor_server.rs | 13 ++-----------
 ballista/rust/executor/src/main.rs            |  1 +
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/ballista/rust/executor/src/executor_server.rs 
b/ballista/rust/executor/src/executor_server.rs
index 6d0719ff..7bde7f7f 100644
--- a/ballista/rust/executor/src/executor_server.rs
+++ b/ballista/rust/executor/src/executor_server.rs
@@ -32,7 +32,6 @@ use 
ballista_core::serde::physical_plan::from_proto::parse_protobuf_hash_partiti
 use ballista_core::serde::protobuf::executor_grpc_server::{
     ExecutorGrpc, ExecutorGrpcServer,
 };
-use ballista_core::serde::protobuf::executor_registration::OptionalHost;
 use ballista_core::serde::protobuf::scheduler_grpc_client::SchedulerGrpcClient;
 use ballista_core::serde::protobuf::{
     executor_metric, executor_status, CancelTasksParams, CancelTasksResult,
@@ -74,6 +73,7 @@ struct CuratorTaskStatus {
 
 pub async fn startup<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>(
     mut scheduler: SchedulerGrpcClient<Channel>,
+    bind_host: String,
     executor: Arc<Executor>,
     codec: BallistaCodec<T, U>,
     stop_send: mpsc::Sender<bool>,
@@ -98,16 +98,7 @@ pub async fn startup<T: 'static + AsLogicalPlan, U: 'static 
+ AsExecutionPlan>(
     // 1. Start executor grpc service
     let server = {
         let executor_meta = executor.metadata.clone();
-        let addr = format!(
-            "{}:{}",
-            executor_meta
-                .optional_host
-                .map(|h| match h {
-                    OptionalHost::Host(host) => host,
-                })
-                .unwrap_or_else(|| String::from("0.0.0.0")),
-            executor_meta.grpc_port
-        );
+        let addr = format!("{}:{}", bind_host, executor_meta.grpc_port);
         let addr = addr.parse().unwrap();
 
         info!(
diff --git a/ballista/rust/executor/src/main.rs 
b/ballista/rust/executor/src/main.rs
index 2df20922..f37b17ea 100644
--- a/ballista/rust/executor/src/main.rs
+++ b/ballista/rust/executor/src/main.rs
@@ -233,6 +233,7 @@ async fn main() -> Result<()> {
                 //If there is executor registration error during startup, 
return the error and stop early.
                 executor_server::startup(
                     scheduler.clone(),
+                    bind_host,
                     executor.clone(),
                     default_codec,
                     stop_send,

Reply via email to