| Modifier and Type | Field and Description |
|---|---|
static String |
ATOMICS_CACHE_NAME
Atomics system cache name.
|
static long |
EXPIRE_TIME_CALCULATE
Expire time: must be calculated based on TTL value.
|
static long |
EXPIRE_TIME_ETERNAL
Expire time: eternal.
|
static String |
MARSH_CACHE_NAME
Marshaller system cache name.
|
static int |
SKIP_STORE_FLAG_MASK
Skip store flag bit mask.
|
static String |
SYS_CACHE_HADOOP_MR
Hadoop syste cache name.
|
static long |
TTL_ETERNAL
TTL: eternal.
|
static long |
TTL_MINIMUM
TTL: minimum positive value.
|
static long |
TTL_NOT_CHANGED
TTL: not changed.
|
static long |
TTL_ZERO
TTL: zero (immediate expiration).
|
static String |
UTILITY_CACHE_NAME
System cache name.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GridCacheUtils()
Ensure singleton.
|
| Modifier and Type | Method and Description |
|---|---|
static Collection<ClusterNode> |
affinityNodes(GridCacheContext ctx)
Gets all nodes on which cache with the same name is started and the local DHT storage is enabled.
|
static Collection<ClusterNode> |
affinityNodes(GridCacheContext ctx,
AffinityTopologyVersion topOrder)
Gets DHT affinity nodes.
|
static Collection<ClusterNode> |
aliveCacheNodes(GridCacheSharedContext ctx,
AffinityTopologyVersion topOrder)
Gets alive nodes with at least one cache configured.
|
static Collection<ClusterNode> |
aliveNodes(GridCacheContext ctx,
AffinityTopologyVersion topOrder)
Gets alive nodes.
|
static Collection<ClusterNode> |
aliveRemoteCacheNodes(GridCacheSharedContext ctx,
AffinityTopologyVersion topOrder)
Gets alive remote nodes with at least one cache configured.
|
static Collection<ClusterNode> |
aliveRemoteNodes(GridCacheContext ctx,
AffinityTopologyVersion topOrder)
Gets alive nodes.
|
static Collection<ClusterNode> |
allNodes(GridCacheContext ctx)
Gets all nodes on which cache with the same name is started.
|
static Collection<ClusterNode> |
allNodes(GridCacheContext ctx,
AffinityTopologyVersion topOrder)
Gets all nodes on which cache with the same name is started.
|
static Collection<ClusterNode> |
allNodes(GridCacheSharedContext ctx,
AffinityTopologyVersion topOrder)
Gets all nodes with at least one cache configured.
|
static boolean |
allowForStartup(Object msg) |
static CacheEntryPredicate |
alwaysFalse0() |
static CacheEntryPredicate[] |
alwaysFalse0Arr() |
static CacheEntryPredicate |
alwaysTrue0() |
static Collection<ClusterNode> |
backups(Collection<ClusterNode> nodes) |
static IgniteReducer<Boolean,Boolean> |
boolReducer() |
static int |
cacheId(String cacheName) |
static String |
cacheNameForSwapSpaceName(String swapSpaceName) |
static boolean |
cacheNode(String cacheName,
ClusterNode node)
Checks if given node has specified cache started.
|
static boolean |
cacheNode(String cacheName,
GridCacheAttributes[] caches)
Checks if given attributes relate the the node which has (or had) specified cache started.
|
static <C extends CachePluginConfiguration> |
cachePluginConfiguration(CacheConfiguration cfg,
Class<C> cl) |
static <T extends CachePluginConfiguration> |
cachePluginConfigurations(IgniteConfiguration cfg,
Class<T> cls) |
static CacheEntryPredicate |
cachePrimary(Affinity aff,
ClusterNode n) |
static <K,V> IgnitePredicate<javax.cache.Cache.Entry<K,V>> |
cachePrimary0(Affinity<K> aff,
ClusterNode n) |
static void |
checkAttributeMismatch(IgniteLogger log,
CacheConfiguration locCfg,
CacheConfiguration rmtCfg,
UUID rmtNodeId,
T2<String,String> attr,
boolean fail)
Checks that local and remove configurations have the same value of given attribute.
|
static void |
checkAttributeMismatch(IgniteLogger log,
String cfgName,
UUID rmtNodeId,
String attrName,
String attrMsg,
Object locVal,
Object rmtVal,
boolean fail)
Checks that cache configuration attribute has the same value in local and remote cache configurations.
|
static void |
checkStore(GridCacheContext<?,?> ctx)
Checks that cache store is present.
|
static <T> IgniteReducer<Collection<T>,Collection<T>> |
collectionsReducer()
Gets reducer that aggregates collections.
|
static RuntimeException |
convertToCacheException(IgniteCheckedException e) |
static <K,V> IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] |
empty() |
static CacheEntryPredicate[] |
empty0() |
static IgniteClosure<GridCacheEntryEx,KeyCacheObject> |
entry2Key() |
static IgniteInClosure<IgniteInternalFuture<?>> |
errorLogger(IgniteLogger log,
Class<? extends Exception>... excl) |
static long |
expireTimeInPast() |
static <K,V> IgniteClosure<Integer,IgnitePredicate<javax.cache.Cache.Entry<K,V>>[]> |
factory()
Entry predicate factory mostly used for deserialization.
|
static CacheObject |
failed(boolean err) |
static CacheObject |
failed(boolean err,
CacheObject val) |
static <K,V> Collection<V> |
getOrSet(ConcurrentMap<K,Collection<V>> mappings,
K k) |
static <K,V> Collection<V> |
getOrSet(Map<K,List<V>> mappings,
K k) |
static CacheConfiguration |
hadoopSystemCache()
Create system cache used by Hadoop component.
|
static <K,V> IgniteClosure<GridCacheEntryInfo,K> |
info2Key() |
static <K,V> void |
inTx(Ignite ignite,
IgniteCache<K,V> cache,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
IgniteInClosureX<IgniteCache<K,V>> clo)
Execute closure inside cache transaction.
|
static <K,V> void |
inTx(IgniteInternalCache<K,V> cache,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
IgniteInClosureX<IgniteInternalCache<K,V>> clo)
Execute closure inside cache transaction.
|
static <K,V> void |
invalidate(IgniteCache<K,V> cache,
K key)
Invalidate entry in cache.
|
static boolean |
isAlwaysFalse0(CacheEntryPredicate[] p) |
static boolean |
isAlwaysTrue0(CacheEntryPredicate[] p) |
static boolean |
isAtomicsCache(String cacheName) |
static boolean |
isHadoopSystemCache(String cacheName) |
static boolean |
isIgfsCache(IgniteConfiguration cfg,
String cacheName) |
static boolean |
isLockTimeout(Throwable t) |
static boolean |
isLockTimeoutOrCancelled(Throwable t) |
static boolean |
isMarshallerCache(String cacheName) |
static boolean |
isNearEnabled(CacheConfiguration cfg)
Checks if near cache is enabled for cache configuration.
|
static boolean |
isNearEnabled(GridCacheContext ctx)
Checks if near cache is enabled for cache context.
|
static boolean |
isSystemCache(String cacheName) |
static boolean |
isUtilityCache(String cacheName) |
static IgnitePredicate<KeyCacheObject> |
keyHasMeta(GridCacheContext ctx,
UUID meta) |
static ClusterNode |
localOrPrimary(Iterable<ClusterNode> nodes,
UUID locId) |
static <K,V> IgniteReducer<Map<K,V>,Map<K,V>> |
mapsReducer(int size)
Gets reducer that aggregates maps into one.
|
static byte[] |
marshal(GridCacheSharedContext ctx,
Object obj) |
static String |
mask(String cacheName)
Mask cache name in case it is null.
|
static Comparator<ClusterNode> |
nodeComparator(boolean asc) |
static <K,V> IgnitePredicate<GridDhtLocalPartition> |
notEvicted() |
static <T> IgniteReducer<T,Collection<T>> |
objectsReducer()
Gets reducer that aggregates items into collection.
|
static ClusterNode |
oldest(GridCacheContext cctx)
Gets oldest alive node for specified topology version.
|
static ClusterNode |
oldest(GridCacheContext cctx,
AffinityTopologyVersion topOrder)
Gets oldest alive node for specified topology version.
|
static ClusterNode |
oldest(GridCacheSharedContext ctx)
Gets oldest alive node across nodes with at least one cache configured.
|
static ClusterNode |
oldest(GridCacheSharedContext cctx,
AffinityTopologyVersion topOrder)
Gets oldest alive node with at least one cache configured for specified topology version.
|
static <T> T |
outTx(Callable<T> cmd,
GridCacheContext ctx)
Method executes any Callable out of scope of transaction.
|
static <K,V> IgniteClosure<GridDhtLocalPartition,GridDhtPartitionState> |
part2state() |
static ClusterNode |
primary(Iterable<? extends ClusterNode> nodes) |
static ClusterNode |
primaryNode(GridCacheContext ctx,
Object key)
Gets primary node on which given key is cached.
|
static <K,V> CacheEntryPredicate[] |
readEntryFilterArray(ObjectInput in)
Reads array from input stream.
|
static <K,V> IgnitePredicate<IgniteTxEntry> |
reads() |
static GridCacheVersion |
readVersion(ObjectInput in)
Reads
GridCacheVersion from input stream. |
static Collection<ClusterNode> |
remoteNodes(GridCacheContext ctx)
Gets remote nodes on which cache with the same name is started.
|
static Collection<ClusterNode> |
remoteNodes(GridCacheContext ctx,
AffinityTopologyVersion topOrder)
Gets remote nodes on which cache with the same name is started.
|
static Collection<ClusterNode> |
remoteNodes(GridCacheSharedContext ctx)
Gets remote node with at least one cache configured.
|
static Collection<ClusterNode> |
remoteNodes(GridCacheSharedContext ctx,
AffinityTopologyVersion topVer)
Gets remote nodes with at least one cache configured.
|
static String |
replicationTopicReceive(String cacheName)
Get topic to which replication responses are sent.
|
static String |
replicationTopicSend()
Get topic to which replication requests are sent.
|
static Object |
skipValue(Object val,
boolean skip) |
static <K,V> UUID |
subjectId(IgniteInternalTx tx,
GridCacheSharedContext<K,V> ctx)
Gets subject ID by transaction.
|
static String |
swapSpaceName(GridCacheContext<?,?> ctx) |
static long |
toExpireTime(long ttl)
Convert TTL to expire time.
|
static long |
toTtl(javax.cache.expiry.Duration duration) |
static long |
ttlForLoad(javax.cache.expiry.ExpiryPolicy plc)
Get TTL for load operation.
|
static <K,V> IgniteClosure<IgniteTxEntry,GridCacheEntryEx> |
tx2entry() |
static <K,V> IgniteClosure<IgniteTxEntry,K> |
tx2key() |
static <K,V> IgniteClosure<IgniteInternalTx,GridCacheVersion> |
tx2xidVersion() |
static <K,V> IgniteClosure<Collection<IgniteTxEntry>,Collection<K>> |
txCol2Key() |
static IgniteInternalTx |
txStartInternal(GridCacheContext ctx,
IgniteInternalCache prj,
TransactionConcurrency concurrency,
TransactionIsolation isolation) |
static String |
txString(IgniteInternalTx tx) |
static <K,V> IgniteBiPredicate<K,V> |
typeFilter(Class<?> keyType,
Class<?> valType)
Gets type filter for projections.
|
static CacheEntryPredicate |
typeFilter0(Class<?> keyType,
Class<?> valType) |
static String |
unmask(String cacheName)
Unmask cache name.
|
static void |
unwindEvicts(GridCacheContext ctx) |
static <K,V> void |
unwindEvicts(GridCacheSharedContext<K,V> ctx) |
static int |
utilityCacheId() |
static UUID |
uuid()
Gets per-thread-unique ID for this thread.
|
static void |
validateCacheKey(IgniteLogger log,
Object key)
Validates that cache key object has overridden equals and hashCode methods and
implements
Externalizable. |
static void |
validateCacheValue(IgniteLogger log,
Object val)
Validates that cache value object implements
Externalizable. |
static <T> T |
value(CacheObject cacheObj,
GridCacheContext ctx,
boolean cpy) |
static IgniteClosure<Integer,GridCacheVersion[]> |
versionArrayFactory() |
static byte[] |
versionToBytes(GridCacheVersion ver)
Converts cache version to byte array.
|
static <K,V> IgnitePredicate<IgniteTxEntry> |
writes() |
static void |
writeVersion(ObjectOutput out,
GridCacheVersion ver)
Writes
GridCacheVersion to output stream. |
public static final String SYS_CACHE_HADOOP_MR
public static final String UTILITY_CACHE_NAME
public static final String ATOMICS_CACHE_NAME
public static final String MARSH_CACHE_NAME
public static final long TTL_MINIMUM
public static final long TTL_ETERNAL
public static final long TTL_NOT_CHANGED
public static final long TTL_ZERO
public static final long EXPIRE_TIME_ETERNAL
public static final long EXPIRE_TIME_CALCULATE
public static final int SKIP_STORE_FLAG_MASK
public static UUID uuid()
public static boolean allowForStartup(Object msg)
msg - Message to check.True if preloader message.public static void writeVersion(ObjectOutput out, GridCacheVersion ver) throws IOException
GridCacheVersion to output stream. This method is meant to be used by
implementations of Externalizable interface.out - Output stream.ver - Version to write.IOException - If write failed.@Nullable public static GridCacheVersion readVersion(ObjectInput in) throws IOException
GridCacheVersion from input stream. This method is meant to be used by
implementations of Externalizable interface.in - Input stream.IOException - If read failed.public static IgnitePredicate<KeyCacheObject> keyHasMeta(GridCacheContext ctx, UUID meta)
ctx - Cache context.meta - Meta name.@Nullable public static CacheObject failed(boolean err) throws GridCacheFilterFailedException
err - If true, then throw GridCacheFilterFailedException,
otherwise return val passed in.null.GridCacheFilterFailedException - If err flag is true.@Nullable public static CacheObject failed(boolean err, CacheObject val) throws GridCacheFilterFailedException
err - If true, then throw GridCacheFilterFailedException,
otherwise return val passed in.val - Value for which evaluation happened.val passed in or throw exception.GridCacheFilterFailedException - If err flag is true.public static <K,V> IgniteClosure<Integer,IgnitePredicate<javax.cache.Cache.Entry<K,V>>[]> factory()
K - Key type.V - Value type.public static void checkStore(GridCacheContext<?,?> ctx) throws IgniteCheckedException
ctx - Registry.IgniteCheckedException - If cache store is not present.public static String swapSpaceName(GridCacheContext<?,?> ctx)
ctx - Cache registry.public static String cacheNameForSwapSpaceName(String swapSpaceName)
swapSpaceName - Swap space name.public static <K,V> IgniteClosure<GridDhtLocalPartition,GridDhtPartitionState> part2state()
public static <K,V> IgnitePredicate<GridDhtLocalPartition> notEvicted()
public static Collection<ClusterNode> allNodes(GridCacheContext ctx)
ctx - Cache context.public static Collection<ClusterNode> allNodes(GridCacheContext ctx, AffinityTopologyVersion topOrder)
ctx - Cache context.topOrder - Maximum allowed node order.public static Collection<ClusterNode> allNodes(GridCacheSharedContext ctx, AffinityTopologyVersion topOrder)
ctx - Shared cache context.topOrder - Maximum allowed node order.public static Collection<ClusterNode> aliveNodes(GridCacheContext ctx, AffinityTopologyVersion topOrder)
ctx - Cache context.topOrder - Maximum allowed node order.public static Collection<ClusterNode> remoteNodes(GridCacheContext ctx)
ctx - Cache context.public static Collection<ClusterNode> remoteNodes(GridCacheSharedContext ctx)
ctx - Shared cache context.public static Collection<ClusterNode> remoteNodes(GridCacheContext ctx, AffinityTopologyVersion topOrder)
ctx - Cache context.topOrder - Maximum allowed node order.public static Collection<ClusterNode> aliveRemoteNodes(GridCacheContext ctx, AffinityTopologyVersion topOrder)
ctx - Cache context.topOrder - Maximum allowed node order.public static Collection<ClusterNode> remoteNodes(GridCacheSharedContext ctx, AffinityTopologyVersion topVer)
ctx - Cache shared context.topVer - Topology version.public static Collection<ClusterNode> aliveCacheNodes(GridCacheSharedContext ctx, AffinityTopologyVersion topOrder)
ctx - Cache context.topOrder - Maximum allowed node order.public static Collection<ClusterNode> aliveRemoteCacheNodes(GridCacheSharedContext ctx, AffinityTopologyVersion topOrder)
ctx - Cache context.topOrder - Maximum allowed node order.public static Collection<ClusterNode> affinityNodes(GridCacheContext ctx)
ctx - Cache context.public static Collection<ClusterNode> affinityNodes(GridCacheContext ctx, AffinityTopologyVersion topOrder)
ctx - Cache context.topOrder - Maximum allowed node order.public static boolean isNearEnabled(GridCacheContext ctx)
ctx - Cache context to check.True if near cache is enabled, false otherwise.public static boolean isNearEnabled(CacheConfiguration cfg)
cfg - Cache configuration to check.True if near cache is enabled, false otherwise.public static boolean cacheNode(String cacheName, ClusterNode node)
cacheName - Cache name.node - Node to check.True if given node has specified cache started.public static boolean cacheNode(String cacheName, GridCacheAttributes[] caches)
cacheName - Cache name.caches - Node cache attributes.True if given node has specified cache started.public static ClusterNode oldest(GridCacheContext cctx)
cctx - Cache context.public static ClusterNode oldest(GridCacheSharedContext ctx)
ctx - Cache context.public static ClusterNode oldest(GridCacheContext cctx, AffinityTopologyVersion topOrder)
cctx - Cache context.topOrder - Maximum allowed node order.public static ClusterNode oldest(GridCacheSharedContext cctx, AffinityTopologyVersion topOrder)
cctx - Shared cache context.topOrder - Maximum allowed node order.public static <K,V> IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] empty()
public static CacheEntryPredicate[] empty0()
public static CacheEntryPredicate alwaysFalse0()
public static CacheEntryPredicate alwaysTrue0()
public static CacheEntryPredicate[] alwaysFalse0Arr()
public static boolean isAlwaysFalse0(@Nullable CacheEntryPredicate[] p)
p - Predicate.True if always false filter.public static boolean isAlwaysTrue0(@Nullable CacheEntryPredicate[] p)
p - Predicate.True if always false filter.public static <K,V> IgniteClosure<IgniteTxEntry,K> tx2key()
public static <K,V> IgniteClosure<Collection<IgniteTxEntry>,Collection<K>> txCol2Key()
public static <K,V> IgniteClosure<IgniteTxEntry,GridCacheEntryEx> tx2entry()
public static <K,V> IgniteClosure<IgniteInternalTx,GridCacheVersion> tx2xidVersion()
public static IgniteClosure<GridCacheEntryEx,KeyCacheObject> entry2Key()
public static <K,V> IgniteClosure<GridCacheEntryInfo,K> info2Key()
public static <K,V> IgnitePredicate<IgniteTxEntry> reads()
public static <K,V> IgnitePredicate<IgniteTxEntry> writes()
public static <K,V> IgniteBiPredicate<K,V> typeFilter(Class<?> keyType, Class<?> valType)
K - Key type.V - Value type.keyType - Key type.valType - Value type.public static CacheEntryPredicate typeFilter0(Class<?> keyType, Class<?> valType)
keyType - Key type.valType - Value type.public static IgniteReducer<Boolean,Boolean> boolReducer()
public static <K,V> IgniteReducer<Map<K,V>,Map<K,V>> mapsReducer(int size)
K - Key type.V - Value type.size - Predicted size of the resulting map to avoid resizings.public static <T> IgniteReducer<Collection<T>,Collection<T>> collectionsReducer()
T - Collection element type.public static <T> IgniteReducer<T,Collection<T>> objectsReducer()
T - Items type.public static ClusterNode primary(Iterable<? extends ClusterNode> nodes)
nodes - Set of nodes.public static ClusterNode localOrPrimary(Iterable<ClusterNode> nodes, UUID locId)
nodes - Nodes.locId - Local node ID.public static Collection<ClusterNode> backups(Collection<ClusterNode> nodes)
nodes - Nodes.public static <K,V> Collection<V> getOrSet(Map<K,List<V>> mappings, K k)
mappings - Mappings.k - map key.public static <K,V> Collection<V> getOrSet(ConcurrentMap<K,Collection<V>> mappings, K k)
mappings - Mappings.k - map key.public static IgniteInClosure<IgniteInternalFuture<?>> errorLogger(IgniteLogger log, Class<? extends Exception>... excl)
log - Logger.excl - Excludes.public static boolean isLockTimeout(Throwable t)
t - Exception to check.true if caused by lock timeout.public static boolean isLockTimeoutOrCancelled(Throwable t)
t - Exception to check.true if caused by lock timeout or cancellation.public static byte[] marshal(GridCacheSharedContext ctx, Object obj) throws IgniteCheckedException
ctx - Cache context.obj - Object to marshal.IgniteCheckedException - If marshalling failed.public static <T> T outTx(Callable<T> cmd, GridCacheContext ctx) throws IgniteCheckedException
cmd will be executed in another thread.cmd - Callable.ctx - Cache context.IgniteCheckedException - If execution failed.public static Object skipValue(Object val, boolean skip)
val - Value.skip - Skip value flag.public static IgniteInternalTx txStartInternal(GridCacheContext ctx, IgniteInternalCache prj, TransactionConcurrency concurrency, TransactionIsolation isolation)
ctx - Context.prj - Projection.concurrency - Concurrency.isolation - Isolation.public static String txString(@Nullable IgniteInternalTx tx)
tx - Transaction.public static void unwindEvicts(GridCacheContext ctx)
ctx - Cache context.public static <K,V> void unwindEvicts(GridCacheSharedContext<K,V> ctx)
ctx - Shared cache context.@Nullable public static ClusterNode primaryNode(GridCacheContext ctx, Object key)
ctx - Cache.key - Key to find primary node for.public static Comparator<ClusterNode> nodeComparator(boolean asc)
asc - True for ascending.public static IgniteClosure<Integer,GridCacheVersion[]> versionArrayFactory()
public static byte[] versionToBytes(GridCacheVersion ver)
ver - Version.public static String mask(String cacheName)
cacheName - Cache name.<default> in case the name is null.@Nullable public static String unmask(String cacheName)
cacheName - Cache name.<default> then null
will be returned.public static String replicationTopicSend()
public static String replicationTopicReceive(String cacheName)
cacheName - Cache name.public static void checkAttributeMismatch(IgniteLogger log, CacheConfiguration locCfg, CacheConfiguration rmtCfg, UUID rmtNodeId, T2<String,String> attr, boolean fail) throws IgniteCheckedException
log - Logger used to log warning message (used only if fail flag is not set).locCfg - Local configuration.rmtCfg - Remote configuration.rmtNodeId - Remote node.attr - Attribute name.fail - If true throws IgniteCheckedException in case of attribute values mismatch, otherwise logs warning.IgniteCheckedException - If attribute values are different and fail flag is true.public static void checkAttributeMismatch(IgniteLogger log, String cfgName, UUID rmtNodeId, String attrName, String attrMsg, @Nullable Object locVal, @Nullable Object rmtVal, boolean fail) throws IgniteCheckedException
log - Logger used to log warning message (used only if fail flag is not set).cfgName - Remote cache name.rmtNodeId - Remote node.attrName - Short attribute name for error message.attrMsg - Full attribute name for error message.locVal - Local value.rmtVal - Remote value.fail - If true throws IgniteCheckedException in case of attribute values mismatch, otherwise logs warning.IgniteCheckedException - If attribute values are different and fail flag is true.public static void validateCacheValue(IgniteLogger log, @Nullable Object val)
Externalizable.log - Logger used to log warning message.val - Value.public static void validateCacheKey(IgniteLogger log, @Nullable Object key)
Externalizable.log - Logger used to log warning message.key - Key.IllegalArgumentException - If equals or hashCode is not implemented.public static boolean isHadoopSystemCache(String cacheName)
cacheName - Cache name.True if this is Hadoop system cache.public static CacheConfiguration hadoopSystemCache()
public static boolean isMarshallerCache(String cacheName)
cacheName - Cache name.True if this is marshaller system cache.public static boolean isUtilityCache(String cacheName)
cacheName - Cache name.True if this is utility system cache.public static boolean isAtomicsCache(String cacheName)
cacheName - Cache name.True if this is atomics system cache.public static boolean isSystemCache(String cacheName)
cacheName - Cache name.True if system cache.public static int utilityCacheId()
public static int cacheId(String cacheName)
public static boolean isIgfsCache(IgniteConfiguration cfg, @Nullable String cacheName)
cfg - Grid configuration.cacheName - Cache name.True in this is IGFS data or meta cache.public static long toExpireTime(long ttl)
ttl - TTL.public static <K,V> void inTx(IgniteInternalCache<K,V> cache, TransactionConcurrency concurrency, TransactionIsolation isolation, IgniteInClosureX<IgniteInternalCache<K,V>> clo) throws IgniteCheckedException
cache - Cache.concurrency - Concurrency.isolation - Isolation.clo - Closure.IgniteCheckedException - If failed.public static <K,V> void inTx(Ignite ignite, IgniteCache<K,V> cache, TransactionConcurrency concurrency, TransactionIsolation isolation, IgniteInClosureX<IgniteCache<K,V>> clo) throws IgniteCheckedException
cache - Cache.concurrency - Concurrency.isolation - Isolation.clo - Closure.IgniteCheckedException - If failed.public static <K,V> UUID subjectId(IgniteInternalTx tx, GridCacheSharedContext<K,V> ctx)
tx - Transaction.public static <K,V> void invalidate(IgniteCache<K,V> cache, K key)
cache - Cache.key - Key.public static long toTtl(javax.cache.expiry.Duration duration)
duration - Duration.public static long ttlForLoad(javax.cache.expiry.ExpiryPolicy plc)
plc - Expiry policy.TTL_ZERO in case of immediate expiration.public static long expireTimeInPast()
@Nullable public static <K,V> CacheEntryPredicate[] readEntryFilterArray(ObjectInput in) throws IOException, ClassNotFoundException
in - Input stream.IOException - If failed.ClassNotFoundException - If class not found.public static CacheEntryPredicate cachePrimary(Affinity aff, ClusterNode n)
aff - Affinity.n - Node.true if entry is primary for node.public static <K,V> IgnitePredicate<javax.cache.Cache.Entry<K,V>> cachePrimary0(Affinity<K> aff, ClusterNode n)
aff - Affinity.n - Node.true if entry is primary for node.@NotNull public static RuntimeException convertToCacheException(IgniteCheckedException e)
e - Ignite checked exception.@Nullable public static <T> T value(@Nullable CacheObject cacheObj, GridCacheContext ctx, boolean cpy)
cacheObj - Cache object.ctx - Cache context.cpy - Copy flag.public static <C extends CachePluginConfiguration> C cachePluginConfiguration(CacheConfiguration cfg, Class<C> cl)
cfg - Cache configuration.cl - Type of cache plugin configuration.null.public static <T extends CachePluginConfiguration> List<T> cachePluginConfigurations(IgniteConfiguration cfg, Class<T> cls)
cfg - Config.cls - Class.null list.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.1.0-incubating Release Date : May 20 2015