thinkharderdev commented on a change in pull request #1913: URL: https://github.com/apache/arrow-datafusion/pull/1913#discussion_r819907547
########## File path: ballista/rust/scheduler/src/state/persistent_state.rs ########## @@ -0,0 +1,312 @@ +// 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. + +use log::debug; +use parking_lot::RwLock; +use prost::Message; +use std::any::type_name; +use std::collections::HashMap; +use std::sync::Arc; + +use ballista_core::error::{BallistaError, Result}; + +use ballista_core::serde::protobuf::JobStatus; + +use crate::state::backend::StateBackendClient; +use ballista_core::serde::scheduler::ExecutorMetadata; +use ballista_core::serde::{protobuf, AsExecutionPlan, AsLogicalPlan, BallistaCodec}; +use datafusion::physical_plan::ExecutionPlan; +use datafusion::prelude::ExecutionContext; + +type StageKey = (String, u32); + +#[derive(Clone)] +pub(crate) struct PersistentSchedulerState< + T: 'static + AsLogicalPlan, + U: 'static + AsExecutionPlan, +> { + // for db + config_client: Arc<dyn StateBackendClient>, + namespace: String, + pub(crate) codec: BallistaCodec<T, U>, + + // for in-memory cache + executors_metadata: Arc<RwLock<HashMap<String, ExecutorMetadata>>>, Review comment: Should executor metadata be persistent? Seems like it could be useful to speed up a scheduler restart since it would have to wait for executors to re-register but it seems like in the case of push-based scheduling we need to wait for heartbeats anyway and in the poll-based scheduling we wouldn't schedule work until the executor registers. -- 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]
