/** * Checks whether given cache configuration should be persisted. * * @param cacheCfg Cache config. * @return {@code True} if cache configuration should be persisted, {@code false} in other case. */ private boolean shouldPersist(CacheConfiguration<?, ?> cacheCfg) { return cctx.pageStore() != null && CU.isPersistentCache(cacheCfg, cctx.gridConfig().getDataStorageConfiguration()) && !cctx.kernalContext().clientNode(); }
/** * Return cache store holedr. * * @param grpId Cache group ID. * @return Cache store holder. */ private CacheStoreHolder getHolder(int grpId) throws IgniteCheckedException { try { return idxCacheStores.computeIfAbsent(grpId, (key) -> { CacheGroupDescriptor gDesc = cctx.cache().cacheGroupDescriptors().get(grpId); CacheStoreHolder holder0 = null; if (gDesc != null) { if (CU.isPersistentCache(gDesc.config(), cctx.gridConfig().getDataStorageConfiguration())) { try { holder0 = initForCache(gDesc, gDesc.config()); } catch (IgniteCheckedException e) { throw new IgniteException(e); } } } return holder0; }); } catch (IgniteException ex) { if (X.hasCause(ex, IgniteCheckedException.class)) throw ex.getCause(IgniteCheckedException.class); else throw ex; } }
if (!ctx.clientNode()) { return CU.isPersistentCache(startedCacheCfg, ctx.config().getDataStorageConfiguration()); (byte[])dsCfgBytes, U.resolveClassLoader(ctx.config())); return CU.isPersistentCache(startedCacheCfg, crdDsCfg);
/** * Checks that persistent caches are present with actual data and volatile caches are missing. * * @param cacheData Cache data. * @param dsCfg DataStorageConfiguration. */ private void checkCachesData(Map<Integer, Integer> cacheData, DataStorageConfiguration dsCfg) { for (CacheConfiguration ccfg : cacheConfigurations1()) { if (CU.isPersistentCache(ccfg, dsCfg)) checkCacheData(cacheData, ccfg.getName()); else { for (Ignite node : G.allGrids()) assertTrue(node.cache(ccfg.getName()) == null || node.cache(ccfg.getName()).size() == 0); } } }
/** * */ private void assignPartitionsStates() { try { U.doInParallel( cctx.kernalContext().getSystemExecutorService(), nonLocalCacheGroupDescriptors(), grpDesc -> { CacheGroupContext grpCtx = cctx.cache().cacheGroup(grpDesc.groupId()); GridDhtPartitionTopology top = grpCtx != null ? grpCtx.topology() : cctx.exchange().clientTopology(grpDesc.groupId(), events().discoveryCache()); if (!CU.isPersistentCache(grpDesc.config(), cctx.gridConfig().getDataStorageConfiguration())) assignPartitionSizes(top); else assignPartitionStates(top); return null; } ); } catch (IgniteCheckedException e) { throw new IgniteException("Failed to assign partition states", e); } timeBag.finishGlobalStage("Assign partitions states"); }
if (!CU.isPersistentCache(cc, c.getDataStorageConfiguration())) { throw new IgniteCheckedException("Using encryption is not allowed" + " for not persistent cache [cacheName=" + cc.getName() + ", groupName=" + cc.getGroupName() +
/** * Checks whether given cache configuration should be persisted. * * @param cacheCfg Cache config. * @return {@code True} if cache configuration should be persisted, {@code false} in other case. */ private boolean shouldPersist(CacheConfiguration<?, ?> cacheCfg) { return cctx.pageStore() != null && CU.isPersistentCache(cacheCfg, cctx.gridConfig().getDataStorageConfiguration()) && !cctx.kernalContext().clientNode(); }
/** * */ private void assignPartitionsStates() { long time = System.currentTimeMillis(); for (Map.Entry<Integer, CacheGroupDescriptor> e : cctx.affinity().cacheGroups().entrySet()) { CacheGroupDescriptor grpDesc = e.getValue(); if (grpDesc.config().getCacheMode() == CacheMode.LOCAL) continue; CacheGroupContext grpCtx = cctx.cache().cacheGroup(e.getKey()); GridDhtPartitionTopology top = grpCtx != null ? grpCtx.topology() : cctx.exchange().clientTopology(e.getKey(), events().discoveryCache()); if (!CU.isPersistentCache(grpDesc.config(), cctx.gridConfig().getDataStorageConfiguration())) assignPartitionSizes(top); else assignPartitionStates(top); } if (log.isInfoEnabled()) log.info("Partitions assignment performed in " + (System.currentTimeMillis() - time) + " ms."); }
if (!ctx.clientNode()) { return CU.isPersistentCache(startedCacheCfg, ctx.config().getDataStorageConfiguration()); (byte[])dsCfgBytes, U.resolveClassLoader(ctx.config())); return CU.isPersistentCache(startedCacheCfg, crdDsCfg);
DynamicCacheDescriptor startDesc = c.get1(); if (CU.isPersistentCache(startDesc.cacheConfiguration(), cctx.gridConfig().getDataStorageConfiguration())) startDescs.add(startDesc);
if (!CU.isPersistentCache(cc, c.getDataStorageConfiguration())) { throw new IgniteCheckedException("Using encryption is not allowed" + " for not persistent cache [cacheName=" + cc.getName() + ", groupName=" + cc.getGroupName() +
DynamicCacheDescriptor desc = startReq.descriptor(); if (CU.isPersistentCache(desc.cacheConfiguration(), cctx.gridConfig().getDataStorageConfiguration())) startDescs.add(desc);