List of usage examples for com.amazonaws.services.kinesis.model PutRecordsRequestEntry getPartitionKey
public String getPartitionKey()
Determines which shard in the stream the data record is assigned to.
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 . ja va2 s. c om result.setRecords(resultList); return result; } else { throw new AmazonClientException("This stream does not exist!"); } }