Package org.apache.iceberg.hadoop
Class HadoopOutputFile
- java.lang.Object
-
- org.apache.iceberg.hadoop.HadoopOutputFile
-
- All Implemented Interfaces:
NativelyEncryptedFile
,OutputFile
public class HadoopOutputFile extends java.lang.Object implements OutputFile, NativelyEncryptedFile
OutputFile
implementation using the HadoopFileSystem
API.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PositionOutputStream
create()
Create a new file and return aPositionOutputStream
to it.PositionOutputStream
createOrOverwrite()
Create a new file and return aPositionOutputStream
to it.static OutputFile
fromLocation(java.lang.CharSequence location, org.apache.hadoop.conf.Configuration conf)
static OutputFile
fromLocation(java.lang.CharSequence location, org.apache.hadoop.fs.FileSystem fs)
static OutputFile
fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf)
static OutputFile
fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs)
static OutputFile
fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
org.apache.hadoop.conf.Configuration
getConf()
org.apache.hadoop.fs.FileSystem
getFileSystem()
org.apache.hadoop.fs.Path
getPath()
java.lang.String
location()
Return the location this output file will create.NativeFileCryptoParameters
nativeCryptoParameters()
void
setNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters)
InputFile
toInputFile()
Return anInputFile
for the location of this output file.java.lang.String
toString()
-
-
-
Method Detail
-
fromLocation
public static OutputFile fromLocation(java.lang.CharSequence location, org.apache.hadoop.conf.Configuration conf)
-
fromLocation
public static OutputFile fromLocation(java.lang.CharSequence location, org.apache.hadoop.fs.FileSystem fs)
-
fromPath
public static OutputFile fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf)
-
fromPath
public static OutputFile fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs)
-
fromPath
public static OutputFile fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
-
create
public PositionOutputStream create()
Description copied from interface:OutputFile
Create a new file and return aPositionOutputStream
to it.If the file already exists, this will throw an exception.
- Specified by:
create
in interfaceOutputFile
- Returns:
- an output stream that can report its position
-
createOrOverwrite
public PositionOutputStream createOrOverwrite()
Description copied from interface:OutputFile
Create a new file and return aPositionOutputStream
to it.If the file already exists, this will not throw an exception and will replace the file.
- Specified by:
createOrOverwrite
in interfaceOutputFile
- Returns:
- an output stream that can report its position
-
getPath
public org.apache.hadoop.fs.Path getPath()
-
getConf
public org.apache.hadoop.conf.Configuration getConf()
-
getFileSystem
public org.apache.hadoop.fs.FileSystem getFileSystem()
-
location
public java.lang.String location()
Description copied from interface:OutputFile
Return the location this output file will create.- Specified by:
location
in interfaceOutputFile
- Returns:
- the location of this output file
-
toInputFile
public InputFile toInputFile()
Description copied from interface:OutputFile
Return anInputFile
for the location of this output file.- Specified by:
toInputFile
in interfaceOutputFile
- Returns:
- an input file for the location of this output file
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
nativeCryptoParameters
public NativeFileCryptoParameters nativeCryptoParameters()
- Specified by:
nativeCryptoParameters
in interfaceNativelyEncryptedFile
-
setNativeCryptoParameters
public void setNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters)
- Specified by:
setNativeCryptoParameters
in interfaceNativelyEncryptedFile
-
-