ObjectLoaderOneShotUploader
@Singleton
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 accept(input: DestinationRecordRaw, state: ObjectLoaderOneShotUploader.State<O, T>): BatchAccumulatorResult<ObjectLoaderOneShotUploader.State<O, T>, ObjectLoaderUploadCompleter.UploadResult<T>>
Link copied to clipboard
open suspend override fun finish(state: ObjectLoaderOneShotUploader.State<O, T>): FinalOutput<ObjectLoaderOneShotUploader.State<O, T>, ObjectLoaderUploadCompleter.UploadResult<T>>