library/src/main/java/com/kdgregory/aws/utils/kinesis/KinesisReader.java
/**
     *  Retrieves a iterators specific set of shards (maybe not all shards in stream) based on
     *  the specified iterator types. Returns <code>true</code> if able to do this, <code>false</code>
     *  if the retrieve times-out.
     */
Retrieves a iterators specific set of shards (maybe not all shards in stream) based on
the specified iterator types. Returns true if able to do this, false
if the retrieve times-out.
Retrieves a iterators specific set of shards ( maybe not all shards in stream ) based on the specified iterator types . Returns true if able to do this false if the retrieve times - out .
private boolean retrieveIterators(Map<String,ShardIteratorType> iteratorTypes, long timeoutAt)
    {
        Map<String,String> result = new TreeMap<String,String>();
        for (Map.Entry<String,ShardIteratorType> entry : iteratorTypes.entrySet())
        {
            String shardId = entry.getKey();
            ShardIteratorType iteratorType = entry.getValue();
            String offset = offsets.get(shardId);
            long currentTimeout = timeoutAt - System.currentTimeMillis();
            String shardIterator = (currentTimeout > 0)
                                 ? KinesisUtil.retrieveShardIterator(client, streamName, shardId, iteratorType, offset, null, currentTimeout)
                                 : null;
            if (shardIterator == null)
            {
                logger.warn("failed to retrieve shard iterator: stream = " + streamName + ", shard = " + shardId);
                return false;
            }
            result.put(shardId, shardIterator);
        }
        shardIterators.putAll(result);
        return true;
    }
private boolean retrieveIterators ( Map < String , ShardIteratorType > iteratorTypes , long timeoutAt ) { Map < String , String > result = new TreeMap < String , String > ( ) ; for ( Map . Entry < String , ShardIteratorType > entry : iteratorTypes . entrySet ( ) ) { String shardId = entry . getKey ( ) ; ShardIteratorType iteratorType = entry . getValue ( ) ; String offset = offsets . get ( shardId ) ; long currentTimeout = timeoutAt - System . currentTimeMillis ( ) ; String shardIterator = ( currentTimeout > 0 ) ? KinesisUtil . retrieveShardIterator ( client , streamName , shardId , iteratorType , offset , null , currentTimeout ) : null ; if ( shardIterator == null ) { logger . warn ( "failed to retrieve shard iterator: stream = " + streamName + ", shard = " + shardId ) ; return false ; } result . put ( shardId , shardIterator ) ; } shardIterators . putAll ( result ) ; return true ; }
Retrieves a iterators specific set of shards (maybe not all shards in stream) based on
  the specified iterator types.
Retrieves a iterators specific set of shards ( maybe not all shards in stream ) based on the specified iterator types .
// we store in a local map so that we don't apply a partial update to the master map