Class S3InputFile

java.lang.Object
org.apache.iceberg.aws.s3.S3InputFile
All Implemented Interfaces:
NativelyEncryptedFile, InputFile

public class S3InputFile extends Object implements InputFile, NativelyEncryptedFile
  • Method Details

    • fromLocation

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

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

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

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

      public long getLength()
      Note: this may be stale if file was deleted since metadata is cached for size/existence checks.
      Specified by:
      getLength in interface InputFile
      Returns:
      content length
    • newStream

      public SeekableInputStream newStream()
      Description copied from interface: InputFile
      Opens a new SeekableInputStream for the underlying data file
      Specified by:
      newStream in interface InputFile
      Returns:
      a seekable stream for reading the file
    • nativeCryptoParameters

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

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

      public String location()
    • s3FileIOProperties

      public S3FileIOProperties s3FileIOProperties()
    • metrics

      protected 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