in src/main/java/com/amazonaws/services/dynamodbv2/streams/connectors/DynamoDBReplicationEmitter.java [430:451]
public void fail(final List<Record> records) {
if (isShutdown) {
if (records.isEmpty()) {
// This is OK (but not expected)
log.warn("Emitter fail method called after shutdown method was called. Continuing because list is empty");
return;
} else {
throw new IllegalStateException("Emitter fail method called after shutdown method was called.");
}
}
for (Record record : records) {
log.error("Could not emit record: " + record);
}
final AmazonCloudWatchAsync cloudwatch = CLOUDWATCH.get();
if (null != cloudwatch) {
final double failed = records.size();
final MetricDatum recordsProcessedFailedDatum = new MetricDatum().withMetricName(RECORDS_FAILED).withValue(failed).withUnit(StandardUnit.Count)
.withTimestamp(new Date());
final PutMetricDataRequest request = new PutMetricDataRequest().withNamespace(applicationName).withMetricData(recordsProcessedFailedDatum);
cloudwatch.putMetricDataAsync(request);
}
}