Skip to content

Commit

Permalink
For the default add call changed the policy to none
Browse files Browse the repository at this point in the history
During fixup set operation latch will not be used
  • Loading branch information
smadappa committed Sep 30, 2016
1 parent 75bc08b commit c161750
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1667,10 +1667,10 @@ public <T> Future<Boolean>[] appendOrAdd(String key, T value, Transcoder<T> tc,
}

public <T> boolean add(String key, T value, Transcoder<T> tc, int timeToLive) throws EVCacheException {
final EVCacheLatch latch = add(key, value, tc, timeToLive, Policy.ALL);
final EVCacheLatch latch = add(key, value, tc, timeToLive, Policy.NONE);
try {
latch.await(_pool.getOperationTimeout().get(), TimeUnit.MILLISECONDS);
return (latch.getSuccessCount() == latch.getExpectedSuccessCount());
return (latch.getSuccessCount() >= latch.getExpectedSuccessCount());
} catch (InterruptedException e) {
if (log.isDebugEnabled() && shouldLog()) log.debug("Exception adding the data for APP " + _appName + ", key : " + key, e);
final boolean throwExc = doThrowException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void run() {
final EVCacheClient client = _pool.getEVCacheClient(f.getServerGroup());
if(client != null) {
try {
client.set(canonicalKey, readData, timeToLive, latch);
client.set(canonicalKey, readData, timeToLive, null);
if(log.isDebugEnabled()) log.debug("Add: Fixup for : APP " + _appName + ", key " + canonicalKey + "; ServerGroup : " + client.getServerGroupName());
EVCacheMetricsFactory.increment(_appName , null, client.getServerGroupName(), _appName + "-AddCall-FixUp");
} catch (Exception e) {
Expand Down

0 comments on commit c161750

Please sign in to comment.