Package org.apache.iceberg
Class TableMetadata
- java.lang.Object
-
- org.apache.iceberg.TableMetadata
-
- All Implemented Interfaces:
java.io.Serializable
public class TableMetadata extends java.lang.Object implements java.io.SerializableMetadata for a table.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTableMetadata.MetadataLogEntrystatic classTableMetadata.SnapshotLogEntry
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TableMetadataaddStagedSnapshot(Snapshot snapshot)TableMetadatabuildReplacement(Schema updatedSchema, PartitionSpec updatedPartitionSpec, java.lang.String newLocation, java.util.Map<java.lang.String,java.lang.String> updatedProperties)SnapshotcurrentSnapshot()intdefaultSpecId()intformatVersion()intlastColumnId()longlastSequenceNumber()longlastUpdatedMillis()java.lang.Stringlocation()java.lang.StringmetadataFileLocation()static TableMetadatanewTableMetadata(Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)static TableMetadatanewTableMetadata(TableOperations ops, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)Deprecated.will be removed in 0.9.0; use newTableMetadata(Schema, PartitionSpec, String, Map) instead.longnextSequenceNumber()java.util.List<TableMetadata.MetadataLogEntry>previousFiles()java.util.Map<java.lang.String,java.lang.String>properties()java.lang.Stringproperty(java.lang.String property, java.lang.String defaultValue)booleanpropertyAsBoolean(java.lang.String property, boolean defaultValue)intpropertyAsInt(java.lang.String property, int defaultValue)longpropertyAsLong(java.lang.String property, long defaultValue)TableMetadataremoveSnapshotLogEntries(java.util.Set<java.lang.Long> snapshotIds)TableMetadataremoveSnapshotsIf(java.util.function.Predicate<Snapshot> removeIf)TableMetadatareplaceCurrentSnapshot(Snapshot snapshot)TableMetadatareplaceProperties(java.util.Map<java.lang.String,java.lang.String> newProperties)Schemaschema()Snapshotsnapshot(long snapshotId)java.util.List<HistoryEntry>snapshotLog()java.util.List<Snapshot>snapshots()PartitionSpecspec()PartitionSpecspec(int id)java.util.List<PartitionSpec>specs()java.util.Map<java.lang.Integer,PartitionSpec>specsById()TableMetadataupdateLocation(java.lang.String newLocation)TableMetadataupdatePartitionSpec(PartitionSpec newPartitionSpec)TableMetadataupdateSchema(Schema newSchema, int newLastColumnId)TableMetadataupgradeToFormatVersion(int newFormatVersion)java.lang.Stringuuid()TableMetadatawithUUID()
-
-
-
Method Detail
-
newTableMetadata
@Deprecated public static TableMetadata newTableMetadata(TableOperations ops, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
Deprecated.will be removed in 0.9.0; use newTableMetadata(Schema, PartitionSpec, String, Map) instead.
-
newTableMetadata
public static TableMetadata newTableMetadata(Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
-
formatVersion
public int formatVersion()
-
metadataFileLocation
public java.lang.String metadataFileLocation()
-
uuid
public java.lang.String uuid()
-
lastSequenceNumber
public long lastSequenceNumber()
-
nextSequenceNumber
public long nextSequenceNumber()
-
lastUpdatedMillis
public long lastUpdatedMillis()
-
lastColumnId
public int lastColumnId()
-
schema
public Schema schema()
-
spec
public PartitionSpec spec()
-
spec
public PartitionSpec spec(int id)
-
specs
public java.util.List<PartitionSpec> specs()
-
specsById
public java.util.Map<java.lang.Integer,PartitionSpec> specsById()
-
defaultSpecId
public int defaultSpecId()
-
location
public java.lang.String location()
-
properties
public java.util.Map<java.lang.String,java.lang.String> properties()
-
property
public java.lang.String property(java.lang.String property, java.lang.String defaultValue)
-
propertyAsBoolean
public boolean propertyAsBoolean(java.lang.String property, boolean defaultValue)
-
propertyAsInt
public int propertyAsInt(java.lang.String property, int defaultValue)
-
propertyAsLong
public long propertyAsLong(java.lang.String property, long defaultValue)
-
snapshot
public Snapshot snapshot(long snapshotId)
-
currentSnapshot
public Snapshot currentSnapshot()
-
snapshots
public java.util.List<Snapshot> snapshots()
-
snapshotLog
public java.util.List<HistoryEntry> snapshotLog()
-
previousFiles
public java.util.List<TableMetadata.MetadataLogEntry> previousFiles()
-
withUUID
public TableMetadata withUUID()
-
updateSchema
public TableMetadata updateSchema(Schema newSchema, int newLastColumnId)
-
updatePartitionSpec
public TableMetadata updatePartitionSpec(PartitionSpec newPartitionSpec)
-
addStagedSnapshot
public TableMetadata addStagedSnapshot(Snapshot snapshot)
-
replaceCurrentSnapshot
public TableMetadata replaceCurrentSnapshot(Snapshot snapshot)
-
removeSnapshotsIf
public TableMetadata removeSnapshotsIf(java.util.function.Predicate<Snapshot> removeIf)
-
replaceProperties
public TableMetadata replaceProperties(java.util.Map<java.lang.String,java.lang.String> newProperties)
-
removeSnapshotLogEntries
public TableMetadata removeSnapshotLogEntries(java.util.Set<java.lang.Long> snapshotIds)
-
buildReplacement
public TableMetadata buildReplacement(Schema updatedSchema, PartitionSpec updatedPartitionSpec, java.lang.String newLocation, java.util.Map<java.lang.String,java.lang.String> updatedProperties)
-
updateLocation
public TableMetadata updateLocation(java.lang.String newLocation)
-
upgradeToFormatVersion
public TableMetadata upgradeToFormatVersion(int newFormatVersion)
-
-