Modifier and Type | Class and Description |
---|---|
static interface |
GridCacheUtils.BackupPostProcessingClosure |
Modifier and Type | Field and Description |
---|---|
static String |
ATOMIC_MSG_LOG_CATEGORY |
static String |
CACHE_MSG_LOG_CATEGORY |
static int |
cheatCacheId
Cheat cache ID for debugging and benchmarking purposes.
|
static String |
CONTINUOUS_QRY_LOG_CATEGORY |
static int |
DFLT_TTL_EXPIRE_BATCH_SIZE |
static long |
EXPIRE_TIME_CALCULATE
Expire time: must be calculated based on TTL value.
|
static long |
EXPIRE_TIME_ETERNAL
Expire time: eternal.
|
static IgnitePredicate |
FILTER_NEAR_CACHE_ENTRY
Write filter.
|
static IgnitePredicate |
READ_FILTER
Read filter.
|
static IgnitePredicate |
READ_FILTER_COLOCATED
Read filter.
|
static IgnitePredicate |
READ_FILTER_NEAR
Read filter.
|
static String[] |
RESERVED_NAMES
Reserved cache names
|
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 |
TX_MSG_FINISH_LOG_CATEGORY |
static String |
TX_MSG_LOCK_LOG_CATEGORY |
static String |
TX_MSG_LOG_CATEGORY |
static String |
TX_MSG_PREPARE_LOG_CATEGORY |
static String |
TX_MSG_RECOVERY_LOG_CATEGORY |
static int |
UNDEFINED_CACHE_ID |
static String |
UTILITY_CACHE_NAME
System cache name.
|
static IgnitePredicate |
WRITE_FILTER
Write filter.
|
static IgnitePredicate |
WRITE_FILTER_COLOCATED
Write filter.
|
static IgnitePredicate |
WRITE_FILTER_NEAR
Write filter.
|
Modifier | Constructor and Description |
---|---|
protected |
GridCacheUtils()
Ensure singleton.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
affinityNode(ClusterNode node,
IgnitePredicate<ClusterNode> filter) |
static Collection<ClusterNode> |
affinityNodes(GridCacheContext ctx,
AffinityTopologyVersion topVer)
Gets DHT affinity nodes.
|
static CacheEntryPredicate[] |
alwaysFalse0Arr() |
static Collection<ClusterNode> |
backups(Collection<ClusterNode> nodes) |
static boolean |
baselineNode(ClusterNode node,
DiscoveryDataClusterState discoveryDataClusterState) |
static IgniteReducer<Boolean,Boolean> |
boolReducer() |
static int |
cacheGroupId(String cacheName,
@Nullable String grpName) |
static int |
cacheId(String cacheName) |
static <C extends CachePluginConfiguration> |
cachePluginConfiguration(CacheConfiguration cfg,
Class<C> cl) |
static <T extends CachePluginConfiguration> |
cachePluginConfigurations(IgniteConfiguration cfg,
Class<T> cls) |
static boolean |
cheatCache(int id)
Deprecated.
|
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,
@Nullable Object locVal,
@Nullable 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(int size)
Gets reducer that aggregates collections.
|
static Map<Integer,int[]> |
convertInvalidPartitions(Map<Integer,Set<Integer>> partsMap) |
static @NotNull RuntimeException |
convertToCacheException(IgniteCheckedException e) |
static @Nullable GridCacheUtils.BackupPostProcessingClosure |
createBackupPostProcessingClosure(AffinityTopologyVersion topVer,
IgniteLogger log,
GridCacheContext cctx,
@Nullable KeyCacheObject key,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean readThrough,
boolean skipVals)
Creates closure that saves initial value to backup partition.
|
static <K,V> IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] |
empty() |
static CacheEntryPredicate[] |
empty0() |
static int |
encryptedPageSize(int pageSize,
EncryptionSpi encSpi) |
static IgniteClosure<GridCacheEntryEx,KeyCacheObject> |
entry2Key() |
static IgniteInClosure<IgniteInternalFuture<?>> |
errorLogger(IgniteLogger log,
Class<? extends Exception>... excl) |
static long |
expireTimeInPast() |
static @Nullable DataStorageConfiguration |
extractDataStorage(ClusterNode node,
JdkMarshaller marshaller,
ClassLoader clsLdr)
Extract and unmarshal data storage configuration from given node.
|
static <K,V> IgniteClosure<Integer,IgnitePredicate<javax.cache.Cache.Entry<K,V>>[]> |
factory()
Entry predicate factory mostly used for deserialization.
|
static @Nullable CacheObject |
failed(boolean err) |
static @Nullable CacheObject |
failed(boolean err,
CacheObject val) |
static CacheEntryPredicate[] |
filterArray(@Nullable CacheEntryPredicate filter)
Create filter array.
|
static GridCacheContext<?,?> |
firstPartitioned(GridCacheSharedContext<?,?> sctx,
int[] cacheIds) |
static GridCacheContext<?,?> |
firstPartitioned(GridCacheSharedContext<?,?> sctx,
Iterable<Integer> cacheIds) |
static <K,V> IgniteClosure<GridCacheEntryInfo,K> |
info2Key() |
static void |
initializeConfigDefaults(IgniteLogger log,
CacheConfiguration cfg,
CacheObjectContext cacheObjCtx) |
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 |
isCacheTemplateName(String cacheName) |
static boolean |
isDefaultDataRegionPersistent(DataStorageConfiguration cfg) |
static boolean |
isInMemoryCluster(Collection<ClusterNode> nodes,
JdkMarshaller marshaller,
ClassLoader clsLdr) |
static boolean |
isLockTimeoutOrCancelled(Throwable t) |
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 |
isPersistenceEnabled(DataStorageConfiguration cfg) |
static boolean |
isPersistenceEnabled(IgniteConfiguration cfg) |
static boolean |
isPersistentCache(CacheConfiguration ccfg,
DataStorageConfiguration dsCfg)
Checks if cache configuration belongs to persistent cache.
|
static boolean |
isReservedCacheName(String name) |
static boolean |
isSystemCache(String cacheName) |
static boolean |
isUtilityCache(String cacheName) |
static IgniteReducer<Long,Long> |
longReducer() |
static <K,V> IgniteReducer<Map<K,V>,Map<K,V>> |
mapsReducer(int size)
Gets reducer that aggregates maps into one.
|
static byte[] |
marshal(GridCacheContext ctx,
Object obj) |
static byte[] |
marshal(GridCacheSharedContext ctx,
boolean depEnabled,
Object obj) |
static String |
mask(String cacheName)
Mask cache name in case it is null.
|
static Map<UUID,Collection<ClusterNode>> |
neighbors(Collection<ClusterNode> topSnapshot)
Builds neighborhood map for all nodes in snapshot.
|
static Collection<ClusterNode> |
neighborsForNodes(Map<UUID,Collection<ClusterNode>> neighborhood,
Iterable<ClusterNode> nodes)
Returns neighbors for all
nodes . |
static Comparator<ClusterNode> |
nodeComparator(boolean asc) |
static <T> IgniteReducer<T,Collection<T>> |
objectsReducer()
Gets reducer that aggregates items into collection.
|
static @Nullable ClusterNode |
oldest(Collection<ClusterNode> nodes) |
static <K,V> CacheConfiguration<K,V> |
patchCacheConfiguration(CacheConfiguration<K,V> oldCfg,
Collection<QueryEntity> entities,
String sqlSchema,
boolean isSqlEscape,
int qryParallelism)
Patch cache configuration with
SchemaAddQueryEntityOperation . |
static <K,V> CacheConfiguration<K,V> |
patchCacheConfiguration(CacheConfiguration<K,V> oldCfg,
SchemaAddQueryEntityOperation op)
Patch cache configuration with
SchemaAddQueryEntityOperation . |
static ClusterNode |
primary(Iterable<? extends ClusterNode> nodes) |
static IgnitePredicate<IgniteTxEntry> |
reads() |
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 <S> S |
retryTopologySafe(Callable<S> c) |
static Object |
skipValue(Object val,
boolean skip) |
static Collection<CacheStoreSessionListener> |
startStoreSessionListeners(GridKernalContext ctx,
javax.cache.configuration.Factory<CacheStoreSessionListener>[] factories)
Creates and starts store session listeners.
|
static void |
stopStoreSessionListeners(GridKernalContext ctx,
Collection<CacheStoreSessionListener> sesLsnrs)
Stops store session listeners.
|
static <K,V> UUID |
subjectId(IgniteInternalTx tx,
GridCacheSharedContext<K,V> ctx)
Gets subject ID by transaction.
|
static long |
toExpireTime(long ttl)
Convert TTL to expire time.
|
static long |
toTtl(javax.cache.expiry.Duration duration) |
static TransactionConfiguration |
transactionConfiguration(@Nullable GridCacheContext sysCacheCtx,
IgniteConfiguration cfg) |
static long |
ttlForLoad(javax.cache.expiry.ExpiryPolicy plc)
Get TTL for load operation.
|
static IgniteClosure<IgniteInternalTx,GridCacheVersion> |
tx2xidVersion() |
static String |
txDump(@Nullable IgniteInternalTx tx)
Alias for
txString(IgniteInternalTx) . |
static GridNearTxLocal |
txStartInternal(GridCacheContext ctx,
IgniteInternalCache prj,
TransactionConcurrency concurrency,
TransactionIsolation isolation) |
static String |
txString(@Nullable IgniteInternalTx tx) |
static @Nullable String |
unmask(String cacheName)
Unmask cache name.
|
static void |
unwindEvicts(GridCacheContext ctx) |
static <K,V> void |
unwindEvicts(GridCacheSharedContext<K,V> ctx) |
static void |
validateCacheGroupsAttributesMismatch(IgniteLogger log,
CacheConfiguration cfg1,
CacheConfiguration cfg2,
String attrName,
String attrMsg,
Object val1,
Object val2,
boolean fail) |
static void |
validateCacheName(String name) |
static void |
validateCacheNames(Collection<String> cacheNames) |
static void |
validateConfigurationCacheNames(Collection<CacheConfiguration> ccfgs) |
static Map<String,String> |
validateKeyConfigiration(String groupName,
String cacheName,
CacheKeyConfiguration[] cacheKeyCfgs,
IgniteLogger log,
boolean fail)
Validate affinity key configurations.
|
static void |
validateKeyConfigiration(String groupName,
String cacheName,
UUID rmtNodeId,
CacheKeyConfiguration[] rmtCacheKeyCfgs,
CacheKeyConfiguration[] locCacheKeyCfgs,
IgniteLogger log,
boolean fail)
Validate and compare affinity key configurations.
|
static void |
validateNewCacheName(String name) |
static <T> T |
value(@Nullable CacheObject cacheObj,
GridCacheContext ctx,
boolean cpy) |
static Map<Class<? extends WarmUpConfiguration>,WarmUpStrategy> |
warmUpStrategies(GridKernalContext kernalCtx)
Getting available warming strategies.
|
static IgnitePredicate<IgniteTxEntry> |
writes() |
public static final int cheatCacheId
public static final int DFLT_TTL_EXPIRE_BATCH_SIZE
public static final int UNDEFINED_CACHE_ID
public static final String UTILITY_CACHE_NAME
public static final String[] RESERVED_NAMES
public static final String CONTINUOUS_QRY_LOG_CATEGORY
public static final String CACHE_MSG_LOG_CATEGORY
public static final String ATOMIC_MSG_LOG_CATEGORY
public static final String TX_MSG_LOG_CATEGORY
public static final String TX_MSG_PREPARE_LOG_CATEGORY
public static final String TX_MSG_FINISH_LOG_CATEGORY
public static final String TX_MSG_LOCK_LOG_CATEGORY
public static final String TX_MSG_RECOVERY_LOG_CATEGORY
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 IgnitePredicate READ_FILTER
public static final IgnitePredicate READ_FILTER_NEAR
public static final IgnitePredicate READ_FILTER_COLOCATED
public static final IgnitePredicate WRITE_FILTER
public static final IgnitePredicate WRITE_FILTER_NEAR
public static final IgnitePredicate WRITE_FILTER_COLOCATED
public static final IgnitePredicate FILTER_NEAR_CACHE_ENTRY
@Deprecated public static boolean cheatCache(int id)
id
- Cache ID to check.True
if this is cheat cache ID.@Nullable public static @Nullable 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 @Nullable 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 CacheEntryPredicate[] filterArray(@Nullable @Nullable CacheEntryPredicate filter)
filter
- Filter.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 Collection<ClusterNode> affinityNodes(GridCacheContext ctx, AffinityTopologyVersion topVer)
ctx
- Cache context.topVer
- Topology version.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.@Nullable public static @Nullable ClusterNode oldest(Collection<ClusterNode> nodes)
nodes
- Nodes.public static <K,V> IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] empty()
public static CacheEntryPredicate[] empty0()
public static CacheEntryPredicate[] alwaysFalse0Arr()
public static IgniteClosure<IgniteInternalTx,GridCacheVersion> tx2xidVersion()
public static IgniteClosure<GridCacheEntryEx,KeyCacheObject> entry2Key()
public static <K,V> IgniteClosure<GridCacheEntryInfo,K> info2Key()
public static IgnitePredicate<IgniteTxEntry> reads()
public static IgnitePredicate<IgniteTxEntry> writes()
public static IgniteReducer<Boolean,Boolean> boolReducer()
public static IgniteReducer<Long,Long> longReducer()
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(int size)
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 Collection<ClusterNode> backups(Collection<ClusterNode> nodes)
nodes
- Nodes.public static IgniteInClosure<IgniteInternalFuture<?>> errorLogger(IgniteLogger log, Class<? extends Exception>... excl)
log
- Logger.excl
- Excludes.public static boolean isLockTimeoutOrCancelled(Throwable t)
t
- Exception to check.true
if caused by lock timeout or cancellation.public static byte[] marshal(GridCacheContext ctx, Object obj) throws IgniteCheckedException
ctx
- Cache context.obj
- Object to marshal.IgniteCheckedException
- If marshalling failed.public static byte[] marshal(GridCacheSharedContext ctx, boolean depEnabled, Object obj) throws IgniteCheckedException
ctx
- Cache context.depEnabled
- deployment enabled flag.obj
- Object to marshal.IgniteCheckedException
- If marshalling failed.public static Object skipValue(Object val, boolean skip)
val
- Value.skip
- Skip value flag.public static GridNearTxLocal txStartInternal(GridCacheContext ctx, IgniteInternalCache prj, TransactionConcurrency concurrency, TransactionIsolation isolation)
ctx
- Context.prj
- Projection.concurrency
- Concurrency.isolation
- Isolation.public static String txDump(@Nullable @Nullable IgniteInternalTx tx)
txString(IgniteInternalTx)
.public static String txString(@Nullable @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.public static Comparator<ClusterNode> nodeComparator(boolean asc)
asc
- True
for ascending.public static String mask(String cacheName)
cacheName
- Cache name.<default>
in case the name is null
.@Nullable public static @Nullable 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 @Nullable Object locVal, @Nullable @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 validateCacheGroupsAttributesMismatch(IgniteLogger log, CacheConfiguration cfg1, CacheConfiguration cfg2, String attrName, String attrMsg, Object val1, Object val2, boolean fail) throws IgniteCheckedException
cfg1
- Existing configuration.cfg2
- Cache configuration to start.attrName
- Short attribute name for error message.attrMsg
- Full attribute name for error message.val1
- Attribute value in existing configuration.val2
- Attribute value in starting configuration.fail
- If true throws IgniteCheckedException in case of attribute values mismatch, otherwise logs warning.IgniteCheckedException
- If validation failed.public static boolean isUtilityCache(String cacheName)
cacheName
- Cache name.True
if this is utility system cache.public static boolean isSystemCache(String cacheName)
cacheName
- Cache name.True
if system cache.public static int cacheId(String cacheName)
cacheName
- Cache name.public static int cacheGroupId(String cacheName, @Nullable @Nullable String grpName)
cacheName
- Cache name.grpName
- Group name.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()
@NotNull public static @NotNull RuntimeException convertToCacheException(IgniteCheckedException e)
e
- Ignite checked exception.@Nullable public static <T> T value(@Nullable @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.public static boolean affinityNode(ClusterNode node, IgnitePredicate<ClusterNode> filter)
node
- Node.filter
- Node filter.True
if node is not client node and pass given filter.public static boolean baselineNode(ClusterNode node, DiscoveryDataClusterState discoveryDataClusterState)
node
- Node.discoveryDataClusterState
- Discovery data cluster state.True
if node is included in BaselineTopology.public static Collection<CacheStoreSessionListener> startStoreSessionListeners(GridKernalContext ctx, javax.cache.configuration.Factory<CacheStoreSessionListener>[] factories) throws IgniteCheckedException
ctx
- Kernal context.factories
- Factories.IgniteCheckedException
- In case of error.public static Map<Integer,int[]> convertInvalidPartitions(Map<Integer,Set<Integer>> partsMap)
partsMap
- Cache ID to partition IDs collection map.public static void stopStoreSessionListeners(GridKernalContext ctx, Collection<CacheStoreSessionListener> sesLsnrs) throws IgniteCheckedException
ctx
- Kernal context.sesLsnrs
- Session listeners.IgniteCheckedException
- In case of error.public static <S> S retryTopologySafe(Callable<S> c) throws IgniteCheckedException
c
- Closure to retry.IgniteCheckedException
- If failed.public static Map<UUID,Collection<ClusterNode>> neighbors(Collection<ClusterNode> topSnapshot)
topSnapshot
- Topology snapshot.public static Collection<ClusterNode> neighborsForNodes(Map<UUID,Collection<ClusterNode>> neighborhood, Iterable<ClusterNode> nodes)
nodes
.neighborhood
- Neighborhood cache.nodes
- Nodes.public static TransactionConfiguration transactionConfiguration(@Nullable @Nullable GridCacheContext sysCacheCtx, IgniteConfiguration cfg)
public static void validateCacheName(String name) throws IllegalArgumentException
name
- Cache name.IllegalArgumentException
- In case the name is not valid.public static void validateNewCacheName(String name) throws IllegalArgumentException
name
- Cache name.IllegalArgumentException
- In case the name is not valid.public static void validateCacheNames(Collection<String> cacheNames) throws IllegalArgumentException
cacheNames
- Cache names to validate.IllegalArgumentException
- In case the name is not valid.public static void validateConfigurationCacheNames(Collection<CacheConfiguration> ccfgs) throws IllegalArgumentException
ccfgs
- Configurations to validate.IllegalArgumentException
- In case the name is not valid.public static boolean isReservedCacheName(String name)
name
- Cache name.True
if it is a reserved cache name.public static Map<String,String> validateKeyConfigiration(String groupName, String cacheName, CacheKeyConfiguration[] cacheKeyCfgs, IgniteLogger log, boolean fail) throws IgniteCheckedException
groupName
- Cache group name.cacheName
- Cache name.cacheKeyCfgs
- keyConfiguration to validate.log
- Logger used to log warning message (used only if fail flag is not set).fail
- If true throws IgniteCheckedException in case of attribute values mismatch, otherwise logs warning.IgniteCheckedException
- In case the affinity key configurations is not valid.public static void validateKeyConfigiration(String groupName, String cacheName, UUID rmtNodeId, CacheKeyConfiguration[] rmtCacheKeyCfgs, CacheKeyConfiguration[] locCacheKeyCfgs, IgniteLogger log, boolean fail) throws IgniteCheckedException
groupName
- Cache group name.cacheName
- Cache name.rmtNodeId
- Remote node.rmtCacheKeyCfgs
- Exist affinity key configurations.locCacheKeyCfgs
- New affinity key configurations.log
- Logger used to log warning message (used only if fail flag is not set).fail
- If true throws IgniteCheckedException in case of attribute values mismatch, otherwise logs warning.IgniteCheckedException
- In case the affinity key configurations is not valid.public static void initializeConfigDefaults(IgniteLogger log, CacheConfiguration cfg, CacheObjectContext cacheObjCtx) throws IgniteCheckedException
cfg
- Initializes cache configuration with proper defaults.cacheObjCtx
- Cache object context.IgniteCheckedException
- If configuration is not valid.@Nullable public static @Nullable GridCacheUtils.BackupPostProcessingClosure createBackupPostProcessingClosure(AffinityTopologyVersion topVer, IgniteLogger log, GridCacheContext cctx, @Nullable @Nullable KeyCacheObject key, @Nullable @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean readThrough, boolean skipVals)
Useful only when store with readThrough is used. In situation when
get() on backup node returns successful result, it's expected that
localPeek() will be successful as well. But it isn't true when
primary node loaded value from local store, in this case backups
will remain non-initialized.
To meet that requirement the value requested from primary should
be saved on backup during get().
topVer
- Topology version.log
- Logger.cctx
- Cache context.key
- Key.expiryPlc
- Expiry policy.readThrough
- Read through.skipVals
- Skip values.public static boolean isPersistentCache(CacheConfiguration ccfg, DataStorageConfiguration dsCfg)
ccfg
- Cache configuration.dsCfg
- Data storage config.public static boolean isInMemoryCluster(Collection<ClusterNode> nodes, JdkMarshaller marshaller, ClassLoader clsLdr)
nodes
- Nodes to check.marshaller
- JdkMarshallerclsLdr
- Class loader.true
if cluster has only in-memory nodes.@Nullable public static @Nullable DataStorageConfiguration extractDataStorage(ClusterNode node, JdkMarshaller marshaller, ClassLoader clsLdr)
node
- Source of data storage configuration.null
if this node has not data storage configuration.public static boolean isDefaultDataRegionPersistent(DataStorageConfiguration cfg)
true
if persistence is enabled for a default data region, false
if not.public static boolean isPersistenceEnabled(IgniteConfiguration cfg)
true
if persistence is enabled for at least one data region, false
if not.public static boolean isPersistenceEnabled(DataStorageConfiguration cfg)
true
if persistence is enabled for at least one data region, false
if not.public static int encryptedPageSize(int pageSize, EncryptionSpi encSpi)
pageSize
- Page size.encSpi
- Encryption spi.public static GridCacheContext<?,?> firstPartitioned(GridCacheSharedContext<?,?> sctx, int[] cacheIds)
sctx
- Shared context.cacheIds
- Cache ids.null
in case no partitioned cache ids are in list.public static GridCacheContext<?,?> firstPartitioned(GridCacheSharedContext<?,?> sctx, Iterable<Integer> cacheIds)
sctx
- Shared context.cacheIds
- Cache ids.null
in case no partitioned cache ids are in list.public static boolean isCacheTemplateName(String cacheName)
cacheName
- Name of cache or cache template.true
if cache name ends with asterisk (*), and therefire is a template name.public static <K,V> CacheConfiguration<K,V> patchCacheConfiguration(CacheConfiguration<K,V> oldCfg, SchemaAddQueryEntityOperation op)
SchemaAddQueryEntityOperation
.oldCfg
- Old cache config.op
- Schema add query entity operation.public static <K,V> CacheConfiguration<K,V> patchCacheConfiguration(CacheConfiguration<K,V> oldCfg, Collection<QueryEntity> entities, String sqlSchema, boolean isSqlEscape, int qryParallelism)
SchemaAddQueryEntityOperation
.oldCfg
- Old cache config.entities
- New query entities.sqlSchema
- Sql schema name.isSqlEscape
- Sql escape flag.qryParallelism
- Query parallelism parameter.public static Map<Class<? extends WarmUpConfiguration>,WarmUpStrategy> warmUpStrategies(GridKernalContext kernalCtx)
kernalCtx
- Kernal context.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021