/** {@inheritDoc} */ @Override public void onEntryAccessed(boolean rmv, GridCacheEntry<K, V> entry) { if (!entry.isCached()) return; GridCache<K, V> cache = entry.projection().cache(); int size = cache.size(); for (int i = max; i < size; i++) { GridCacheEntry<K, V> e = cache.randomEntry(); if (e != null) e.evict(); } }
/** * @return {@code True} if atomic. */ public boolean atomic() { return cacheCfg.getAtomicityMode() == ATOMIC; }
/** {@inheritDoc} */ @Override protected void operation(int key) throws Exception { cache.put(key, key); } }
/** * @return {@code True} if values should be always unmarshalled. */ public boolean isUnmarshalValues() { return cacheCfg.isQueryIndexEnabled() || !cacheCfg.isStoreValueBytes(); }
/** {@inheritDoc} */ @Override public GridFuture<?> applyx(GridCacheProjection<Object, Object> c, GridKernalContext ctx) { GridCacheEntry<Object, Object> entry = c.entry(key); if (entry != null) { if (ttl != null) entry.timeToLive(ttl); return entry.replacexAsync(val); } else return new GridFinishedFuture<Object>(ctx, false); } }
/** {@inheritDoc} */ @Override protected void operation(int key) throws Exception { cache.replace(key, key, key); } }
/** {@inheritDoc} */ @Override public boolean backup() { assert impl != null; return impl.backup(); }
/** * @return {@code True} if cache is replicated cache. */ public boolean isReplicated() { return cacheCfg.getCacheMode() == GridCacheMode.REPLICATED; }
/** {@inheritDoc} */ @Override public <V> boolean removeMeta(String name, V val) { assert impl != null; return impl.removeMeta(name, val); }
@Override public Void call() throws Exception { cache.removeAll(keys); return null; } });
/** {@inheritDoc} */ @SuppressWarnings({"unchecked", "RedundantCast"}) @Override public Set<Entry<K, V>> entrySet() { return (Set<Entry<K, V>>)(Set<? extends Entry<K, V>>)prj.entrySet(); } }
/** {@inheritDoc} */ @Override protected void operation(int key) throws Exception { cache.removex(key); } }
/** {@inheritDoc} */ @Override protected void operation(int key) throws Exception { cache.putIfAbsent(key, key); } }
/** * @return {@code True} if preload is enabled. */ public boolean preloadEnabled() { return cacheCfg.getPreloadMode() != NONE; }
/** * @return {@code True} if synchronous rollback is enabled. */ public boolean syncRollback() { return cacheCfg.getWriteSynchronizationMode() == FULL_SYNC; }
/** {@inheritDoc} */ @Override public boolean isLocked() { assert impl != null; return impl.isLocked(); }
/** {@inheritDoc} */ @Override public int partition() { assert impl != null; return impl.partition(); }
@Override public Void call() throws Exception { cache.putAll(keys); return null; } });
/** {@inheritDoc} */ @Override public void copyMeta(GridMetadataAware from) { assert impl != null; impl.copyMeta(from); }
/** * @return {@code True} if transactional. */ public boolean transactional() { return cacheCfg.getAtomicityMode() == TRANSACTIONAL; }