rdblue commented on code in PR #14533: URL: https://github.com/apache/iceberg/pull/14533#discussion_r2539881385
########## api/src/main/java/org/apache/iceberg/TrackedFile.java: ########## @@ -0,0 +1,280 @@ +/* + * 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.iceberg; + +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Set; +import org.apache.iceberg.types.Types; + +/** + * Represents a V4 content entry in a manifest file. + * + * <p>TrackedFile is the V4 equivalent of ContentFile. It provides a unified representation for all + * entry types in a V4 manifest: data files, delete files, manifests, and deletion vectors. + * + * @param <F> the concrete class of a TrackedFile instance + */ +public interface TrackedFile<F> { Review Comment: I don't think there's much value in parameterizing `TrackedFile` by `F`. The reason why `ContentFile` is parameterized is that we want to share classes between `DataFile` and `DeleteFile`, like `ManifestReader<F extends ContentFile<F>>`. Then we can return `new ManifestReader<>(...)` to produce both `ManifestReader<DataFile>` and `ManifestReader<DeleteFile>`. I think that v4 is going to be different because `TrackedFile` is not a parent of `DeleteFile` and `DataFile`. Instead, `TrackedFile` is used as a generic container for `DataFile`, `DeleteFile`, and `ManifestFile` and the v4 root manifest reader can produce all 3 of those types mixed together. The reader will be a `CloseableIterable<TrackedFile>` rather than `CloseableIterable<F extends TrackedFile<F>>` because `TrackedFile` can produce a `DataFile` via `asDataFile()`. It is not always itself a `DataFile`. To simplify, I think we can drop the type param here and use wrapper classes that call `asDataFile()` or similar. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
