Class S3OutputFile

java.lang.Object
org.apache.iceberg.aws.s3.S3OutputFile
All Implemented Interfaces:
org.apache.iceberg.encryption.NativelyEncryptedFile, org.apache.iceberg.io.OutputFile

public class S3OutputFile extends Object implements org.apache.iceberg.io.OutputFile, org.apache.iceberg.encryption.NativelyEncryptedFile
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.iceberg.io.PositionOutputStream
    Create an output stream for the specified location if the target object does not exist in S3 at the time of invocation.
    org.apache.iceberg.io.PositionOutputStream
     
    boolean
    Note: this may be stale if file was deleted since metadata is cached for size/existence checks.
    fromLocation(String location, software.amazon.awssdk.services.s3.S3Client client, S3FileIOProperties s3FileIOProperties, org.apache.iceberg.metrics.MetricsContext metrics)
    Deprecated.
    since 1.10.0, will be removed in 1.11.0; use fromLocation(String, PrefixedS3Client, MetricsContext) instead.
    fromLocation(String location, software.amazon.awssdk.services.s3.S3Client client, software.amazon.awssdk.services.s3.S3AsyncClient asyncClient, S3FileIOProperties s3FileIOProperties, org.apache.iceberg.metrics.MetricsContext metrics)
    Deprecated.
    since 1.10.0, will be removed in 1.11.0; use fromLocation(String, PrefixedS3Client, MetricsContext) instead.
    protected software.amazon.awssdk.services.s3.model.HeadObjectResponse
     
     
    protected org.apache.iceberg.metrics.MetricsContext
     
    org.apache.iceberg.encryption.NativeFileCryptoParameters
     
     
    void
    setNativeCryptoParameters(org.apache.iceberg.encryption.NativeFileCryptoParameters nativeCryptoParameters)
     
    org.apache.iceberg.io.InputFile
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.iceberg.io.OutputFile

    location
  • Method Details

    • fromLocation

      @Deprecated public static S3OutputFile fromLocation(String location, software.amazon.awssdk.services.s3.S3Client client, S3FileIOProperties s3FileIOProperties, org.apache.iceberg.metrics.MetricsContext metrics)
      Deprecated.
      since 1.10.0, will be removed in 1.11.0; use fromLocation(String, PrefixedS3Client, MetricsContext) instead.
      Creates a S3OutputFile from the given parameters.
    • fromLocation

      @Deprecated public static S3OutputFile fromLocation(String location, software.amazon.awssdk.services.s3.S3Client client, software.amazon.awssdk.services.s3.S3AsyncClient asyncClient, S3FileIOProperties s3FileIOProperties, org.apache.iceberg.metrics.MetricsContext metrics)
      Deprecated.
      since 1.10.0, will be removed in 1.11.0; use fromLocation(String, PrefixedS3Client, MetricsContext) instead.
      Creates a S3OutputFile from the given parameters.
    • create

      public org.apache.iceberg.io.PositionOutputStream create()
      Create an output stream for the specified location if the target object does not exist in S3 at the time of invocation.
      Specified by:
      create in interface org.apache.iceberg.io.OutputFile
      Returns:
      output stream
    • createOrOverwrite

      public org.apache.iceberg.io.PositionOutputStream createOrOverwrite()
      Specified by:
      createOrOverwrite in interface org.apache.iceberg.io.OutputFile
    • toInputFile

      public org.apache.iceberg.io.InputFile toInputFile()
      Specified by:
      toInputFile in interface org.apache.iceberg.io.OutputFile
    • nativeCryptoParameters

      public org.apache.iceberg.encryption.NativeFileCryptoParameters nativeCryptoParameters()
      Specified by:
      nativeCryptoParameters in interface org.apache.iceberg.encryption.NativelyEncryptedFile
    • setNativeCryptoParameters

      public void setNativeCryptoParameters(org.apache.iceberg.encryption.NativeFileCryptoParameters nativeCryptoParameters)
      Specified by:
      setNativeCryptoParameters in interface org.apache.iceberg.encryption.NativelyEncryptedFile
    • location

      public String location()
    • s3FileIOProperties

      public S3FileIOProperties s3FileIOProperties()
    • metrics

      protected org.apache.iceberg.metrics.MetricsContext metrics()
    • exists

      public boolean exists()
      Note: this may be stale if file was deleted since metadata is cached for size/existence checks.
      Returns:
      flag
    • getObjectMetadata

      protected software.amazon.awssdk.services.s3.model.HeadObjectResponse getObjectMetadata() throws software.amazon.awssdk.services.s3.model.S3Exception
      Throws:
      software.amazon.awssdk.services.s3.model.S3Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object