Package org.apache.iceberg.view
Class HadoopViewOperations
- java.lang.Object
-
- org.apache.iceberg.view.HadoopViewOperations
-
- All Implemented Interfaces:
ViewOperations
public class HadoopViewOperations extends Object implements ViewOperations
The Views implementation Based on FileIO.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHadoopViewOperations(org.apache.hadoop.fs.Path location, org.apache.hadoop.conf.Configuration conf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit(ViewVersionMetadata base, ViewVersionMetadata metadata, Map<String,String> properties)Replace the base metadata with a new version.ViewVersionMetadatacurrent()Return the currently loaded view metadata, without checking for updates.voiddrop(String location)Drops the view specified by the 'viewIdentifier' parameter.static org.apache.hadoop.fs.FileSystemgetFS(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf)org.apache.iceberg.io.FileIOio()AFileIOto read and write table data and metadata files.ViewVersionMetadatarefresh()Return the current view metadata after checking for updates.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.iceberg.view.ViewOperations
extraProperties
-
-
-
-
Method Detail
-
current
public ViewVersionMetadata current()
Description copied from interface:ViewOperationsReturn the currently loaded view metadata, without checking for updates.- Specified by:
currentin interfaceViewOperations- Returns:
- view version metadata
-
refresh
public ViewVersionMetadata refresh()
Description copied from interface:ViewOperationsReturn the current view metadata after checking for updates.- Specified by:
refreshin interfaceViewOperations- Returns:
- view version metadata
-
io
public org.apache.iceberg.io.FileIO io()
Description copied from interface:ViewOperationsAFileIOto read and write table data and metadata files.- Specified by:
ioin interfaceViewOperations- Returns:
- a
FileIOto read and write table data and metadata files
-
commit
public void commit(ViewVersionMetadata base, ViewVersionMetadata metadata, Map<String,String> properties)
Description copied from interface:ViewOperationsReplace the base 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.
- Specified by:
commitin interfaceViewOperations- Parameters:
base- view metadata on which changes were basedmetadata- new view metadata with updatesproperties- Version property genie-id of the operation, as well as table properties such as owner, table type, common view flag etc.
-
drop
public void drop(String location)
Description copied from interface:ViewOperationsDrops the view specified by the 'viewIdentifier' parameter. Used only by the test infrastructure such as HadoopViewOperations and TestViews. Metacat views are dropped using direct hive 'drop' object calls.- Specified by:
dropin interfaceViewOperations- Parameters:
location- specifies the name/location of the view.
-
getFS
public static org.apache.hadoop.fs.FileSystem getFS(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf)
-
-