yihua commented on code in PR #20078: URL: https://github.com/apache/hudi/pull/20078#discussion_r4189593735
########## hudi-common/src/main/java/org/apache/hudi/common/table/read/FileGroupReaderTableState.java: ########## @@ -0,0 +1,227 @@ +/* + * 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. + */ + +package org.apache.hudi.common.table.read; + +import org.apache.hudi.common.function.SerializableSupplier; +import org.apache.hudi.common.schema.internal.InternalSchema; +import org.apache.hudi.common.schema.internal.utils.InternalSchemaUtils; +import org.apache.hudi.common.schema.internal.utils.SerDeHelper; +import org.apache.hudi.common.table.HoodieTableConfig; +import org.apache.hudi.common.table.HoodieTableMetaClient; +import org.apache.hudi.common.table.HoodieTableVersion; +import org.apache.hudi.common.util.InternalSchemaCache; +import org.apache.hudi.common.util.Option; +import org.apache.hudi.common.util.StringUtils; +import org.apache.hudi.storage.StoragePath; + +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.io.Serializable; +import java.util.TreeMap; + +/** + * The table-level state a file group reader needs, in place of a {@link HoodieTableMetaClient}. + * + * <p>A reader needs the table config and base path for every read. Only two cases need more: log blocks of tables + * before version 8 are checked against the committed instants, and schema-on-read resolves the schema a log block + * or file was written with. A state built with {@link #snapshotOf} answers the first from instants captured where the + * timeline is already loaded, so every reader of one query sees the same snapshot, and carries the meta client only + * for the second. {@link #fromMetaClient} keeps the older behavior of loading both lazily from a meta client. + */ +@RequiredArgsConstructor(access = AccessLevel.PRIVATE) +public final class FileGroupReaderTableState implements Serializable { Review Comment: Rename this to `TableState` for simplicity -- 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]
