Search in sources :

Example 1 with UpdateShardCountRequest

use of software.amazon.awssdk.services.kinesis.model.UpdateShardCountRequest in project aws-doc-sdk-examples by awsdocs.

the class AddDataShards method addShards.

// snippet-start:[kinesis.java2.AddDataShards.main]
public static void addShards(KinesisClient kinesisClient, String name, int goalShards) {
    try {
        UpdateShardCountRequest request = UpdateShardCountRequest.builder().scalingType("UNIFORM_SCALING").streamName(name).targetShardCount(goalShards).build();
        UpdateShardCountResponse response = kinesisClient.updateShardCount(request);
        System.out.println(response.streamName() + " has updated shard count to " + response.currentShardCount());
    } catch (KinesisException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : KinesisException(software.amazon.awssdk.services.kinesis.model.KinesisException) UpdateShardCountResponse(software.amazon.awssdk.services.kinesis.model.UpdateShardCountResponse) UpdateShardCountRequest(software.amazon.awssdk.services.kinesis.model.UpdateShardCountRequest)

Aggregations

KinesisException (software.amazon.awssdk.services.kinesis.model.KinesisException)1 UpdateShardCountRequest (software.amazon.awssdk.services.kinesis.model.UpdateShardCountRequest)1 UpdateShardCountResponse (software.amazon.awssdk.services.kinesis.model.UpdateShardCountResponse)1