Interface IgniteCacheProxy<K,V>
-
- All Superinterfaces:
AutoCloseable,javax.cache.Cache<K,V>,Closeable,Externalizable,IgniteAsyncSupport,IgniteCache<K,V>,Iterable<javax.cache.Cache.Entry<K,V>>,Serializable
- All Known Implementing Classes:
GatewayProtectedCacheProxy,IgniteCacheProxyImpl
public interface IgniteCacheProxy<K,V> extends IgniteCache<K,V>, Externalizable
Cache proxy.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IgniteCacheProxy<K,V>cacheNoGate()Gets cache proxy which does not acquire read lock on gateway enter, should be used only if grid read lock is externally acquired.IgniteFuture<?>closeAsync()voidcloseProxy()Closes this proxy instance.GridCacheContext<K,V>context()IgniteFuture<?>destroyAsync()GridCacheProxyImpl<K,V>internalProxy()booleanisProxyClosed()<K1,V1>
IgniteCache<K1,V1>keepBinary()Creates projection that will operate with binary objects.List<FieldsQueryCursor<List<?>>>queryMultipleStatements(SqlFieldsQuery qry)Queries cache with multiple statements.IgniteCache<K,V>skipStore()IgniteCache<K,V>withDataCenterId(byte dataCenterId)-
Methods inherited from interface javax.cache.Cache
deregisterCacheEntryListener, getCacheManager, getName, isClosed, iterator, loadAll, registerCacheEntryListener, unwrap
-
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
-
Methods inherited from interface org.apache.ignite.lang.IgniteAsyncSupport
future, isAsync
-
Methods inherited from interface org.apache.ignite.IgniteCache
clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearStatistics, close, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, destroy, enableStatistics, get, getAll, getAllAsync, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPutAsync, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemoveAsync, getAndReplace, getAndReplaceAsync, getAsync, getConfiguration, getEntries, getEntriesAsync, getEntry, getEntryAsync, indexReadyFuture, invoke, invoke, invokeAll, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAllAsync, invokeAsync, invokeAsync, isLocalLocked, loadCache, loadCacheAsync, localClear, localClearAll, localEntries, localEvict, localLoadCache, localLoadCacheAsync, localMetrics, localPeek, localPreloadPartition, localSize, localSizeLong, localSizeLong, lock, lockAll, lostPartitions, metrics, metrics, preloadPartition, preloadPartitionAsync, put, putAll, putAllAsync, putAsync, putIfAbsent, putIfAbsentAsync, query, query, query, queryDetailMetrics, queryMetrics, rebalance, remove, remove, removeAll, removeAll, removeAllAsync, removeAllAsync, removeAsync, removeAsync, replace, replace, replaceAsync, replaceAsync, resetQueryDetailMetrics, resetQueryMetrics, size, sizeAsync, sizeLong, sizeLong, sizeLongAsync, sizeLongAsync, withAsync, withExpiryPolicy, withKeepBinary, withNoRetries, withPartitionRecover, withReadRepair, withSkipStore
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
context
GridCacheContext<K,V> context()
- Returns:
- Context.
-
cacheNoGate
IgniteCacheProxy<K,V> cacheNoGate()
Gets cache proxy which does not acquire read lock on gateway enter, should be used only if grid read lock is externally acquired.- Returns:
- Ignite cache proxy with simple gate.
-
keepBinary
<K1,V1> IgniteCache<K1,V1> keepBinary()
Creates projection that will operate with binary objects.Projection returned by this method will force cache not to deserialize binary objects, so keys and values will be returned from cache API methods without changes. Therefore, signature of the projection can contain only following types:
BinaryObjectfor binary classes- All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)
- Arrays of primitives (byte[], int[], ...)
Stringand array ofStringsUUIDand array ofUUIDsDateand array ofDatesTimestampand array ofTimestamps- Enums and array of enums
- Maps, collections and array of objects (but objects inside them will still be converted if they are binary)
For example, if you use
Integeras a key andValueclass as a value (which will be stored in binary format), you should acquire following projection to avoid deserialization:IgniteInternalCache
prj = cache.keepBinary(); // Value is not deserialized and returned in binary format. GridBinaryObject po = prj.get(1); Note that this method makes sense only if cache is working in binary mode (
CacheConfiguration#isBinaryEnabled()returnstrue. If not, this method is no-op and will return current projection.- Returns:
- Projection for binary objects.
-
withDataCenterId
IgniteCache<K,V> withDataCenterId(byte dataCenterId)
- Parameters:
dataCenterId- Data center ID.- Returns:
- Projection for data center id.
-
skipStore
IgniteCache<K,V> skipStore()
- Returns:
- Cache with skip store enabled.
-
internalProxy
GridCacheProxyImpl<K,V> internalProxy()
- Returns:
- Internal proxy.
-
isProxyClosed
boolean isProxyClosed()
- Returns:
Trueif proxy was closed.
-
closeProxy
void closeProxy()
Closes this proxy instance.
-
destroyAsync
IgniteFuture<?> destroyAsync()
- Returns:
- Future that contains cache destroy operation.
-
closeAsync
IgniteFuture<?> closeAsync()
- Returns:
- Future that contains cache close operation.
-
queryMultipleStatements
List<FieldsQueryCursor<List<?>>> queryMultipleStatements(SqlFieldsQuery qry)
Queries cache with multiple statements. AcceptsSqlFieldsQueryclass.- Parameters:
qry- SqlFieldsQuery.- Returns:
- List of cursors.
- See Also:
SqlFieldsQuery
-
-