Search in sources :

Example 1 with ShardFilterType

use of com.amazonaws.services.kinesis.model.ShardFilterType in project hazelcast by hazelcast.

the class RangeMonitor method listAllShardsAsync.

private Future<ListShardsResult> listAllShardsAsync(String nextToken) {
    ShardFilterType filterType = ShardFilterType.FROM_TRIM_HORIZON;
    // all shards within the retention period (including closed, excluding expired)
    ListShardsRequest request = listAllShardsRequest(streamName, nextToken, filterType);
    return kinesis.listShardsAsync(request);
}
Also used : ListShardsRequest(com.amazonaws.services.kinesis.model.ListShardsRequest) ShardFilterType(com.amazonaws.services.kinesis.model.ShardFilterType)

Example 2 with ShardFilterType

use of com.amazonaws.services.kinesis.model.ShardFilterType in project hazelcast by hazelcast.

the class KinesisTestHelper method listOpenShards.

private List<Shard> listOpenShards() {
    List<Shard> shards = new ArrayList<>();
    String nextToken = null;
    do {
        // only the currently open shards
        ShardFilterType filterType = ShardFilterType.AT_LATEST;
        ListShardsRequest request = RangeMonitor.listAllShardsRequest(stream, nextToken, filterType);
        ListShardsResult response = kinesis.listShards(request);
        shards.addAll(response.getShards());
        nextToken = response.getNextToken();
    } while (nextToken != null);
    return shards;
}
Also used : ListShardsResult(com.amazonaws.services.kinesis.model.ListShardsResult) ListShardsRequest(com.amazonaws.services.kinesis.model.ListShardsRequest) ShardFilterType(com.amazonaws.services.kinesis.model.ShardFilterType) ArrayList(java.util.ArrayList) Shard(com.amazonaws.services.kinesis.model.Shard)

Aggregations

ListShardsRequest (com.amazonaws.services.kinesis.model.ListShardsRequest)2 ShardFilterType (com.amazonaws.services.kinesis.model.ShardFilterType)2 ListShardsResult (com.amazonaws.services.kinesis.model.ListShardsResult)1 Shard (com.amazonaws.services.kinesis.model.Shard)1 ArrayList (java.util.ArrayList)1