Search in sources :

Example 1 with AddTagsToStreamRequest

use of com.amazonaws.services.kinesis.model.AddTagsToStreamRequest in project druid by druid-io.

the class KinesisAdminClient method createStream.

@Override
public void createStream(String streamName, int shardCount, Map<String, String> tags) {
    CreateStreamResult createStreamResult = amazonKinesis.createStream(streamName, shardCount);
    if (createStreamResult.getSdkHttpMetadata().getHttpStatusCode() != 200) {
        throw new ISE("Cannot create stream for integration test");
    }
    if (tags != null && !tags.isEmpty()) {
        AddTagsToStreamRequest addTagsToStreamRequest = new AddTagsToStreamRequest();
        addTagsToStreamRequest.setStreamName(streamName);
        addTagsToStreamRequest.setTags(tags);
        AddTagsToStreamResult addTagsToStreamResult = amazonKinesis.addTagsToStream(addTagsToStreamRequest);
        if (addTagsToStreamResult.getSdkHttpMetadata().getHttpStatusCode() != 200) {
            throw new ISE("Cannot tag stream for integration test");
        }
    }
}
Also used : CreateStreamResult(com.amazonaws.services.kinesis.model.CreateStreamResult) ISE(org.apache.druid.java.util.common.ISE) AddTagsToStreamResult(com.amazonaws.services.kinesis.model.AddTagsToStreamResult) AddTagsToStreamRequest(com.amazonaws.services.kinesis.model.AddTagsToStreamRequest)

Aggregations

AddTagsToStreamRequest (com.amazonaws.services.kinesis.model.AddTagsToStreamRequest)1 AddTagsToStreamResult (com.amazonaws.services.kinesis.model.AddTagsToStreamResult)1 CreateStreamResult (com.amazonaws.services.kinesis.model.CreateStreamResult)1 ISE (org.apache.druid.java.util.common.ISE)1