当前位置: 首页>>代码示例>>Java>>正文


Java ListStreamsResult.getStreamNames方法代码示例

本文整理汇总了Java中com.amazonaws.services.kinesis.model.ListStreamsResult.getStreamNames方法的典型用法代码示例。如果您正苦于以下问题:Java ListStreamsResult.getStreamNames方法的具体用法?Java ListStreamsResult.getStreamNames怎么用?Java ListStreamsResult.getStreamNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.services.kinesis.model.ListStreamsResult的用法示例。


在下文中一共展示了ListStreamsResult.getStreamNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listAllStreams

import com.amazonaws.services.kinesis.model.ListStreamsResult; //导入方法依赖的package包/类
/**
 * Gets a list of all Amazon Kinesis streams
 * 
 * @param kinesisClient
 *        The {@link AmazonKinesisClient} with Amazon Kinesis read privileges
 * @return list of Amazon Kinesis streams
 */
public static List<String> listAllStreams(AmazonKinesisClient kinesisClient) {

    ListStreamsRequest listStreamsRequest = new ListStreamsRequest();
    listStreamsRequest.setLimit(10);
    ListStreamsResult listStreamsResult = kinesisClient.listStreams(listStreamsRequest);
    List<String> streamNames = listStreamsResult.getStreamNames();
    while (listStreamsResult.isHasMoreStreams()) {
        if (streamNames.size() > 0) {
            listStreamsRequest.setExclusiveStartStreamName(streamNames.get(streamNames.size() - 1));
        }

        listStreamsResult = kinesisClient.listStreams(listStreamsRequest);
        streamNames.addAll(listStreamsResult.getStreamNames());
    }
    return streamNames;
}
 
开发者ID:SumoLogic,项目名称:sumologic-kinesis-connector,代码行数:24,代码来源:KinesisUtils.java

示例2: listStreams

import com.amazonaws.services.kinesis.model.ListStreamsResult; //导入方法依赖的package包/类
@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;
}
 
开发者ID:Talend,项目名称:components,代码行数:14,代码来源:KinesisDatasetRuntime.java


注:本文中的com.amazonaws.services.kinesis.model.ListStreamsResult.getStreamNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。