com.amazonaws.services.kinesisfirehose.model.PutRecordBatchResponseEntry Java Examples
The following examples show how to use
com.amazonaws.services.kinesisfirehose.model.PutRecordBatchResponseEntry.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FirehoseTarget.java From datacollector with Apache License 2.0 | 5 votes |
private void flush(List<com.amazonaws.services.kinesisfirehose.model.Record> records, List<Record> sdcRecords) throws StageException { if (records.isEmpty()) { return; } PutRecordBatchRequest batchRequest = new PutRecordBatchRequest() .withDeliveryStreamName(conf.streamName) .withRecords(records); PutRecordBatchResult result = firehoseClient.putRecordBatch(batchRequest); int numFailed = result.getFailedPutCount(); if (numFailed != 0) { List<PutRecordBatchResponseEntry> responses = result.getRequestResponses(); for (int i = 0; i < responses.size(); i++) { PutRecordBatchResponseEntry response = responses.get(i); if (response.getErrorCode() != null) { LOG.error(Errors.KINESIS_05.getMessage(), sdcRecords.get(i), response.getErrorMessage()); errorRecordHandler.onError( new OnRecordErrorException( sdcRecords.get(i), Errors.KINESIS_05, sdcRecords.get(i), response.getErrorMessage() ) ); } } } recordCounter += records.size(); records.clear(); sdcRecords.clear(); }