示例#1
0
 @Override
 @Timed("ninja.cache.get")
 public Object get(String key) {
   Object result = underlyingCache.get(key);
   if (result == null) {
     missCounter.inc();
   } else {
     hitCounter.inc();
   }
   return result;
 }
示例#2
0
 @Override
 @Timed("ninja.cache.getMany")
 public Map<String, Object> get(String[] keys) {
   Map<String, Object> result = underlyingCache.get(keys);
   if (result == null || result.isEmpty()) {
     missCounter.inc(keys.length);
   } else {
     hitCounter.inc(result.size());
     missCounter.inc(keys.length - result.size());
   }
   return result;
 }
示例#3
0
 @Override
 @Timed("ninja.cache.replace")
 public void replace(String key, Object value, int expiration) {
   underlyingCache.replace(key, value, expiration);
 }
示例#4
0
 @Override
 @Timed("ninja.cache.safeReplace")
 public boolean safeReplace(String key, Object value, int expiration) {
   return underlyingCache.safeReplace(key, value, expiration);
 }
示例#5
0
 @Override
 @Timed("ninja.cache.set")
 public void set(String key, Object value, int expiration) {
   underlyingCache.set(key, value, expiration);
 }
示例#6
0
 @Override
 @Timed("ninja.cache.safeDelete")
 public boolean safeDelete(String key) {
   return underlyingCache.safeDelete(key);
 }
示例#7
0
 @Override
 @Timed("ninja.cache.delete")
 public void delete(String key) {
   underlyingCache.delete(key);
 }
示例#8
0
 @Override
 @Timed("ninja.cache.clear")
 public void clear() {
   underlyingCache.clear();
 }
示例#9
0
 @Override
 @Timed("ninja.cache.decr")
 public long decr(String key, int by) {
   return underlyingCache.decr(key, by);
 }