CloudStorage

class CloudStorage(projectId: String, bucket: String, prefix: Path, coroutineContext: CoroutineContext = Dispatchers.IO) : ObjectStore

Used to set configuration options for a Google Cloud Storage Object Store, which can be used as implementation of an object store.

Requires at least projectId and a bucket to be provided - these will need to be accessible to whichever authentication credentials you use. Authentication is handled via Google’s "Application Default Credentials" - see the relevant documentation to get set up. You will need to set up authentication using any of the methods listed within the documentation to be able to make use of the operations inside the modules.

For more info on setting up the necessary infrastructure on Google Cloud to be able to use Google Cloud Storage as an XTDB object store, see the section on setting up the Google Cloud Deployment Manager Configuration within our Google Cloud docs.

Example usage, as part of a node config:

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

Constructors

Link copied to clipboard
constructor(projectId: String, bucket: String, prefix: Path, coroutineContext: CoroutineContext = Dispatchers.IO)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@Serializable
@SerialName(value = "!GoogleCloud")
data class Factory(val projectId: String, val bucket: String, var prefix: Path? = null, 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 fun getObject(k: Path, outPath: Path): CompletableFuture<Path>
open override fun getObject(k: Path): CompletableFuture<ByteBuffer?>
Link copied to clipboard
open override fun listAfter(dir: Path, afterKey: Path): Iterable<ObjectStore.StoredObject>
Link copied to clipboard
Link copied to clipboard
open override fun putObject(k: Path, buf: ByteBuffer): CompletableFuture<Unit>