/** {@inheritDoc} */ @Override public Object onGet(Object key, @Nullable Object val) { if (!noInterceptor) return delegate.onGet((TestKey)key, (TestValue)val); return val; }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Nullable @Override public Object onGet(Object key, Object val) { if (disabled) return val; assertNotNull(retInterceptor); Object ret = retInterceptor.onGet(key, val); System.out.println("Get [key=" + key + ", val=" + val + ", ret=" + ret + ']'); if (val != null) { Object old = getMap.put(key, val); assertNull(old); // Fot get interceptor is called on near node only. } invokeCnt.incrementAndGet(); return ret; }
/** {@inheritDoc} */ @Nullable @Override public V get(K key) throws IgniteCheckedException { A.notNull(key, "key"); boolean statsEnabled = ctx.statisticsEnabled(); long start = statsEnabled ? System.nanoTime() : 0L; boolean keepBinary = ctx.keepBinary(); if (keepBinary) key = (K)ctx.toCacheKeyObject(key); V val = get(key, !keepBinary, false); if (ctx.config().getInterceptor() != null) { key = keepBinary ? (K)ctx.unwrapBinaryIfNeeded(key, true, false) : key; val = (V)ctx.config().getInterceptor().onGet(key, val); } if (statsEnabled) metrics0().addGetTimeNanos(System.nanoTime() - start); return val; }
/** {@inheritDoc} */ @Nullable @Override public CacheEntry<K, V> getEntry(K key) throws IgniteCheckedException { A.notNull(key, "key"); boolean statsEnabled = ctx.statisticsEnabled(); long start = statsEnabled ? System.nanoTime() : 0L; boolean keepBinary = ctx.keepBinary(); if (keepBinary) key = (K)ctx.toCacheKeyObject(key); EntryGetResult t = (EntryGetResult)get(key, !keepBinary, true); CacheEntry<K, V> val = t != null ? new CacheEntryImplEx<>( keepBinary ? (K)ctx.unwrapBinaryIfNeeded(key, true, false) : key, (V)t.value(), t.version()) : null; if (ctx.config().getInterceptor() != null) { key = keepBinary ? (K)ctx.unwrapBinaryIfNeeded(key, true, false) : key; V val0 = (V)ctx.config().getInterceptor().onGet(key, t != null ? val.getValue() : null); val = (val0 != null) ? new CacheEntryImplEx<>(key, val0, t != null ? t.version() : null) : null; } if (statsEnabled) metrics0().addGetTimeNanos(System.nanoTime() - start); return val; }
V val0 = (V)ctx.config().getInterceptor().onGet(key, t != null ? val.getValue() : null);
/** {@inheritDoc} */ @Nullable @Override public V get(K key) throws IgniteCheckedException { A.notNull(key, "key"); boolean statsEnabled = ctx.statisticsEnabled(); long start = statsEnabled ? System.nanoTime() : 0L; boolean keepBinary = ctx.keepBinary(); if (keepBinary) key = (K)ctx.toCacheKeyObject(key); V val = get(key, !keepBinary, false); if (ctx.config().getInterceptor() != null) { key = keepBinary ? (K)ctx.unwrapBinaryIfNeeded(key, true, false) : key; val = (V)ctx.config().getInterceptor().onGet(key, val); } if (statsEnabled) metrics0().addGetTimeNanos(System.nanoTime() - start); return val; }
/** {@inheritDoc} */ @Nullable @Override public CacheEntry<K, V> getEntry(K key) throws IgniteCheckedException { A.notNull(key, "key"); boolean statsEnabled = ctx.statisticsEnabled(); long start = statsEnabled ? System.nanoTime() : 0L; boolean keepBinary = ctx.keepBinary(); if (keepBinary) key = (K)ctx.toCacheKeyObject(key); EntryGetResult t = (EntryGetResult)get(key, !keepBinary, true); CacheEntry<K, V> val = t != null ? new CacheEntryImplEx<>( keepBinary ? (K)ctx.unwrapBinaryIfNeeded(key, true, false) : key, (V)t.value(), t.version()) : null; if (ctx.config().getInterceptor() != null) { key = keepBinary ? (K)ctx.unwrapBinaryIfNeeded(key, true, false) : key; V val0 = (V)ctx.config().getInterceptor().onGet(key, t != null ? val.getValue() : null); val = (val0 != null) ? new CacheEntryImplEx<>(key, val0, t != null ? t.version() : null) : null; } if (statsEnabled) metrics0().addGetTimeNanos(System.nanoTime() - start); return val; }
V val0 = (V)ctx.config().getInterceptor().onGet(key, t != null ? val.getValue() : null);