use of software.amazon.awssdk.services.kinesis.KinesisClient in project beam by apache.
the class KinesisSource method createClient.
private SimplifiedKinesisClient createClient(PipelineOptions options) {
AwsOptions awsOptions = options.as(AwsOptions.class);
KinesisClient kinesis;
CloudWatchClient cloudWatch;
if (spec.getAWSClientsProvider() != null) {
kinesis = spec.getAWSClientsProvider().getKinesisClient();
cloudWatch = spec.getAWSClientsProvider().getCloudWatchClient();
} else {
ClientConfiguration config = spec.getClientConfiguration();
kinesis = ClientBuilderFactory.buildClient(awsOptions, KinesisClient.builder(), config);
cloudWatch = ClientBuilderFactory.buildClient(awsOptions, CloudWatchClient.builder(), config);
}
return new SimplifiedKinesisClient(kinesis, cloudWatch, spec.getRequestRecordsLimit(), Instant::now);
}
use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteDataStream method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <streamName>\n\n" + "Where:\n" + " streamName - The Amazon Kinesis data stream (for example, StockTradeStream)\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String streamName = args[0];
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
deleteStream(kinesisClient, streamName);
kinesisClient.close();
System.out.println("Done");
}
use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class AddDataShards method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <streamName>\n\n" + "Where:\n" + " streamName - The Amazon Kinesis data stream (for example, StockTradeStream)\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String name = args[0];
String inputShards = "2";
int goalShards = Integer.parseInt(inputShards);
// snippet-start:[kinesis.java2.AddDataShards.client]
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
// snippet-end:[kinesis.java2.AddDataShards.client]
addShards(kinesisClient, name, goalShards);
kinesisClient.close();
System.out.println("Done");
}
use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class DescribeLimits method main.
public static void main(String[] args) {
// snippet-start:[kinesis.java2.DescribeLimits.client]
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
// snippet-end:[kinesis.java2.DescribeLimits.client]
describeKinLimits(kinesisClient);
kinesisClient.close();
}
use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class RegisterStreamConsumer method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <streamARN>\n\n" + "Where:\n" + " streamARN - The Amazon Kinesis data stream (for example, arn:aws:kinesis:us-east-1:814548xxxxxx:stream/LamDataStream)\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String streamARN = args[0];
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
String arnValue = regConsumer(kinesisClient, streamARN);
System.out.println(arnValue);
kinesisClient.close();
}
Aggregations