private Set < Key > cachePutIfUntouched ( final Iterable < Bucket > buckets ) { final Map < Key , CasPut > payload = new HashMap <> ( ) ; final Set < Key > successes = new HashSet <> ( ) ; for ( final Bucket buck : buckets ) { if ( ! buck . isCacheable ( ) ) { successes . add ( buck . getKey ( ) ) ; continue ; } final Integer expirySeconds = cacheControl . getExpirySeconds ( buck . getKey ( ) ) ; if ( expirySeconds == null ) { successes . add ( buck . getKey ( ) ) ; continue ; } payload . put ( buck . getKey ( ) , new CasPut ( buck . identifiableValue , buck . getNextToStore ( ) , expirySeconds ) ) ; } successes . addAll ( this . memcache . putIfUntouched ( payload ) ) ; return successes ; }
Put buckets in the cache checking for cacheability and collisions .