Example usage for com.amazonaws.services.kinesis.model PutRecordsRequest getStreamName

List of usage examples for com.amazonaws.services.kinesis.model PutRecordsRequest getStreamName

Introduction

In this page you can find the example usage for com.amazonaws.services.kinesis.model PutRecordsRequest getStreamName.

Prototype


public String getStreamName() 

Source Link

Document

The stream name associated with the request.

Usage

From source file:com.facebook.presto.kinesis.util.MockKinesisClient.java

License:Apache License

@Override
public PutRecordsResult putRecords(PutRecordsRequest putRecordsRequest)
        throws AmazonServiceException, AmazonClientException {
    // Setup method to add a batch of new records:
    InternalStream theStream = this.getStream(putRecordsRequest.getStreamName());
    if (theStream != null) {
        PutRecordsResult result = new PutRecordsResult();
        ArrayList<PutRecordsResultEntry> resultList = new ArrayList<PutRecordsResultEntry>();
        for (PutRecordsRequestEntry entry : putRecordsRequest.getRecords()) {
            PutRecordResult putResult = theStream.putRecord(entry.getData(), entry.getPartitionKey());
            resultList.add((new PutRecordsResultEntry()).withShardId(putResult.getShardId())
                    .withSequenceNumber(putResult.getSequenceNumber()));
        }/*from w  w w  .j a v  a 2s.c o m*/

        result.setRecords(resultList);
        return result;
    } else {
        throw new AmazonClientException("This stream does not exist!");
    }
}