F
- type of the result futureB
- type of the batch objectR
- type of the recordpublic abstract class Reader<F extends CompletableFuture,B,R> extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
objectName |
Constructor and Description |
---|
Reader(String objectName,
Function<B,Integer> toNextIndexFn,
Function<B,List<R>> toRecordSetFn)
Creates a reader for a map/cache
|
Modifier and Type | Method and Description |
---|---|
abstract F |
readBatch(int partitionId,
int offset)
Read a batch from a partition with given offset
|
B |
toBatchResult(F future)
Transform the future returned from
readBatch(int, int) to a batch |
int |
toNextIndex(B result)
Return the index that follows current batch
|
abstract Object |
toObject(R record)
Transform a record to an object
|
List<R> |
toRecordSet(B result)
Transforms batch result to a list of records
|
protected final String objectName
@Nonnull public abstract F readBatch(int partitionId, int offset)
partitionId
- id of the partitionoffset
- offset to read@Nonnull public B toBatchResult(@Nonnull F future) throws ExecutionException, InterruptedException
readBatch(int, int)
to a batchpublic final int toNextIndex(@Nonnull B result)
@Nonnull public final List<R> toRecordSet(@Nonnull B result)
Copyright © 2024 Hazelcast, Inc.. All rights reserved.