use of com.amazonaws.services.kinesis.model.PutRecordRequest in project apex-malhar by apache.
the class AbstractKinesisOutputOperator method processTuple.
public void processTuple(T tuple) {
// Send out single data
try {
if (isBatchProcessing) {
if (putRecordsRequestEntryList.size() == batchSize) {
flushRecords();
logger.debug("flushed {} records.", batchSize);
}
addRecord(tuple);
} else {
Pair<String, V> keyValue = tupleToKeyValue(tuple);
PutRecordRequest requestRecord = new PutRecordRequest();
requestRecord.setStreamName(streamName);
requestRecord.setPartitionKey(keyValue.first);
requestRecord.setData(ByteBuffer.wrap(getRecord(keyValue.second)));
client.putRecord(requestRecord);
}
sendCount++;
} catch (AmazonClientException e) {
throw new RuntimeException(e);
}
}
Aggregations