in evcache-core/src/main/java/net/spy/memcached/EVCacheMemcachedClient.java [758:794]
public EVCacheItemMetaData metaDebug(String key) {
final CountDownLatch latch = new CountDownLatch(1);
final EVCacheItemMetaData rv = new EVCacheItemMetaData();
if(opFact instanceof EVCacheAsciiOperationFactory) {
final Operation op = ((EVCacheAsciiOperationFactory)opFact).metaDebug(key, new MetaDebugOperation.Callback() {
public void receivedStatus(OperationStatus status) {
if (!status.isSuccess()) {
if (log.isDebugEnabled()) log.debug("Unsuccessful stat fetch: %s", status);
}
if (log.isDebugEnabled()) log.debug("Getting Meta Debug: " + key + "; Status : " + status.getStatusCode().name() + (log.isTraceEnabled() ? " Node : " + getEVCacheNode(key) : "") + "; Message : " + status.getMessage());
}
public void debugInfo(String k, String val) {
if (log.isDebugEnabled()) log.debug("key " + k + "; val : " + val);
if(k.equals("exp")) rv.setSecondsLeftToExpire(Long.parseLong(val) * -1);
else if(k.equals("la")) rv.setSecondsSinceLastAccess(Long.parseLong(val));
else if(k.equals("cas")) rv.setCas(Long.parseLong(val));
else if(k.equals("fetch")) rv.setHasBeenFetchedAfterWrite(Boolean.parseBoolean(val));
else if(k.equals("cls")) rv.setSlabClass(Integer.parseInt(val));
else if(k.equals("size")) rv.setSizeInBytes(Integer.parseInt(val));
}
public void complete() {
latch.countDown();
}});
mconn.enqueueOperation(key, op);
try {
if (!latch.await(operationTimeout, TimeUnit.MILLISECONDS)) {
if (log.isDebugEnabled()) log.debug("meta debug operation timeout. Will return empty opbject.");
}
} catch (Exception e) {
log.error("Exception on meta debug operation : Key : " + key, e);
}
if (log.isDebugEnabled()) log.debug("Meta Debug Data : " + rv);
}
return rv;
}