Skip to content
  • Balaji Viswanathan's avatar
    FAB-2462: Re-enable paging results for queries · 868a3e93
    Balaji Viswanathan authored
    
    
    Paging result sets is required in order to avoid failures
    related to large result sets.
    
    The Next() call on StateQueryIterator from Chaincode was failing
    in peer due to a corner case. This fix addresses the corner case (where
    the number of results is an exact multiple of shim batch size).
    
    This is done by keeping the HasMore flag in iterator accurate by
    pre-fetching the next batch of results when the last cached item
    from shim is accessed.
    
    This fix also adds the Namespace field to commonledger.KV type. The data
    returned to peer has namespace information. All state iterators return
     QueryResult with commonledger.KV type elements.
    
    Change-Id: Id872130db8a20ec5a59593b1fa004dce43ee36ac
    Signed-off-by: default avatarBalaji Viswanathan <balaji.viswanathan@gmail.com>
    Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
    868a3e93