public class SimpleRecordsFetcherFactory extends Object implements RecordsFetcherFactory
| Constructor and Description |
|---|
SimpleRecordsFetcherFactory() |
| Modifier and Type | Method and Description |
|---|---|
GetRecordsCache |
createRecordsFetcher(GetRecordsRetrievalStrategy getRecordsRetrievalStrategy,
String shardId,
IMetricsFactory metricsFactory,
int maxRecords)
Returns a GetRecordsCache to be used for retrieving records for a given shard.
|
void |
setDataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy)
Sets the dataFetchingStrategy to determine the type of GetRecordsCache to be used.
|
void |
setIdleMillisBetweenCalls(long idleMillisBetweenCalls)
Sets the maximum idle time between two get calls.
|
void |
setMaxByteSize(int maxByteSize)
Sets the max byte size for the GetRecordsCache, before further requests are blocked.
|
void |
setMaxPendingProcessRecordsInput(int maxPendingProcessRecordsInput)
Sets the maximum number of ProcessRecordsInput objects the GetRecordsCache can hold, before further requests are
blocked.
|
void |
setMaxRecordsCount(int maxRecordsCount)
Sets the max number of records for the GetRecordsCache can hold, before further requests are blocked.
|
public GetRecordsCache createRecordsFetcher(GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, String shardId, IMetricsFactory metricsFactory, int maxRecords)
RecordsFetcherFactorycreateRecordsFetcher in interface RecordsFetcherFactorygetRecordsRetrievalStrategy - GetRecordsRetrievalStrategy to be used with the GetRecordsCacheshardId - 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 setMaxPendingProcessRecordsInput(int maxPendingProcessRecordsInput)
RecordsFetcherFactorysetMaxPendingProcessRecordsInput in interface RecordsFetcherFactorymaxPendingProcessRecordsInput - The maximum number of ProcessRecordsInput objects that the cache will accept
before blocking.public void setMaxByteSize(int maxByteSize)
RecordsFetcherFactorysetMaxByteSize in interface RecordsFetcherFactorymaxByteSize - The maximum byte size for the cache before blocking.public void setMaxRecordsCount(int maxRecordsCount)
RecordsFetcherFactorysetMaxRecordsCount in interface RecordsFetcherFactorymaxRecordsCount - The mximum number of records in the cache before blocking.public void setDataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy)
RecordsFetcherFactorysetDataFetchingStrategy in interface RecordsFetcherFactorydataFetchingStrategy - Fetching strategy to be usedpublic void setIdleMillisBetweenCalls(long idleMillisBetweenCalls)
RecordsFetcherFactorysetIdleMillisBetweenCalls in interface RecordsFetcherFactoryidleMillisBetweenCalls - Sleep millis between calls.Copyright © 2023. All rights reserved.