zjw1111 commented on code in PR #272: URL: https://github.com/apache/paimon-cpp/pull/272#discussion_r3912699146
########## src/paimon/common/utils/file_block_cache.h: ########## @@ -0,0 +1,145 @@ +/* + * 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. + */ + +#pragma once + +#include <atomic> +#include <cstdint> +#include <future> +#include <memory> +#include <mutex> +#include <unordered_map> + +#include "paimon/common/utils/read_ahead_cache.h" +#include "paimon/fs/file_system.h" +#include "paimon/memory/bytes.h" +#include "paimon/memory/memory_pool.h" +#include "paimon/status.h" +#include "paimon/visibility.h" + +namespace paimon { + +/// A cache of fixed-size blocks of one file, serving the reads that no +/// prefetched range covers: a parquet reader reads the footer and the page index +/// before any range can be registered, and every reader of the file reads the +/// same bytes. +/// +/// Blocks are aligned to the END of the file: block 0 is +/// [file_size - block_size, file_size). The metadata of a parquet/orc file lives +/// in its tail and arrow reads exactly the last 64 KiB as the footer, so an Review Comment: > arrow reads exactly the last 64 KiB as the footer means parquet or just arrow? what is the behavior or any bad case in orc and other format? -- 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]
