if (!isInitialized) {
throw new IllegalArgumentException("KinesisDataFetcher.getRecords called before initialization.");
}
List<Record> records = null;
GetRecordsResult response = null;
if (nextIterator != null) {
try {
response = kinesisProxy.get(nextIterator, maxRecords);
records = response.getRecords();
nextIterator = response.getNextShardIterator();
} catch (ResourceNotFoundException e) {
LOG.info("Caught ResourceNotFoundException when fetching records for shard " + shardId);
nextIterator = null;
}
if (nextIterator == null) {