public static < P extends ParaObject > List < P > readPageFromSharedTable ( String appid , Pager pager ) { LinkedList < P > results = new LinkedList <> ( ) ; if ( StringUtils . isBlank ( appid ) ) { return results ; } PageIterable < Item , QueryOutcome > pages = queryGSI ( appid , pager ) ; if ( pages != null ) { for ( Page < Item , QueryOutcome > page : pages ) { for ( Item item : page ) { P obj = ParaObjectUtils . setAnnotatedFields ( item . asMap ( ) ) ; if ( obj != null ) { results . add ( obj ) ; } } } } if ( ! results . isEmpty ( ) && pager != null ) { pager . setLastKey ( results . peekLast ( ) . getId ( ) ) ; } return results ; }
Reads a page from a shared DynamoDB table . Shared tables are tables that have global secondary indexes and can contain the objects of multiple apps .