Package org.apache.iceberg
Class RollingManifestWriter<F extends ContentFile<F>>
java.lang.Object
org.apache.iceberg.RollingManifestWriter<F>
- All Implemented Interfaces:
Closeable
,AutoCloseable
As opposed to
ManifestWriter
, a rolling writer could produce multiple manifest files.-
Constructor Summary
ConstructorDescriptionRollingManifestWriter
(Supplier<ManifestWriter<F>> manifestWriterSupplier, long targetFileSizeInBytes) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an added entry for a file.void
Add an added entry for a file with a specific sequence number.void
close()
void
Add a delete entry for a file.void
Add an existing entry for a file.
-
Constructor Details
-
RollingManifestWriter
public RollingManifestWriter(Supplier<ManifestWriter<F>> manifestWriterSupplier, long targetFileSizeInBytes)
-
-
Method Details
-
add
Add an added entry for a file.The entry's snapshot ID will be this manifest's snapshot ID. The data and file sequence numbers will be assigned at commit.
- Parameters:
addedFile
- a data file
-
add
Add an added entry for a file with a specific sequence number.The entry's snapshot ID will be this manifest's snapshot ID. The entry's data sequence number will be the provided data sequence number. The entry's file sequence number will be assigned at commit.
- Parameters:
addedFile
- a data filedataSequenceNumber
- a data sequence number for the file
-
existing
public void existing(F existingFile, long fileSnapshotId, long dataSequenceNumber, Long fileSequenceNumber) Add an existing entry for a file.The original data and file sequence numbers, snapshot ID, which were assigned at commit, must be preserved when adding an existing entry.
- Parameters:
existingFile
- a filefileSnapshotId
- snapshot ID when the data file was added to the tabledataSequenceNumber
- a data sequence number of the file (assigned when the file was added)fileSequenceNumber
- a file sequence number (assigned when the file was added)
-
delete
Add a delete entry for a file.The entry's snapshot ID will be this manifest's snapshot ID. However, the original data and file sequence numbers of the file must be preserved when the file is marked as deleted.
- Parameters:
deletedFile
- a filedataSequenceNumber
- a data sequence number of the file (assigned when the file was added)fileSequenceNumber
- a file sequence number (assigned when the file was added)
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
toManifestFiles
-