Package org.apache.iceberg.aws.s3
Class S3OutputFile
java.lang.Object
org.apache.iceberg.aws.s3.S3OutputFile
- All Implemented Interfaces:
NativelyEncryptedFile
,OutputFile
-
Method Summary
Modifier 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 aPositionOutputStream
to it.boolean
exists()
Note: this may be stale if file was deleted since metadata is cached for size/existence checks.static S3OutputFile
fromLocation
(String location, software.amazon.awssdk.services.s3.S3Client client, S3FileIOProperties s3FileIOProperties, MetricsContext metrics) protected software.amazon.awssdk.services.s3.model.HeadObjectResponse
location()
protected MetricsContext
metrics()
void
setNativeCryptoParameters
(NativeFileCryptoParameters nativeCryptoParameters) Return anInputFile
for the location of this output file.toString()
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
public static S3OutputFile fromLocation(String location, software.amazon.awssdk.services.s3.S3Client client, S3FileIOProperties s3FileIOProperties, MetricsContext metrics) -
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 interfaceOutputFile
- Returns:
- output stream
-
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
-
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
-
nativeCryptoParameters
- Specified by:
nativeCryptoParameters
in interfaceNativelyEncryptedFile
-
setNativeCryptoParameters
- Specified by:
setNativeCryptoParameters
in interfaceNativelyEncryptedFile
-
location
-
s3FileIOProperties
-
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
-