Package org.apache.iceberg
Class ManifestFiles
java.lang.Object
org.apache.iceberg.ManifestFiles
- 
Method SummaryModifier and TypeMethodDescriptionstatic ManifestFiledecode(byte[] manifestData) Decode the binary data into aManifestFile.static voidDrop manifest file cache object for a FileIO if exists.static byte[]encode(ManifestFile manifestFile) Encode theManifestFileto a byte array by using avro encoder.static ManifestReader<DataFile> read(ManifestFile manifest, FileIO io) Returns a newManifestReaderfor aManifestFile.static ManifestReader<DataFile> read(ManifestFile manifest, FileIO io, Map<Integer, PartitionSpec> specsById) Returns a newManifestReaderfor aManifestFile.static ManifestReader<DeleteFile> readDeleteManifest(ManifestFile manifest, FileIO io, Map<Integer, PartitionSpec> specsById) Returns a newManifestReaderfor aManifestFile.static CloseableIterable<String> readPaths(ManifestFile manifest, FileIO io) Returns aCloseableIterableof file paths in theManifestFile.static ManifestWriter<DataFile> write(int formatVersion, PartitionSpec spec, EncryptedOutputFile encryptedOutputFile, Long snapshotId) Create a newManifestWriterfor the given format version.static ManifestWriter<DataFile> write(int formatVersion, PartitionSpec spec, OutputFile outputFile, Long snapshotId) Create a newManifestWriterfor the given format version.static ManifestWriter<DataFile> write(PartitionSpec spec, OutputFile outputFile) Create a newManifestWriter.static ManifestWriter<DeleteFile> writeDeleteManifest(int formatVersion, PartitionSpec spec, EncryptedOutputFile outputFile, Long snapshotId) Create a newManifestWriterfor the given format version.static ManifestWriter<DeleteFile> writeDeleteManifest(int formatVersion, PartitionSpec spec, OutputFile outputFile, Long snapshotId) Create a newManifestWriterfor the given format version.
- 
Method Details- 
dropCacheDrop manifest file cache object for a FileIO if exists.
- 
readPathsReturns aCloseableIterableof file paths in theManifestFile.- Parameters:
- manifest- a ManifestFile
- io- a FileIO
- Returns:
- a manifest reader
 
- 
readReturns a newManifestReaderfor aManifestFile.Note: Callers should use read(ManifestFile, FileIO, Map)to ensure the schema used by filters is the latest table schema. This should be used only when reading a manifest without filters.- Parameters:
- manifest- a ManifestFile
- io- a FileIO
- Returns:
- a manifest reader
 
- 
readpublic static ManifestReader<DataFile> read(ManifestFile manifest, FileIO io, Map<Integer, PartitionSpec> specsById) Returns a newManifestReaderfor aManifestFile.- Parameters:
- manifest- a- ManifestFile
- io- a- FileIO
- specsById- a Map from spec ID to partition spec
- Returns:
- a ManifestReader
 
- 
writeCreate a newManifestWriter.Manifests created by this writer have all entry snapshot IDs set to null. All entries will inherit the snapshot ID that will be assigned to the manifest on commit. - Parameters:
- spec-- PartitionSpecused to produce- DataFilepartition tuples
- outputFile- the destination file location
- Returns:
- a manifest writer
 
- 
writepublic static ManifestWriter<DataFile> write(int formatVersion, PartitionSpec spec, OutputFile outputFile, Long snapshotId) Create a newManifestWriterfor the given format version.- Parameters:
- formatVersion- a target format version
- spec- a- PartitionSpec
- outputFile- an- OutputFilewhere the manifest will be written
- snapshotId- a snapshot ID for the manifest entries, or null for an inherited ID
- Returns:
- a manifest writer
 
- 
writepublic static ManifestWriter<DataFile> write(int formatVersion, PartitionSpec spec, EncryptedOutputFile encryptedOutputFile, Long snapshotId) Create a newManifestWriterfor the given format version.- Parameters:
- formatVersion- a target format version
- spec- a- PartitionSpec
- encryptedOutputFile- an- EncryptedOutputFilewhere the manifest will be written
- snapshotId- a snapshot ID for the manifest entries, or null for an inherited ID
- Returns:
- a manifest writer
 
- 
readDeleteManifestpublic static ManifestReader<DeleteFile> readDeleteManifest(ManifestFile manifest, FileIO io, Map<Integer, PartitionSpec> specsById) Returns a newManifestReaderfor aManifestFile.- Parameters:
- manifest- a- ManifestFile
- io- a- FileIO
- specsById- a Map from spec ID to partition spec
- Returns:
- a ManifestReader
 
- 
writeDeleteManifestpublic static ManifestWriter<DeleteFile> writeDeleteManifest(int formatVersion, PartitionSpec spec, OutputFile outputFile, Long snapshotId) Create a newManifestWriterfor the given format version.- Parameters:
- formatVersion- a target format version
- spec- a- PartitionSpec
- outputFile- an- OutputFilewhere the manifest will be written
- snapshotId- a snapshot ID for the manifest entries, or null for an inherited ID
- Returns:
- a manifest writer
 
- 
writeDeleteManifestpublic static ManifestWriter<DeleteFile> writeDeleteManifest(int formatVersion, PartitionSpec spec, EncryptedOutputFile outputFile, Long snapshotId) Create a newManifestWriterfor the given format version.- Parameters:
- formatVersion- a target format version
- spec- a- PartitionSpec
- outputFile- an- EncryptedOutputFilewhere the manifest will be written
- snapshotId- a snapshot ID for the manifest entries, or null for an inherited ID
- Returns:
- a manifest writer
 
- 
encodeEncode theManifestFileto a byte array by using avro encoder.- Parameters:
- manifestFile- a- ManifestFile, which should always be a- GenericManifestFile.
- Returns:
- the binary data.
- Throws:
- IOException- if encounter any IO error when encoding.
 
- 
decodeDecode the binary data into aManifestFile.- Parameters:
- manifestData- the binary data.
- Returns:
- a ManifestFile. To be precise, it's aGenericManifestFilewhich don't expose to public.
- Throws:
- IOException- if encounter any IO error when decoding.
 
 
-