コード例 #1
0
ファイル: KinesisUtil.java プロジェクト: ishark/Malhar
  /**
   * Get the available shards from the kinesis
   *
   * @param streamName Name of the stream from where the shards to be accessed
   * @return the list of shards from the given stream
   */
  public List<Shard> getShardList(String streamName) {
    assert client != null : "Illegal client";
    DescribeStreamRequest describeRequest = new DescribeStreamRequest();
    describeRequest.setStreamName(streamName);

    DescribeStreamResult describeResponse = client.describeStream(describeRequest);
    return describeResponse.getStreamDescription().getShards();
  }