ObjectLoaderOneShotUploader

@Singleton
@Requires(bean = ObjectLoader::class)
class ObjectLoaderOneShotUploader<O : OutputStream, T : RemoteObject<*>>(partFormatter: ObjectLoaderPartFormatter<O>, partLoader: ObjectLoaderPartLoader<T>, uploadCompleter: ObjectLoaderUploadCompleter<T>, @Named(value = "uploadParallelismForSocket") uploadParallelism: Int) : BatchAccumulator<ObjectLoaderOneShotUploader.State<O, T>, StreamKey, DestinationRecordRaw, ObjectLoaderUploadCompleter.UploadResult<T>>

Wraps the PartFormatter, PartLoader, and UploadCompleter in a single BatchAccumulator.

  • feeds incoming records to the formatter

  • as the formatter produces parts, feeds them to the part loader (in async futures)

  • when the final part is generated, or finish is called, awaits all part uploads, feeding the load results to the completer until the completer completes

  • returns the completer result (which might be sent further downstream if bulk load is enabled)

Ie, Accomplishes "Simplify the Object Storage Path" here: https://docs.google.com/document/d/1pLWrtqGqynfnKs8FzMq64g4-04Fot6LvVU6CVUGHBQI/edit?tab=t.0

Constructors

Link copied to clipboard
constructor(partFormatter: ObjectLoaderPartFormatter<O>, partLoader: ObjectLoaderPartLoader<T>, uploadCompleter: ObjectLoaderUploadCompleter<T>, @Named(value = "uploadParallelismForSocket") uploadParallelism: Int)

Types

Link copied to clipboard
data class State<O : OutputStream, T : RemoteObject<*>>(val formatterState: ObjectLoaderPartFormatter.State<O>, val partLoaderState: ObjectLoaderPartLoader.State<T>, val completerState: ObjectLoaderUploadCompleter.State, val uploads: MutableList<Deferred<ObjectLoaderPartLoader.PartResult<T>>> = mutableListOf()) : AutoCloseable

Functions

Link copied to clipboard
open suspend override fun start(key: StreamKey, part: Int): ObjectLoaderOneShotUploader.State<O, T>