Skip to content

Commit

Permalink
rolled back equal comparision for inmemory refresh. fixed EVCacheMemc…
Browse files Browse the repository at this point in the history
…achedClient logging
  • Loading branch information
smadappa committed Mar 15, 2017
1 parent 12016dd commit 899eb14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ public ListenableFuture<T> reload(final String key, T prev) {
public T call() {
try {
T t = load(key);
if(t != null && t.equals(prev)) {
EVCacheMetricsFactory.increment(appName, null, null, "EVCacheInMemoryCache" + "-" + appName + "-Reload-UsePrevious");
t = prev;
}
if(t == null) {
EVCacheMetricsFactory.increment(appName, null, null, "EVCacheInMemoryCache" + "-" + appName + "-Reload-NotFound");
return prev;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public void receivedStatus(OperationStatus val) {
if (val.getStatusCode().equals(StatusCode.SUCCESS)) {
operationDuration.stop();
if (log.isDebugEnabled()) log.debug("AddOrAppend Key (Append Operation): " + key + "; Status : " + val.getStatusCode().name()
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration(TimeUnit.MILLISECONDS)));
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (operationDuration.getDuration(TimeUnit.MILLISECONDS)));

EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-AoA-AppendOperation-SUCCESS", DataSourceType.COUNTER).increment();
rv.set(val.isSuccess(), val);
Expand All @@ -381,7 +381,7 @@ public void complete() {
public void receivedStatus(OperationStatus val) {
operationDuration.stop();
if (log.isDebugEnabled()) log.debug("AddOrAppend Key (Ad Operation): " + key + "; Status : " + val.getStatusCode().name()
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration(TimeUnit.MILLISECONDS)));
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (operationDuration.getDuration(TimeUnit.MILLISECONDS)));
rv.set(val.isSuccess(), val);
if(val.isSuccess()) {
appendSuccess = true;
Expand All @@ -393,7 +393,7 @@ public void receivedStatus(OperationStatus val) {
public void receivedStatus(OperationStatus val) {
if (val.getStatusCode().equals(StatusCode.SUCCESS)) {
if (log.isDebugEnabled()) log.debug("AddOrAppend Retry append Key (Append Operation): " + key + "; Status : " + val.getStatusCode().name()
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration(TimeUnit.MILLISECONDS)));
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (operationDuration.getDuration(TimeUnit.MILLISECONDS)));

EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-AoA-RetryAppendOperation-SUCCESS", DataSourceType.COUNTER).increment();
rv.set(val.isSuccess(), val);
Expand Down Expand Up @@ -461,25 +461,15 @@ private <T> OperationFuture<Boolean> asyncStore(final StoreType storeType, final
public void receivedStatus(OperationStatus val) {
operationDuration.stop();
if (log.isDebugEnabled()) log.debug("Storing Key : " + key + "; Status : " + val.getStatusCode().name()
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration(TimeUnit.MILLISECONDS)));
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + operationDuration.getDuration(TimeUnit.MILLISECONDS));

if (val.getStatusCode().equals(StatusCode.SUCCESS)) {
EVCacheMetricsFactory.increment(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Operation-SUCCESS");
} else if (val.getStatusCode().equals(StatusCode.TIMEDOUT)) {
// Tag tag = null;
// final MemcachedNode node = getEVCacheNode(key);
// if (node.getSocketAddress() instanceof InetSocketAddress) {
// tag = new BasicTag("HOST", ((InetSocketAddress) node.getSocketAddress()).getHostName());
// }
EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Operation-TIMEDOUT", DataSourceType.COUNTER).increment();
} else if (val.getStatusCode().equals(StatusCode.ERR_NOT_FOUND) || val.getStatusCode().equals(StatusCode.ERR_EXISTS)) {
EVCacheMetricsFactory.increment(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Operation-" + val.getStatusCode().name());
} else {
// Tag tag = null;
// final MemcachedNode node = getEVCacheNode(key);
// if (node.getSocketAddress() instanceof InetSocketAddress) {
// tag = new BasicTag("HOST", ((InetSocketAddress) node.getSocketAddress()).getHostName());
// }
EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Operation-" + val.getStatusCode().name(), DataSourceType.COUNTER).increment();
}
rv.set(val.isSuccess(), val);
Expand Down Expand Up @@ -520,7 +510,7 @@ public long incr(String key, long by, long def, int exp) {
} finally {
operationDuration.stop();
if (log.isDebugEnabled()) log.debug("Increment Key : " + key + "; by : " + by + "; default : " + def + "; exp : " + exp
+ "; val : " + val + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration(TimeUnit.MILLISECONDS)));
+ "; val : " + val + "; Elapsed Time - " + operationDuration.getDuration(TimeUnit.MILLISECONDS));
}
return val;
}
Expand All @@ -534,7 +524,7 @@ public long decr(String key, long by, long def, int exp) {
} finally {
operationDuration.stop();
if (log.isDebugEnabled()) log.debug("decrement Key : " + key + "; by : " + by + "; default : " + def + "; exp : " + exp
+ "; val : " + val + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration(TimeUnit.MILLISECONDS)));
+ "; val : " + val + "; Elapsed Time - " + (operationDuration.getDuration(TimeUnit.MILLISECONDS)));
}
return val;
}
Expand Down

0 comments on commit 899eb14

Please sign in to comment.