public class SimpleRecordsFetcherFactory extends Object implements RecordsFetcherFactory
Constructor and Description |
---|
SimpleRecordsFetcherFactory() |
Modifier and Type | Method and Description |
---|---|
RecordsPublisher |
createRecordsFetcher(GetRecordsRetrievalStrategy getRecordsRetrievalStrategy,
String shardId,
MetricsFactory metricsFactory,
int maxRecords)
Returns a RecordsPublisher to be used for retrieving records for a given shard.
|
DataFetchingStrategy |
dataFetchingStrategy() |
void |
dataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy)
Sets the dataFetchingStrategy to determine the type of RecordsPublisher to be used.
|
long |
idleMillisBetweenCalls() |
void |
idleMillisBetweenCalls(long idleMillisBetweenCalls)
Sets the maximum idle time between two get calls.
|
int |
maxByteSize() |
void |
maxByteSize(int maxByteSize)
Sets the max byte size for the RecordsPublisher, before further requests are blocked.
|
int |
maxPendingProcessRecordsInput() |
void |
maxPendingProcessRecordsInput(int maxPendingProcessRecordsInput)
Sets the maximum number of ProcessRecordsInput objects the RecordsPublisher can hold, before further requests are
blocked.
|
int |
maxRecordsCount() |
void |
maxRecordsCount(int maxRecordsCount)
Sets the max number of records for the RecordsPublisher can hold, before further requests are blocked.
|
public RecordsPublisher createRecordsFetcher(GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, String shardId, MetricsFactory metricsFactory, int maxRecords)
RecordsFetcherFactory
createRecordsFetcher
in interface RecordsFetcherFactory
getRecordsRetrievalStrategy
- GetRecordsRetrievalStrategy to be used with the RecordsPublishershardId
- ShardId of the shard that the fetcher will retrieve records formetricsFactory
- MetricsFactory used to create metricScopemaxRecords
- Max number of records to be returned in a single get callpublic void maxPendingProcessRecordsInput(int maxPendingProcessRecordsInput)
RecordsFetcherFactory
maxPendingProcessRecordsInput
in interface RecordsFetcherFactory
maxPendingProcessRecordsInput
- The maximum number of ProcessRecordsInput objects that the cache will accept
before blocking.public void maxByteSize(int maxByteSize)
RecordsFetcherFactory
maxByteSize
in interface RecordsFetcherFactory
maxByteSize
- The maximum byte size for the cache before blocking.public void maxRecordsCount(int maxRecordsCount)
RecordsFetcherFactory
maxRecordsCount
in interface RecordsFetcherFactory
maxRecordsCount
- The mximum number of records in the cache before blocking.public void dataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy)
RecordsFetcherFactory
dataFetchingStrategy
in interface RecordsFetcherFactory
dataFetchingStrategy
- Fetching strategy to be usedpublic void idleMillisBetweenCalls(long idleMillisBetweenCalls)
RecordsFetcherFactory
idleMillisBetweenCalls
in interface RecordsFetcherFactory
idleMillisBetweenCalls
- Sleep millis between calls.public int maxPendingProcessRecordsInput()
maxPendingProcessRecordsInput
in interface RecordsFetcherFactory
public int maxByteSize()
maxByteSize
in interface RecordsFetcherFactory
public int maxRecordsCount()
maxRecordsCount
in interface RecordsFetcherFactory
public DataFetchingStrategy dataFetchingStrategy()
dataFetchingStrategy
in interface RecordsFetcherFactory
public long idleMillisBetweenCalls()
idleMillisBetweenCalls
in interface RecordsFetcherFactory
Copyright © 2022. All rights reserved.