Search in sources :

Example 1 with ListStreamsResult

use of com.amazonaws.services.kinesis.model.ListStreamsResult in project components by Talend.

the class KinesisDatasetRuntime method listStreams.

@Override
public Set<String> listStreams() {
    AmazonKinesis amazonKinesis = KinesisClient.create(properties);
    ListStreamsResult listStreamsResult = amazonKinesis.listStreams();
    List<String> streamNames = listStreamsResult.getStreamNames();
    Set<String> streamNamesCollection = new HashSet(streamNames);
    while (listStreamsResult.isHasMoreStreams() && !streamNames.isEmpty()) {
        listStreamsResult = amazonKinesis.listStreams(streamNames.get(streamNames.size() - 1));
        streamNames = listStreamsResult.getStreamNames();
        streamNamesCollection.addAll(streamNames);
    }
    return streamNamesCollection;
}
Also used : ListStreamsResult(com.amazonaws.services.kinesis.model.ListStreamsResult) AmazonKinesis(com.amazonaws.services.kinesis.AmazonKinesis) HashSet(java.util.HashSet)

Aggregations

AmazonKinesis (com.amazonaws.services.kinesis.AmazonKinesis)1 ListStreamsResult (com.amazonaws.services.kinesis.model.ListStreamsResult)1 HashSet (java.util.HashSet)1