public class StaticTableOperations extends java.lang.Object implements TableOperations
Constructor and Description |
---|
StaticTableOperations(java.lang.String metadataFileLocation,
FileIO io)
Creates a StaticTableOperations tied to a specific static version of the TableMetadata
|
Modifier and Type | Method and Description |
---|---|
void |
commit(TableMetadata base,
TableMetadata metadata)
Replace the base table metadata with a new version.
|
TableMetadata |
current()
Return the currently loaded table metadata, without checking for updates.
|
FileIO |
io()
Returns a
FileIO to read and write table data and metadata files. |
LocationProvider |
locationProvider()
Returns a
LocationProvider that supplies locations for new new data files. |
java.lang.String |
metadataFileLocation(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.
|
TableMetadata |
refresh()
Return the current table metadata after checking for updates.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encryption, newSnapshotId, temp
public StaticTableOperations(java.lang.String metadataFileLocation, FileIO io)
public TableMetadata current()
TableOperations
current
in interface TableOperations
public TableMetadata refresh()
TableOperations
refresh
in interface TableOperations
public void commit(TableMetadata base, TableMetadata metadata)
TableOperations
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.
commit
in interface TableOperations
base
- table metadata on which changes were basedmetadata
- new table metadata with updatespublic FileIO io()
TableOperations
FileIO
to read and write table data and metadata files.io
in interface TableOperations
public java.lang.String metadataFileLocation(java.lang.String fileName)
TableOperations
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)
.
metadataFileLocation
in interface TableOperations
public LocationProvider locationProvider()
TableOperations
LocationProvider
that supplies locations for new new data files.locationProvider
in interface TableOperations