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;
}
Aggregations