Class StaticTableOperations
- java.lang.Object
- 
- org.apache.iceberg.StaticTableOperations
 
- 
- All Implemented Interfaces:
- TableOperations
 
 public class StaticTableOperations extends java.lang.Object implements TableOperations TableOperations implementation that provides access to metadata for a Table at some point in time, using a table metadata location. It will never refer to a different Metadata object than the one it was created with and cannot be used to create or delete files.
- 
- 
Constructor SummaryConstructors Constructor Description StaticTableOperations(java.lang.String metadataFileLocation, FileIO io)Creates a StaticTableOperations tied to a specific static version of the TableMetadataStaticTableOperations(java.lang.String metadataFileLocation, FileIO io, LocationProvider locationProvider)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit(TableMetadata base, TableMetadata metadata)Replace the base table metadata with a new version.TableMetadatacurrent()Return the currently loaded table metadata, without checking for updates.FileIOio()Returns aFileIOto read and write table data and metadata files.LocationProviderlocationProvider()Returns aLocationProviderthat supplies locations for new new data files.java.lang.StringmetadataFileLocation(java.lang.String fileName)Given the name of a metadata file, obtain the full path of that file using an appropriate base location of the implementation's choosing.TableMetadatarefresh()StaticTableOperations works on the same version of TableMetadata, and it will never refer a different TableMetadata object than the one it was created with.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.iceberg.TableOperationsencryption, newSnapshotId, temp
 
- 
 
- 
- 
- 
Constructor Detail- 
StaticTableOperationspublic StaticTableOperations(java.lang.String metadataFileLocation, FileIO io)Creates a StaticTableOperations tied to a specific static version of the TableMetadata
 - 
StaticTableOperationspublic StaticTableOperations(java.lang.String metadataFileLocation, FileIO io, LocationProvider locationProvider)
 
- 
 - 
Method Detail- 
currentpublic TableMetadata current() Description copied from interface:TableOperationsReturn the currently loaded table metadata, without checking for updates.- Specified by:
- currentin interface- TableOperations
- Returns:
- table metadata
 
 - 
refreshpublic TableMetadata refresh() StaticTableOperations works on the same version of TableMetadata, and it will never refer a different TableMetadata object than the one it was created with.- Specified by:
- refreshin interface- TableOperations
- Returns:
- always current().
 
 - 
commitpublic void commit(TableMetadata base, TableMetadata metadata) Description copied from interface:TableOperationsReplace the base table metadata with a new version.This method should implement and document atomicity guarantees. Implementations must check that the base metadata is current to avoid overwriting updates. Once the atomic commit operation succeeds, implementations must not perform any operations that may fail because failure in this method cannot be distinguished from commit failure. Implementations must throw a CommitStateUnknownExceptionin cases where it cannot be determined if the commit succeeded or failed. For example if a network partition causes the confirmation of the commit to be lost, the implementation should throw a CommitStateUnknownException. This is important because downstream users of this API need to know whether they can clean up the commit or not, if the state is unknown then it is not safe to remove any files. All other exceptions will be treated as if the commit has failed.- Specified by:
- commitin interface- TableOperations
- Parameters:
- base- table metadata on which changes were based
- metadata- new table metadata with updates
 
 - 
iopublic FileIO io() Description copied from interface:TableOperationsReturns aFileIOto read and write table data and metadata files.- Specified by:
- ioin interface- TableOperations
 
 - 
metadataFileLocationpublic java.lang.String metadataFileLocation(java.lang.String fileName) Description copied from interface:TableOperationsGiven the name of a metadata file, obtain the full path of that file using an appropriate base location of the implementation's choosing.The file may not exist yet, in which case the path should be returned as if it were to be created by e.g. FileIO.newOutputFile(String).- Specified by:
- metadataFileLocationin interface- TableOperations
 
 - 
locationProviderpublic LocationProvider locationProvider() Description copied from interface:TableOperationsReturns aLocationProviderthat supplies locations for new new data files.- Specified by:
- locationProviderin interface- TableOperations
- Returns:
- a location provider configured for the current table state
 
 
- 
 
-