presto-kinesis/src/main/java/io/prestosql/plugin/kinesis/KinesisSplitManager.java/KinesisSplitManager/getStreamDescription
class KinesisSplitManager:    protected InternalStreamDescription getStreamDescription(String streamName)
    {
        InternalStreamDescription internalStreamDescription = this.streamMap.get(streamName);
        if (internalStreamDescription == null || System.currentTimeMillis() - internalStreamDescription.getCreateTimeStamp() >= MAX_CACHE_AGE_MILLIS) {
            internalStreamDescription = new InternalStreamDescription(streamName);

            DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest();
            describeStreamRequest.setStreamName(streamName);

            // Collect shards from Kinesis
            String exclusiveStartShardId = null;
            List<Shard> shards = new ArrayList<>();
            do {
                describeStreamRequest.setExclusiveStartShardId(exclusiveStartShardId);
                DescribeStreamResult describeStreamResult = clientManager.getClient().describeStream(describeStreamRequest);

                String streamStatus = describeStreamResult.getStreamDescription().getStreamStatus();
                if (!streamStatus.equals("ACTIVE") && !streamStatus.equals("UPDATING")) {
                    throw new ResourceNotFoundException("Stream not Active");
                }

                internalStreamDescription.addAllShards(describeStreamResult.getStreamDescription().getShards());

                if (describeStreamResult.getStreamDescription().getHasMoreShards() && (shards.size() > 0)) {
                    exclusiveStartShardId = shards.get(shards.size() - 1).getShardId();
                }
                else {
                    exclusiveStartShardId = null;
                }
            }
            while (exclusiveStartShardId != null);

            this.streamMap.put(streamName, internalStreamDescription);
        }

        return internalStreamDescription;
    }