Skip to content

Commit

Permalink
Removing additional logging, and set fixup to false if replaceitem is…
Browse files Browse the repository at this point in the history
… set to false
  • Loading branch information
Sumanth Pasupuleti [email protected] authored and sumanth-pasupuleti committed Oct 25, 2021
1 parent 4dff5a1 commit 4e313dd
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ private EVCacheLatch addOrSet(boolean replaceItem, String key, CachedData value,
).collect(Collectors.toList());
}

if (evCacheClients.size() > 1) {
log.warn("Ended up with more than one evCacheClients: {}, key: {}, serverGroups: {}, destinationIps: {}", evCacheClients, key, serverGroups, destinationIps);
}

EVCacheClient[] evCacheClientsArray = new EVCacheClient[evCacheClients.size()];
evCacheClients.toArray(evCacheClientsArray);

if (replaceItem)
if (replaceItem) {
return this.set(key, value, null, timeToLive, policy, evCacheClientsArray, evCacheClientsArray.length);
else
return this.add(key, value, null, timeToLive, policy, evCacheClientsArray, evCacheClientsArray.length);
}
else {
// given that we do not want to replace items, we should explicitly set fixup to false, otherwise "add" can
// result in "set" during fixup which can result in replacing items
return this.add(key, value, null, timeToLive, policy, evCacheClientsArray, evCacheClientsArray.length, false);
}
}

public KeyHashedState isKeyHashed(String appName, String serverGroup) {
Expand Down

0 comments on commit 4e313dd

Please sign in to comment.