public class RollingManifestWriter<F extends ContentFile<F>>
extends java.lang.Object
implements java.io.Closeable
ManifestWriter
, a rolling writer could produce multiple manifest files.Constructor and Description |
---|
RollingManifestWriter(java.util.function.Supplier<ManifestWriter<F>> manifestWriterSupplier,
long targetFileSizeInBytes) |
Modifier and Type | Method and Description |
---|---|
void |
add(F addedFile)
Add an added entry for a file.
|
void |
add(F addedFile,
long dataSequenceNumber)
Add an added entry for a file with a specific sequence number.
|
void |
close() |
void |
delete(F deletedFile,
long dataSequenceNumber,
java.lang.Long fileSequenceNumber)
Add a delete entry for a file.
|
void |
existing(F existingFile,
long fileSnapshotId,
long dataSequenceNumber,
java.lang.Long fileSequenceNumber)
Add an existing entry for a file.
|
java.util.List<ManifestFile> |
toManifestFiles() |
public RollingManifestWriter(java.util.function.Supplier<ManifestWriter<F>> manifestWriterSupplier, long targetFileSizeInBytes)
public void add(F addedFile)
The entry's snapshot ID will be this manifest's snapshot ID. The data and file sequence numbers will be assigned at commit.
addedFile
- a data filepublic void add(F addedFile, long dataSequenceNumber)
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.
addedFile
- a data filedataSequenceNumber
- a data sequence number for the filepublic void existing(F existingFile, long fileSnapshotId, long dataSequenceNumber, java.lang.Long fileSequenceNumber)
The original data and file sequence numbers, snapshot ID, which were assigned at commit, must be preserved when adding an existing entry.
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)public void delete(F deletedFile, long dataSequenceNumber, java.lang.Long fileSequenceNumber)
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.
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)public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.util.List<ManifestFile> toManifestFiles()