codope commented on code in PR #395: URL: https://github.com/apache/hudi-rs/pull/395#discussion_r2204509388
########## crates/core/src/timeline/layout.rs: ########## @@ -0,0 +1,86 @@ +/* + * 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 crate::config::HudiConfigs; +use crate::storage::Storage; +use crate::timeline::instant::Instant; +use crate::timeline::selector::TimelineSelector; +use crate::Result; +use std::sync::Arc; + +/// Timeline layout implementations for different table versions. +#[derive(Debug, Clone)] +pub enum TimelineLayoutType { + Active(super::active::ActiveTimeline), + Lsm(super::lsm::LsmTimeline), Review Comment: I agree, better suggestion overall! Few things if you can clarify: > We also avoid calling a LSM timeline since LSM tree is just one impl of Timeline which should be hidden away from Timeline's level Should the LSM tree logic be a separate module that the loaders use, or should the loaders themselves be the LSM tree implementations? So, in the context of `TimelineLoader::LayoutTwoActive`, would this variant contain an `LSMTree` instance, or would it implement LSM tree logic directly? Also, should the current `Timeline::load_instants()` method remain as-is, or would you prefer a different public API? For example, another API that takes a boolean to decide whether to load archived/compacted timeline. Alternatively, we could just add another API keeping `load_instants()` as-is. -- 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]
