public class S3FileIO
extends java.lang.Object
implements org.apache.iceberg.io.FileIO, org.apache.iceberg.io.SupportsBulkOperations, org.apache.iceberg.io.SupportsPrefixOperations, org.apache.iceberg.io.CredentialSupplier
Locations used must follow the conventions for S3 URIs (e.g. s3://bucket/path...).
URIs with schemes s3a, s3n, https are also treated as s3 file paths.
Using this FileIO with other schemes will result in ValidationException.
| Constructor and Description |
|---|
S3FileIO()
No-arg constructor to load the FileIO dynamically.
|
S3FileIO(org.apache.iceberg.util.SerializableSupplier<software.amazon.awssdk.services.s3.S3Client> s3)
Constructor with custom s3 supplier and default AWS properties.
|
S3FileIO(org.apache.iceberg.util.SerializableSupplier<software.amazon.awssdk.services.s3.S3Client> s3,
AwsProperties awsProperties)
Constructor with custom s3 supplier and AWS properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
deleteFile(java.lang.String path) |
void |
deleteFiles(java.lang.Iterable<java.lang.String> paths)
Deletes the given paths in a batched manner.
|
void |
deletePrefix(java.lang.String prefix)
This method provides a "best-effort" to delete all objects under the
given prefix.
|
java.lang.String |
getCredential() |
void |
initialize(java.util.Map<java.lang.String,java.lang.String> props) |
java.lang.Iterable<org.apache.iceberg.io.FileInfo> |
listPrefix(java.lang.String prefix) |
org.apache.iceberg.io.InputFile |
newInputFile(java.lang.String path) |
org.apache.iceberg.io.InputFile |
newInputFile(java.lang.String path,
long length) |
org.apache.iceberg.io.OutputFile |
newOutputFile(java.lang.String path) |
java.util.Map<java.lang.String,java.lang.String> |
properties() |
public S3FileIO()
All fields are initialized by calling initialize(Map) later.
public S3FileIO(org.apache.iceberg.util.SerializableSupplier<software.amazon.awssdk.services.s3.S3Client> s3)
Calling initialize(Map) will overwrite information set in this constructor.
s3 - s3 supplierpublic S3FileIO(org.apache.iceberg.util.SerializableSupplier<software.amazon.awssdk.services.s3.S3Client> s3,
AwsProperties awsProperties)
Calling initialize(Map) will overwrite information set in this constructor.
s3 - s3 supplierawsProperties - aws propertiespublic org.apache.iceberg.io.InputFile newInputFile(java.lang.String path)
newInputFile in interface org.apache.iceberg.io.FileIOpublic org.apache.iceberg.io.InputFile newInputFile(java.lang.String path,
long length)
newInputFile in interface org.apache.iceberg.io.FileIOpublic org.apache.iceberg.io.OutputFile newOutputFile(java.lang.String path)
newOutputFile in interface org.apache.iceberg.io.FileIOpublic void deleteFile(java.lang.String path)
deleteFile in interface org.apache.iceberg.io.FileIOpublic java.util.Map<java.lang.String,java.lang.String> properties()
properties in interface org.apache.iceberg.io.FileIOpublic void deleteFiles(java.lang.Iterable<java.lang.String> paths)
throws org.apache.iceberg.io.BulkDeletionFailureException
The paths are grouped by bucket, and deletion is triggered when we either reach the configured batch size or have a final remainder batch for each bucket.
deleteFiles in interface org.apache.iceberg.io.SupportsBulkOperationspaths - paths to deleteorg.apache.iceberg.io.BulkDeletionFailureExceptionpublic java.lang.Iterable<org.apache.iceberg.io.FileInfo> listPrefix(java.lang.String prefix)
listPrefix in interface org.apache.iceberg.io.SupportsPrefixOperationspublic void deletePrefix(java.lang.String prefix)
deletePrefix in interface org.apache.iceberg.io.SupportsPrefixOperationsprefix - prefix to deletepublic java.lang.String getCredential()
getCredential in interface org.apache.iceberg.io.CredentialSupplierpublic void initialize(java.util.Map<java.lang.String,java.lang.String> props)
initialize in interface org.apache.iceberg.io.FileIOpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface org.apache.iceberg.io.FileIO