HuangZhenQiu commented on code in PR #19805: URL: https://github.com/apache/hudi/pull/19805#discussion_r3906060854
########## hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/PartitionedRLIBootstrapOperator.java: ########## @@ -0,0 +1,245 @@ +/* + * 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.sink.bootstrap; + +import org.apache.hudi.client.common.HoodieFlinkEngineContext; +import org.apache.hudi.client.model.HoodieFlinkInternalRow; +import org.apache.hudi.common.data.HoodiePairData; +import org.apache.hudi.common.function.SerializableFunctionUnchecked; +import org.apache.hudi.common.model.FileSlice; +import org.apache.hudi.common.model.HoodieRecordGlobalLocation; +import org.apache.hudi.common.table.HoodieTableConfig; +import org.apache.hudi.common.table.HoodieTableMetaClient; +import org.apache.hudi.common.util.VisibleForTesting; +import org.apache.hudi.configuration.FlinkOptions; +import org.apache.hudi.metadata.HoodieBackedTableMetadata; +import org.apache.hudi.metadata.MetadataPartitionType; +import org.apache.hudi.util.StreamerUtil; +import org.apache.hudi.utils.RuntimeContextUtils; + +import lombok.extern.slf4j.Slf4j; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.runtime.state.StateInitializationContext; +import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; + +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Bootstrap operator that preload of time bounded partitioned record level index (RLI) data + * from the metadata table. + * + * <p>Only data table partitions that fall within the last {@link FlinkOptions#INDEX_RLI_CACHE_ROCKSDB_BOOTSTRAP_DAYS} + * days are eagerly preloaded; the partition path of each partition is parsed as a date using + * {@link FlinkOptions#PARTITION_FORMAT} (default {@link FlinkOptions#PARTITION_FORMAT_DAY}) to + * determine whether it falls inside the window. Partitions outside the window, and partitions whose + * path cannot be parsed as a date, are skipped here and are expected to be loaded on demand later. + * + * <p>Setting {@link FlinkOptions#INDEX_RLI_CACHE_ROCKSDB_BOOTSTRAP_DAYS} to {@code 0} disables preloading + * entirely, which is the expected fallback for non-temporal (non date-partitioned) tables. + */ +@Slf4j +public class PartitionedRLIBootstrapOperator Review Comment: Agree. TimeBounded implies the partitioned record index is used. -- 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]
