/** {@inheritDoc} */ @Override public String getType() { CacheMode type = ctx.config().getCacheMode(); return String.valueOf(type); }
/** * @param grp Cache group. */ private void cleanup(CacheGroupContext grp) { CacheConfiguration cfg = grp.config(); for (Object obj : grp.configuredUserObjects()) cleanup(cfg, obj, false); if (!grp.systemCache() && !U.IGNITE_MBEANS_DISABLED) { try { ctx.config().getMBeanServer().unregisterMBean(U.makeMBeanName(ctx.igniteInstanceName(), CACHE_GRP_METRICS_MBEAN_GRP, grp.cacheOrGroupName())); } catch (Throwable e) { U.error(log, "Failed to unregister MBean for cache group: " + grp.name(), e); } } }
/** {@inheritDoc} */ @Override public int getBackups() { return ctx.config().getBackups(); }
/** {@inheritDoc} */ @Override public Collection<Integer> lostPartitions() { if (grp.config().getPartitionLossPolicy() == PartitionLossPolicy.IGNORE) return Collections.emptySet(); lock.readLock().lock(); try { return lostParts == null ? Collections.<Integer>emptySet() : new HashSet<>(lostParts); } finally { lock.readLock().unlock(); } }
/** * @param cacheGrps All configured cache groups. * @param groupName Name of group to find. * @return Cache configuration. */ private CacheConfiguration findGroupConfig(Map<Integer, CacheGroupContext> cacheGrps, @Nullable String groupName) { if (groupName == null) groupName = DEFAULT_CACHE_NAME; for (CacheGroupContext grpCtx : cacheGrps.values()) { if (groupName.equals(grpCtx.cacheOrGroupName())) return grpCtx.config(); } return null; } }
/** * */ public static Throwable validate( GridCacheContext cctx, Object key, OperationType opType, Collection<Integer> lostParts ) { CacheGroupContext grp = cctx.group(); PartitionLossPolicy lostPlc = grp.config().getPartitionLossPolicy(); int partition = cctx.affinity().partition(key); return validate(cctx, key, partition, opType, lostPlc, lostParts); }
/** * */ public static Throwable validate( GridCacheContext cctx, Collection<?> keys, OperationType opType, Collection<Integer> lostParts ) { CacheGroupContext grp = cctx.group(); PartitionLossPolicy lostPlc = grp.config().getPartitionLossPolicy(); for (Object key : keys) { int partition = cctx.affinity().partition(key); Throwable res = validate(cctx, key, partition, opType, lostPlc, lostParts); if (res != null) return res; } return null; }
|| grpCtx.config().isReadThrough() || grpCtx.config().isWriteThrough() || grpCtx.config().getCacheStoreFactory() != null || grpCtx.config().getRebalanceDelay() == -1 || grpCtx.config().getRebalanceMode() == CacheRebalanceMode.NONE || grpCtx.config().getExpiryPolicyFactory() == null || SKIP_PARTITION_SIZE_VALIDATION) return null;
ci.setGrpId(context.groupId()); ci.setCachesCnt(context.caches().size()); ci.setPartitions(context.config().getAffinity().partitions()); ci.setBackupsCnt(context.config().getBackups()); ci.setAffinityClsName(context.config().getAffinity().getClass().getSimpleName()); ci.setMode(context.config().getCacheMode()); ci.setAtomicityMode(context.config().getAtomicityMode()); ci.setMapped(mapped(context.caches().iterator().next().name()));
return false; PartitionLossPolicy plc = grp.config().getPartitionLossPolicy();
PartitionLossPolicy lossPlc = grp.config().getPartitionLossPolicy();
/** * @param nodeId Node id. */ private void cleanupRemoteContexts(UUID nodeId) { ClusterNode node = ctx.discovery().node(nodeId); if (node == null) return; GridDhtPartitionDemandMessage d = new GridDhtPartitionDemandMessage( // Negative number of id signals that supply context // with the same positive id must be cleaned up at the supply node. -rebalanceId, this.topologyVersion(), grp.groupId()); d.timeout(grp.config().getRebalanceTimeout()); try { for (int idx = 0; idx < ctx.gridConfig().getRebalanceThreadPoolSize(); idx++) { d.topic(GridCachePartitionExchangeManager.rebalanceTopic(idx)); ctx.io().sendOrderedMessage(node, GridCachePartitionExchangeManager.rebalanceTopic(idx), d.convertIfNeeded(node.version()), grp.ioPolicy(), grp.config().getRebalanceTimeout()); } } catch (IgniteCheckedException ignored) { if (log.isDebugEnabled()) log.debug("Failed to send failover context cleanup request to node " + nodeId); } }
final CacheConfiguration cfg = grp.config();
String cacheName = grp.config().getName();
long delay = grp.config().getRebalanceDelay();
/** {@inheritDoc} */ @Override public String getType() { CacheMode type = ctx.config().getCacheMode(); return String.valueOf(type); }
/** {@inheritDoc} */ @Override public int getBackups() { return ctx.config().getBackups(); }