final boolean trace = log.isTraceEnabled();
if (trace) log.tracef("Preparing to invalidate keys %s", Arrays.asList(keys));
for (Object k : getKeys()) {
InternalCacheEntry ice = dataContainer.get(k);
if (ice != null) {
DataLocality locality = dm.getLocality(k);
if (!forRehash) {
while (locality.isUncertain() && dm.isRehashInProgress()) {
LockSupport.parkNanos(MILLISECONDS.toNanos(50));
locality = dm.getLocality(k);
}
}
if (!locality.isLocal()) {
if (forRehash && config.clustering().l1().onRehash()) {
if (trace) log.trace("Not removing, instead entry will be stored in L1");
// don't need to do anything here, DistLockingInterceptor.commitEntry() will put the entry in L1
} else {
if (trace) log.tracef("Invalidating key %s.", k);