public class PrefetchRecordsPublisher extends Object implements RecordsPublisher
Constructor and Description |
---|
PrefetchRecordsPublisher(int maxPendingProcessRecordsInput,
int maxByteSize,
int maxRecordsCount,
int maxRecordsPerCall,
GetRecordsRetrievalStrategy getRecordsRetrievalStrategy,
ExecutorService executorService,
long idleMillisBetweenCalls,
MetricsFactory metricsFactory,
String operation,
String shardId)
Constructor for the PrefetchRecordsPublisher.
|
PrefetchRecordsPublisher(int maxPendingProcessRecordsInput,
int maxByteSize,
int maxRecordsCount,
int maxRecordsPerCall,
@NonNull GetRecordsRetrievalStrategy getRecordsRetrievalStrategy,
@NonNull ExecutorService executorService,
long idleMillisBetweenCalls,
@NonNull MetricsFactory metricsFactory,
@NonNull String operation,
@NonNull String shardId,
long awaitTerminationTimeoutMillis)
Constructor for the PrefetchRecordsPublisher.
|
Modifier and Type | Method and Description |
---|---|
RequestDetails |
getLastSuccessfulRequestDetails()
Gets last successful request details.
|
void |
notify(RecordsDeliveryAck recordsDeliveryAck)
Notify the publisher on receipt of a data event.
|
void |
restartFrom(RecordsRetrieved recordsRetrieved)
Restart from the last accepted and processed
|
void |
shutdown()
Shutdowns the publisher.
|
void |
start(ExtendedSequenceNumber extendedSequenceNumber,
InitialPositionInStreamExtended initialPositionInStreamExtended)
Initializes the publisher with where to start processing.
|
void |
subscribe(org.reactivestreams.Subscriber<? super RecordsRetrieved> s) |
public PrefetchRecordsPublisher(int maxPendingProcessRecordsInput, int maxByteSize, int maxRecordsCount, int maxRecordsPerCall, @NonNull @NonNull GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, @NonNull @NonNull ExecutorService executorService, long idleMillisBetweenCalls, @NonNull @NonNull MetricsFactory metricsFactory, @NonNull @NonNull String operation, @NonNull @NonNull String shardId, long awaitTerminationTimeoutMillis)
maxPendingProcessRecordsInput
- Max number of ProcessRecordsInput that can be held in the cache before
blockingmaxByteSize
- Max byte size of the queue before blocking next get records callmaxRecordsCount
- Max number of records in the queue across all ProcessRecordInput objectsmaxRecordsPerCall
- Max records to be returned per callgetRecordsRetrievalStrategy
- Retrieval strategy for the get records callexecutorService
- Executor service for the cacheidleMillisBetweenCalls
- maximum time to wait before dispatching the next get records callawaitTerminationTimeoutMillis
- maximum time to wait for graceful shutdown of executorServicePrefetchRecordsPublisher
public PrefetchRecordsPublisher(int maxPendingProcessRecordsInput, int maxByteSize, int maxRecordsCount, int maxRecordsPerCall, GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, ExecutorService executorService, long idleMillisBetweenCalls, MetricsFactory metricsFactory, String operation, String shardId)
maxPendingProcessRecordsInput
- Max number of ProcessRecordsInput that can be held in the cache before
blockingmaxByteSize
- Max byte size of the queue before blocking next get records callmaxRecordsCount
- Max number of records in the queue across all ProcessRecordInput objectsmaxRecordsPerCall
- Max records to be returned per callgetRecordsRetrievalStrategy
- Retrieval strategy for the get records callexecutorService
- Executor service for the cacheidleMillisBetweenCalls
- maximum time to wait before dispatching the next get records callPrefetchRecordsPublisher
public void start(ExtendedSequenceNumber extendedSequenceNumber, InitialPositionInStreamExtended initialPositionInStreamExtended)
RecordsPublisher
start
in interface RecordsPublisher
extendedSequenceNumber
- the sequence number to start processing frominitialPositionInStreamExtended
- if there is no sequence number the initial position to usepublic void shutdown()
RecordsPublisher
shutdown
in interface RecordsPublisher
public RequestDetails getLastSuccessfulRequestDetails()
RecordsPublisher
getLastSuccessfulRequestDetails
in interface RecordsPublisher
public void restartFrom(RecordsRetrieved recordsRetrieved)
RecordsPublisher
restartFrom
in interface RecordsPublisher
recordsRetrieved
- the processRecordsInput to restart frompublic void subscribe(org.reactivestreams.Subscriber<? super RecordsRetrieved> s)
subscribe
in interface org.reactivestreams.Publisher<RecordsRetrieved>
public void notify(RecordsDeliveryAck recordsDeliveryAck)
RecordsPublisher
notify
in interface RecordsPublisher
recordsDeliveryAck
- acknowledgement received from the subscriber.Copyright © 2022. All rights reserved.