use of software.amazon.awssdk.services.kinesis.model.KinesisException 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);
}
}
use of software.amazon.awssdk.services.kinesis.model.KinesisException in project aws-doc-sdk-examples by awsdocs.
the class CreateDataStream method createStream.
// snippet-start:[kinesis.java2.create.main]
public static void createStream(KinesisClient kinesisClient, String streamName) {
try {
CreateStreamRequest streamReq = CreateStreamRequest.builder().streamName(streamName).shardCount(1).build();
kinesisClient.createStream(streamReq);
} catch (KinesisException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
use of software.amazon.awssdk.services.kinesis.model.KinesisException in project aws-doc-sdk-examples by awsdocs.
the class DeleteDataStream method deleteStream.
// snippet-start:[kinesis.java2.delete.main]
public static void deleteStream(KinesisClient kinesisClient, String streamName) {
try {
DeleteStreamRequest delStream = DeleteStreamRequest.builder().streamName(streamName).build();
kinesisClient.deleteStream(delStream);
} catch (KinesisException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations