@Override public String apply(CacheGroupActionData data) { return data.desc.cacheOrGroupName() + ", destroy=" + data.destroy; } });
@Override public String apply(CacheGroupActionData data) { return data.desc.cacheOrGroupName(); } });
/** * @param grpId Group ID. * @return Group name for debug purpose. */ private String debugGroupName(int grpId) { CacheGroupDescriptor desc = cachesRegistry.group(grpId); if (desc != null) return desc.cacheOrGroupName(); else return "Unknown group: " + grpId; }
/** * @param grpDesc Cache group descriptor. */ public void removeCacheGroup(CacheGroupDescriptor grpDesc) { CacheGroupAffinity rmvd = registeredCacheGrps.remove(grpDesc.groupId()); assert rmvd != null : grpDesc.cacheOrGroupName(); }
/** * @param grpIds Cache group IDs. * @return Cache names. */ private String groupNames(Collection<Integer> grpIds) { StringBuilder names = new StringBuilder(); for (Integer grpId : grpIds) { String name = cachesRegistry.group(grpId).cacheOrGroupName(); if (names.length() != 0) names.append(", "); names.append(name); } return names.toString(); }
/** * @param grpDesc Cache group descriptor. * @param filter Node filter. * @param cacheMode Cache mode. */ public void addCacheGroup(CacheGroupDescriptor grpDesc, IgnitePredicate<ClusterNode> filter, CacheMode cacheMode) { CacheGroupAffinity old = registeredCacheGrps.put(grpDesc.groupId(), new CacheGroupAffinity(grpDesc.cacheOrGroupName(), filter, cacheMode, grpDesc.persistenceEnabled())); assert old == null : old; }
/** * Adds caches and cache groups to start from {@code exchActions}. * Removes caches and caches groups to stop from {@code exchActions}. * * @param exchActions Exchange actions. * @return Future that will be completed when all unregistered cache configurations will be persisted. */ public IgniteInternalFuture<?> update(ExchangeActions exchActions) { for (ExchangeActions.CacheGroupActionData stopAction : exchActions.cacheGroupsToStop()) { CacheGroupDescriptor rmvd = unregisterGroup(stopAction.descriptor().groupId()); assert rmvd != null : stopAction.descriptor().cacheOrGroupName(); } for (ExchangeActions.CacheActionData req : exchActions.cacheStopRequests()) unregisterCache(req.descriptor().cacheId()); Collection<CacheGroupDescriptor> grpDescs = exchActions.cacheGroupsToStart().stream() .map(ExchangeActions.CacheGroupActionData::descriptor) .collect(Collectors.toList()); Collection<DynamicCacheDescriptor> cacheDescs = exchActions.cacheStartRequests().stream() .map(ExchangeActions.CacheActionData::descriptor) .collect(Collectors.toList()); return registerAllCachesAndGroups(grpDescs, cacheDescs); }
/** */ private void verifyCachesAndGroups(IgniteEx ignite) { Map<String, DynamicCacheDescriptor> caches = ignite.context().cache().cacheDescriptors(); assertEquals(2, caches.size()); caches.keySet().contains(GridCacheUtils.UTILITY_CACHE_NAME); caches.keySet().contains(STATIC_CACHE_NAME); Map<Integer, CacheGroupDescriptor> groups = ignite.context().cache().cacheGroupDescriptors(); assertEquals(2, groups.size()); boolean defaultGroupFound = false; boolean staticCachesGroupFound = false; for (CacheGroupDescriptor grpDesc : groups.values()) { if (grpDesc.cacheOrGroupName().equals(GridCacheUtils.UTILITY_CACHE_NAME)) defaultGroupFound = true; else if (grpDesc.cacheOrGroupName().equals(GROUP_WITH_STATIC_CACHES)) staticCachesGroupFound = true; } assertTrue(String.format("Default group found: %b, static group found: %b", defaultGroupFound, staticCachesGroupFound), defaultGroupFound && staticCachesGroupFound); }
"cacheGrp=" + (desc != null ? desc.cacheOrGroupName() : "N/A") + ", topVer=" + topVer + ", history=" + discoCacheHist.keySet() +
return "Cache group ID conflict (change cache group name) [cacheName=" + cfg.getName() + ", groupName=" + cfg.getGroupName() + (desc.sharedGroup() ? ", conflictingGroupName=" : ", conflictingCacheName=") + desc.cacheOrGroupName() + ']'; (desc.sharedGroup() ? ", conflictingGroupName=" : ", conflictingCacheName=") + desc.cacheOrGroupName() + ']';
"Invalid affinity version [last=" + affTopVer + ", futVer=" + topVer + ", grp=" + desc.cacheOrGroupName() + ']'; List<ClusterNode> curNodes = curAssignment.get(p); assert aliveNodes.containsAll(newNodes) : "Invalid new assignment [grp=" + grpHolder.aff.cacheOrGroupName() + ", nodes=" + newNodes + ", topVer=" + fut.context().events().discoveryCache().version() + "grp=" + desc.cacheOrGroupName() + ", node=" + newPrimary + ", topVer=" + topVer + ']'; assert aliveNodes.containsAll(newNodes0) : "Invalid late assignment [grp=" + grpHolder.aff.cacheOrGroupName() + ", nodes=" + newNodes + ", topVer=" + fut.context().events().discoveryCache().version() + "[grp=" + desc.cacheOrGroupName() + "]");
"[grp=" + grpDesc.cacheOrGroupName() + "]");
topVer).contains(cctx.localNode()) : grpDesc.cacheOrGroupName(); grpDesc.cacheOrGroupName(), grpDesc.groupId(), affFunc,
ses, grp.groupId(), grp.cacheOrGroupName(), grp.sharedGroup(), grp.caches() == null ? 0 : grp.caches().size(),
/** * @param grpDesc Cache group descriptor. * @param ccfg Cache configuration. * @return Cache store holder. * @throws IgniteCheckedException If failed. */ private CacheStoreHolder initForCache(CacheGroupDescriptor grpDesc, CacheConfiguration ccfg) throws IgniteCheckedException { assert !grpDesc.sharedGroup() || ccfg.getGroupName() != null : ccfg.getName(); File cacheWorkDir = cacheWorkDir(ccfg); String dataRegionName = grpDesc.config().getDataRegionName(); DataRegionMetricsImpl regionMetrics = cctx.database().dataRegion(dataRegionName).memoryMetrics(); int grpId = CU.cacheId(grpDesc.cacheOrGroupName()); AllocatedPageTracker allocatedTracker = regionMetrics.getOrAllocateGroupPageAllocationTracker(grpId); return initDir( cacheWorkDir, grpDesc.groupId(), grpDesc.config().getAffinity().partitions(), allocatedTracker, ccfg.isEncryptionEnabled() ); }
"[grp=" + desc.cacheOrGroupName() + "]");
cache.cacheType(), cache.groupId(), cache.groupDescriptor().cacheOrGroupName(), cache.cacheConfiguration().getCacheMode(), cache.cacheConfiguration().getAtomicityMode(),
/** * @param grpId Group ID. * @return Group name for debug purpose. */ private String debugGroupName(int grpId) { CacheGroupDescriptor desc = cachesRegistry.group(grpId); if (desc != null) return desc.cacheOrGroupName(); else return "Unknown group: " + grpId; }
/** * @param grpDesc Cache group descriptor. */ public void removeCacheGroup(CacheGroupDescriptor grpDesc) { CacheGroupAffinity rmvd = registeredCacheGrps.remove(grpDesc.groupId()); assert rmvd != null : grpDesc.cacheOrGroupName(); }
/** * @param grpDesc Cache group descriptor. * @param filter Node filter. * @param cacheMode Cache mode. */ public void addCacheGroup(CacheGroupDescriptor grpDesc, IgnitePredicate<ClusterNode> filter, CacheMode cacheMode) { CacheGroupAffinity old = registeredCacheGrps.put(grpDesc.groupId(), new CacheGroupAffinity(grpDesc.cacheOrGroupName(), filter, cacheMode, grpDesc.persistenceEnabled())); assert old == null : old; }