src/main/java/com/googlecode/objectify/cache/EntityMemcache.java
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;
	}
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;
	}
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.
@return the set of keys that were *successfully* handled. That includes buckets that were put without collision
and buckets that didn't need to be cached.
Put buckets in the cache checking for cacheability and collisions .