private List < Versioned < byte [ ] > > filterExpiredEntries ( ByteArray key , List < Versioned < byte [ ] > > vals ) { Iterator < Versioned < byte [ ] > > valsIterator = vals . iterator ( ) ; while ( valsIterator . hasNext ( ) ) { Versioned < byte [ ] > val = valsIterator . next ( ) ; VectorClock clock = ( VectorClock ) val . getVersion ( ) ; // omit if expired if ( clock . getTimestamp ( ) < ( time . getMilliseconds ( ) - this . retentionTimeMs ) ) { valsIterator . remove ( ) ; // delete stale value if configured if ( deleteExpiredEntries ) { getInnerStore ( ) . delete ( key , clock ) ; } } } return vals ; }
Performs the filtering of the expired entries based on retention time . Optionally deletes them also