S3

class S3(client: S3AsyncClient, bucket: String, prefix: Path, configurator: S3Configurator, factory: S3.Factory, coroutineContext: CoroutineContext = Dispatchers.IO) : ObjectStore, SupportsMultipart<CompletedPart>

Used to set configuration options for an S3 Object Store, which can be used as implementation of objectStore within a xtdb.api.storage.Storage.RemoteStorageFactory.

Requires at least a bucket - this will need to be accessible to whichever authentication credentials you use. Authentication is handled via the Default AWS Credential Provider Chain. See the AWS documentation on the various methods which you can handle authentication to be able to make use of the operations inside the modules.

For more info on setting up the necessary infrastructure on AWS to be able to use S3 as an XTDB object store, see the section on infrastructure & setting up the AWS Cloudformation Stack within our S3 Module Reference.

Example usage, as part of a node config:

Xtdb.openNode {
remoteStorage(
objectStore = s3(bucket = "xtdb-bucket") {
prefix = Path.of("my/custom/prefix")
},
),
...
}

Constructors

Link copied to clipboard
constructor(client: S3AsyncClient, bucket: String, prefix: Path, configurator: S3Configurator, factory: S3.Factory, coroutineContext: CoroutineContext = Dispatchers.IO)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@Serializable
@SerialName(value = "!S3")
data class Factory(var region: String? = null, val bucket: String, var prefix: Path? = null, var credentials: S3.Companion.BasicCredentials? = null, var endpoint: String? = null, var pathStyleAccessEnabled: Boolean = false, var s3Configurator: S3Configurator = S3Configurator.Default, var coroutineContext: CoroutineContext = Dispatchers.IO) : ObjectStore.Factory

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun copyObject(src: Path, dest: Path): CompletableFuture<Unit>
Link copied to clipboard
open override fun deleteIfExists(k: Path): CompletableFuture<Unit>
Link copied to clipboard
open override fun getObject(k: Path): CompletableFuture<ByteBuffer?>
open override fun getObject(k: Path, outPath: Path): CompletableFuture<Path>
Link copied to clipboard
open override fun listAfter(dir: Path, afterKey: Path): Iterable<ObjectStore.StoredObject>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun putObject(k: Path, buf: ByteBuffer): CompletableFuture<Unit>
Link copied to clipboard
open override fun startMultipart(k: Path): CompletableFuture<IMultipartUpload<CompletedPart>>