sunchao commented on code in PR #7299:
URL: https://github.com/apache/datafusion-comet/pull/7299#discussion_r4403170077


##########
native/native-executors/src/bin/comet-scheduler.rs:
##########
@@ -0,0 +1,76 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! A Comet scheduler: Ballista's scheduler, which Comet executors register 
with, wrapped in the
+//! Arrow Flight service that Spark drivers submit queries to.
+//!
+//! Configured through environment variables, with Ballista's defaults 
otherwise:
+//! - `COMET_SCHEDULER_BIND_HOST` (default `127.0.0.1`)
+//! - `COMET_SCHEDULER_PORT`: Ballista's gRPC port, for executors (default 
`50050`)
+//! - `COMET_SCHEDULER_FLIGHT_PORT`: the Flight port, for drivers (default 
`50060`)
+
+use std::net::SocketAddr;
+use std::sync::Arc;
+
+use arrow_flight::flight_service_server::FlightServiceServer;
+use ballista_scheduler::cluster::BallistaCluster;
+use ballista_scheduler::config::SchedulerConfig;
+use ballista_scheduler::scheduler_process::{create_scheduler, 
start_grpc_service};
+use comet_native_executors::codec::CometPhysicalCodec;
+use comet_native_executors::frontend::CometFlightService;
+use comet_native_executors::{env_var, init_logging};
+use datafusion_proto::protobuf::{LogicalPlanNode, PhysicalPlanNode};
+use log::info;
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+    init_logging();
+    let mut config = SchedulerConfig {
+        override_physical_codec: Some(Arc::new(CometPhysicalCodec::default())),
+        ..Default::default()

Review Comment:
   Could we expose and document result retention, or keep results alive until 
the client releases them? `SchedulerConfig::default()` in the pinned Ballista 
55.0.0 sets `finished_job_data_clean_up_interval_seconds` to 300. On success, 
`clean_up_successful_job` schedules deletion of the whole job directory, 
including final result files, independently of consumption. This binary only 
exposes host/port settings, and the returned Flight endpoints have neither an 
expiration nor a renewal path. A client that reads endpoints sequentially and 
spends more than five minutes on earlier partitions therefore gets a file-open 
error on a remaining partition. The cluster test uses that same sequential 
fetch pattern, but with tiny results. Please make the lifetime manageable 
through this frontend and add a delayed-second-endpoint test with a short 
retention interval. I verified the dependency source path; I did not run a 
five-minute cluster reproduction.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to