/** {@inheritDoc} */ @Override public GridCacheProxyImpl<K, V> internalProxy() { return delegate.internalProxy(); }
@Override public IgniteInternalCache<?, ?> apply(IgniteCacheProxy<?, ?> entries) { return entries.internalProxy(); } });
/** * @param name Cache name. * @param <K> type of keys. * @param <V> type of values. * @return Cache instance for given name. */ public <K, V> IgniteInternalCache<K, V> cache(String name) { assert name != null; if (log.isDebugEnabled()) log.debug("Getting cache for name: " + name); IgniteCacheProxy<K, V> jcache = (IgniteCacheProxy<K, V>)jcacheProxy(name, true); return jcache == null ? null : jcache.internalProxy(); }
/** * @param name Cache name. * @param <K> type of keys. * @param <V> type of values. * @return Cache instance for given name. */ public <K, V> IgniteInternalCache<K, V> publicCache(String name) { assert name != null; if (log.isDebugEnabled()) log.debug("Getting public cache for name: " + name); DynamicCacheDescriptor desc = cacheDescriptor(name); if (desc == null) throw new IllegalArgumentException("Cache is not started: " + name); if (!desc.cacheType().userCache()) throw new IllegalStateException("Failed to get cache because it is a system cache: " + name); IgniteCacheProxy<K, V> jcache = (IgniteCacheProxy<K, V>)jcacheProxy(name, true); if (jcache == null) throw new IllegalArgumentException("Cache is not started: " + name); return jcache.internalProxy(); }
/** * @param name Cache name. * @return Cache instance for given name. * @throws IgniteCheckedException If failed. */ public <K, V> IgniteInternalCache<K, V> getOrStartCache( String name, CacheConfiguration ccfg ) throws IgniteCheckedException { assert name != null; if (log.isDebugEnabled()) log.debug("Getting cache for name: " + name); IgniteCacheProxy<?, ?> cache = jcacheProxy(name, true); if (cache == null) { dynamicStartCache(ccfg, name, null, false, ccfg == null, true).get(); cache = jcacheProxy(name, true); } return cache == null ? null : (IgniteInternalCache<K, V>)cache.internalProxy(); }
/** * @param name Cache name. * @return Cache. */ private <K, V> IgniteInternalCache<K, V> internalCacheEx(String name) { if (ctx.discovery().localNode().isClient()) { IgniteCacheProxy<K, V> proxy = (IgniteCacheProxy<K, V>)jcacheProxy(name, true); if (proxy == null) { GridCacheAdapter<?, ?> cacheAdapter = caches.get(name); if (cacheAdapter != null) { proxy = new IgniteCacheProxyImpl(cacheAdapter.context(), cacheAdapter, false); IgniteCacheProxyImpl<?, ?> prev = addjCacheProxy(name, (IgniteCacheProxyImpl<?, ?>)proxy); if (prev != null) proxy = (IgniteCacheProxy<K, V>)prev; completeProxyInitialize(proxy.getName()); } } assert proxy != null : name; return proxy.internalProxy(); } return internalCache(name); }
cache = pubCache.internalProxy();
/** * Checks that proxy is in valid state (not closed, restarted or destroyed). * Throws IllegalStateException or CacheRestartingException if proxy is in invalid state. * * @param gate Cache gateway. */ private GridCacheGateway<K, V> checkProxyIsValid(@Nullable GridCacheGateway<K, V> gate, boolean tryRestart) { if (isProxyClosed()) throw new IllegalStateException("Cache has been closed: " + context().name()); boolean isCacheProxy = delegate instanceof IgniteCacheProxyImpl; if (isCacheProxy) ((IgniteCacheProxyImpl) delegate).checkRestart(); if (gate == null) throw new IllegalStateException("Gateway is unavailable. Probably cache has been destroyed, but proxy is not closed."); if (isCacheProxy && tryRestart && gate.isStopped() && context().kernalContext().gateway().getState() == GridKernalState.STARTED) { IgniteCacheProxyImpl proxyImpl = (IgniteCacheProxyImpl) delegate; try { IgniteInternalCache<K, V> cache = context().kernalContext().cache().<K, V>publicJCache(context().name()).internalProxy(); proxyImpl.opportunisticRestart(cache); return gate(); } catch (IgniteCheckedException ice) { // Opportunity didn't work out. } } return gate; }
((GridCacheAdapter)((IgniteCacheProxy)cache).internalProxy().delegate()).peekEx(key).peekVisibleValue(); obj = ((GridCacheAdapter)((IgniteCacheProxy)cache).internalProxy().delegate()).peekEx(key).peekVisibleValue();
GridCacheAdapter ca = (GridCacheAdapter)((IgniteCacheProxy)cache).internalProxy().delegate();
((GridCacheAdapter)((IgniteCacheProxy)cache).internalProxy().delegate()).peekEx(key).peekVisibleValue();
@Override public IgniteInternalCache<?, ?> apply(IgniteCacheProxy<?, ?> entries) { return entries.internalProxy(); } });
/** {@inheritDoc} */ @Override public GridCacheProxyImpl<K, V> internalProxy() { return delegate.internalProxy(); }
/** * @param name Cache name. * @param <K> type of keys. * @param <V> type of values. * @return Cache instance for given name. */ @SuppressWarnings("unchecked") public <K, V> IgniteInternalCache<K, V> cache(String name) { assert name != null; if (log.isDebugEnabled()) log.debug("Getting cache for name: " + name); IgniteCacheProxy<K, V> jcache = (IgniteCacheProxy<K, V>)jcacheProxy(name, true); return jcache == null ? null : jcache.internalProxy(); }
/** * @param name Cache name. * @param <K> type of keys. * @param <V> type of values. * @return Cache instance for given name. */ @SuppressWarnings("unchecked") public <K, V> IgniteInternalCache<K, V> publicCache(String name) { assert name != null; if (log.isDebugEnabled()) log.debug("Getting public cache for name: " + name); DynamicCacheDescriptor desc = cacheDescriptor(name); if (desc == null) throw new IllegalArgumentException("Cache is not started: " + name); if (!desc.cacheType().userCache()) throw new IllegalStateException("Failed to get cache because it is a system cache: " + name); IgniteCacheProxy<K, V> jcache = (IgniteCacheProxy<K, V>)jcacheProxy(name, true); if (jcache == null) throw new IllegalArgumentException("Cache is not started: " + name); return jcache.internalProxy(); }
/** * @param name Cache name. * @return Cache instance for given name. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("unchecked") public <K, V> IgniteInternalCache<K, V> getOrStartCache( String name, CacheConfiguration ccfg ) throws IgniteCheckedException { assert name != null; if (log.isDebugEnabled()) log.debug("Getting cache for name: " + name); IgniteCacheProxy<?, ?> cache = jcacheProxy(name, true); if (cache == null) { dynamicStartCache(ccfg, name, null, false, ccfg == null, true).get(); cache = jcacheProxy(name, true); } return cache == null ? null : (IgniteInternalCache<K, V>)cache.internalProxy(); }
/** * @param name Cache name. * @return Cache. */ private <K, V> IgniteInternalCache<K, V> internalCacheEx(String name) { if (ctx.discovery().localNode().isClient()) { IgniteCacheProxy<K, V> proxy = (IgniteCacheProxy<K, V>)jcacheProxy(name, true); if (proxy == null) { GridCacheAdapter<?, ?> cacheAdapter = caches.get(name); if (cacheAdapter != null) { proxy = new IgniteCacheProxyImpl(cacheAdapter.context(), cacheAdapter, false); IgniteCacheProxyImpl<?, ?> prev = addjCacheProxy(name, (IgniteCacheProxyImpl<?, ?>)proxy); if (prev != null) proxy = (IgniteCacheProxy<K, V>)prev; completeProxyInitialize(proxy.getName()); } } assert proxy != null : name; return proxy.internalProxy(); } return internalCache(name); }
cache = pubCache.internalProxy();
IgniteInternalCache<K, V> cache = context().kernalContext().cache().<K, V>publicJCache(context().name()).internalProxy();