Class HadoopOutputFile

java.lang.Object
org.apache.iceberg.hadoop.HadoopOutputFile
All Implemented Interfaces:
NativelyEncryptedFile, OutputFile

public class HadoopOutputFile extends Object implements OutputFile, NativelyEncryptedFile
OutputFile implementation using the Hadoop FileSystem API.
  • Method Details

    • fromLocation

      public static OutputFile fromLocation(CharSequence location, org.apache.hadoop.conf.Configuration conf)
    • fromLocation

      public static OutputFile fromLocation(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 a PositionOutputStream to it.

      If the file already exists, this will throw an exception.

      Specified by:
      create in interface OutputFile
      Returns:
      an output stream that can report its position
    • createOrOverwrite

      public PositionOutputStream createOrOverwrite()
      Description copied from interface: OutputFile
      Create a new file and return a PositionOutputStream to it.

      If the file already exists, this will not throw an exception and will replace the file.

      Specified by:
      createOrOverwrite in interface OutputFile
      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 String location()
      Description copied from interface: OutputFile
      Return the location this output file will create.
      Specified by:
      location in interface OutputFile
      Returns:
      the location of this output file
    • toInputFile

      public InputFile toInputFile()
      Description copied from interface: OutputFile
      Return an InputFile for the location of this output file.
      Specified by:
      toInputFile in interface OutputFile
      Returns:
      an input file for the location of this output file
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • nativeCryptoParameters

      public NativeFileCryptoParameters nativeCryptoParameters()
      Specified by:
      nativeCryptoParameters in interface NativelyEncryptedFile
    • setNativeCryptoParameters

      public void setNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters)
      Specified by:
      setNativeCryptoParameters in interface NativelyEncryptedFile