Package org.apache.iceberg.aws.s3
Class S3OutputFile
java.lang.Object
org.apache.iceberg.aws.s3.S3OutputFile
- All Implemented Interfaces:
- NativelyEncryptedFile,- OutputFile
- 
Method SummaryModifier and TypeMethodDescriptioncreate()Create an output stream for the specified location if the target object does not exist in S3 at the time of invocation.Create a new file and return aPositionOutputStreamto it.booleanexists()Note: this may be stale if file was deleted since metadata is cached for size/existence checks.static S3OutputFilefromLocation(String location, software.amazon.awssdk.services.s3.S3Client client, S3FileIOProperties s3FileIOProperties, MetricsContext metrics) Deprecated.static S3OutputFilefromLocation(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; usefromLocation(String, PrefixedS3Client, MetricsContext)instead.protected software.amazon.awssdk.services.s3.model.HeadObjectResponselocation()protected MetricsContextmetrics()voidsetNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters) Return anInputFilefor the location of this output file.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.iceberg.io.OutputFilelocation
- 
Method Details- 
fromLocation@Deprecated public static S3OutputFile 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; usefromLocation(String, PrefixedS3Client, MetricsContext)instead.Creates aS3OutputFilefrom 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, MetricsContext metrics) Deprecated.since 1.10.0, will be removed in 1.11.0; usefromLocation(String, PrefixedS3Client, MetricsContext)instead.Creates aS3OutputFilefrom the given parameters.
- 
createCreate an output stream for the specified location if the target object does not exist in S3 at the time of invocation.- Specified by:
- createin interface- OutputFile
- Returns:
- output stream
 
- 
createOrOverwriteDescription copied from interface:OutputFileCreate a new file and return aPositionOutputStreamto it.If the file already exists, this will not throw an exception and will replace the file. - Specified by:
- createOrOverwritein interface- OutputFile
- Returns:
- an output stream that can report its position
 
- 
toInputFileDescription copied from interface:OutputFileReturn anInputFilefor the location of this output file.- Specified by:
- toInputFilein interface- OutputFile
- Returns:
- an input file for the location of this output file
 
- 
nativeCryptoParameters- Specified by:
- nativeCryptoParametersin interface- NativelyEncryptedFile
 
- 
setNativeCryptoParameters- Specified by:
- setNativeCryptoParametersin interface- NativelyEncryptedFile
 
- 
location
- 
s3FileIOProperties
- 
metrics
- 
existspublic boolean exists()Note: this may be stale if file was deleted since metadata is cached for size/existence checks.- Returns:
- flag
 
- 
getObjectMetadataprotected 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
 
- 
fromLocation(String, PrefixedS3Client, MetricsContext)instead.