/** * @param dataFetchingStrategy The strategy for fetching data from kinesis. * @return KinesisClientLibConfiguration */ public KinesisClientLibConfiguration withDataFetchingStrategy(String dataFetchingStrategy) { this.recordsFetcherFactory.setDataFetchingStrategy(DataFetchingStrategy.valueOf(dataFetchingStrategy.toUpperCase())); return this; }
/** * @param idleMillisBetweenCalls Idle time between 2 getcalls from the data fetcher. * @return KinesisClientLibConfiguration */ public KinesisClientLibConfiguration withIdleMillisBetweenCalls(long idleMillisBetweenCalls) { checkIsValuePositive("IdleMillisBetweenCalls", idleMillisBetweenCalls); this.recordsFetcherFactory.setIdleMillisBetweenCalls(idleMillisBetweenCalls); return this; }
/** * @param maxCacheByteSize Max byte size for the cache at any given point of time. After this threshold is crossed * the KinesisDataFetcher will be blocked until the cache has more space available. * @return KinesisClientLibConfiguration */ public KinesisClientLibConfiguration withMaxCacheByteSize(final int maxCacheByteSize) { checkIsValuePositive("maxCacheByteSize", maxCacheByteSize); this.recordsFetcherFactory.setMaxByteSize(maxCacheByteSize); return this; }
/** * * @param maxPendingProcessRecordsInput The max number of ProcessRecordsInput that can be stored in the cache before * blocking * @return this configuration object */ public KinesisClientLibConfiguration withMaxPendingProcessRecordsInput(final int maxPendingProcessRecordsInput) { checkIsValuePositive("maxPendingProcessRecordsInput", maxPendingProcessRecordsInput); this.recordsFetcherFactory.setMaxPendingProcessRecordsInput(maxPendingProcessRecordsInput); return this; }
/** * @param maxRecordsCount The maximum number of records in the cache, accross all ProcessRecordInput objects * @return KinesisClientLibConfiguration */ public KinesisClientLibConfiguration withMaxRecordsCount(final int maxRecordsCount) { checkIsValuePositive("maxRecordsCount", maxRecordsCount); this.recordsFetcherFactory.setMaxRecordsCount(maxRecordsCount); return this; }
this.config = config; this.dataFetcher = kinesisDataFetcher; this.getRecordsCache = config.getRecordsFetcherFactory().createRecordsFetcher( makeStrategy(this.dataFetcher, retryGetRecordsInSeconds, maxGetRecordsThreadPool, this.shardInfo), this.getShardInfo().getShardId(), this.metricsFactory, this.config.getMaxRecords());