/** * @return {@code True} if atomic. */ public boolean atomic() { return cacheCfg.getAtomicityMode() == ATOMIC; }
/** * @return {@code True} if transactional. */ public boolean transactional() { return cacheCfg.getAtomicityMode() == TRANSACTIONAL; }
assert !F.isEmpty(entries); assert cache.configuration().getAtomicityMode() != ATOMIC;
/** * Checks if cache configurations are alike for warmup. * * @param ccfg0 First configuration. * @param ccfg1 Second configuration. * @return {@code True} if configurations match. */ private boolean matches(GridCacheConfiguration ccfg0, GridCacheConfiguration ccfg1) { return F.eq(ccfg0.getCacheMode(), ccfg1.getCacheMode()) && F.eq(ccfg0.getBackups(), ccfg1.getBackups()) && F.eq(ccfg0.getAtomicityMode(), ccfg1.getAtomicityMode()) && F.eq(ccfg0.getAtomicWriteOrderMode(), ccfg1.getAtomicWriteOrderMode()) && F.eq(ccfg0.getMemoryMode(), ccfg1.getMemoryMode()) && F.eq(ccfg0.getDistributionMode(), ccfg1.getDistributionMode()); }
/** {@inheritDoc} */ @Override protected void start0() throws GridException { cfg = ggfsCtx.configuration(); metaCache = ggfsCtx.kernalContext().cache().cache(cfg.getMetaCacheName()); if (metaCache.configuration().getAtomicityMode() != TRANSACTIONAL) throw new GridException("Meta cache should be transactional: " + cfg.getMetaCacheName()); evts = ggfsCtx.kernalContext().event(); sampling = new GridGgfsSamplingKey(cfg.getName()); assert metaCache != null; id2InfoPrj = (GridCacheProjectionEx<GridUuid, GridGgfsFileInfo>)metaCache.<GridUuid, GridGgfsFileInfo>cache(); log = ggfsCtx.kernalContext().log(GridGgfsMetaManager.class); }
/** {@inheritDoc} */ @Override public void onKernalStop0(boolean cancel) { if (cctx.config().getCacheMode() == LOCAL || cctx.config().getAtomicityMode() == ATOMIC) // No-op for local and atomic caches. return; cctx.io().removeHandler(GridCacheDgcRequest.class, reqHnd); cctx.io().removeHandler(GridCacheDgcResponse.class, resHnd); if (reqThread != null) { U.interrupt(reqThread); U.join(reqThread, log); } if (resThread != null) { U.interrupt(resThread); U.join(resThread, log); } if (gcThread != null) { U.interrupt(gcThread); U.join(gcThread, log); } }
/** {@inheritDoc} */ @Override protected void start0() throws GridException { cfg = ggfsCtx.configuration(); metaCache = ggfsCtx.kernalContext().cache().cache(cfg.getMetaCacheName()); metaCacheStartFut = ggfsCtx.kernalContext().cache().internalCache(cfg.getMetaCacheName()).preloader() .startFuture(); if (metaCache.configuration().getAtomicityMode() != TRANSACTIONAL) throw new GridException("Meta cache should be transactional: " + cfg.getMetaCacheName()); evts = ggfsCtx.kernalContext().event(); sampling = new GridGgfsSamplingKey(cfg.getName()); assert metaCache != null; id2InfoPrj = (GridCacheProjectionEx<GridUuid, GridGgfsFileInfo>)metaCache.<GridUuid, GridGgfsFileInfo>cache(); log = ggfsCtx.kernalContext().log(GridGgfsMetaManager.class); }
switch (cfg.getAtomicityMode()) { case TRANSACTIONAL: { cache = new GridLocalCache(cacheCtx); assert false : "Invalid cache atomicity mode: " + cfg.getAtomicityMode(); case REPLICATED: { if (isNearEnabled(cfg)) { switch (cfg.getAtomicityMode()) { case TRANSACTIONAL: { cache = new GridNearTransactionalCache(cacheCtx); assert false : "Invalid cache atomicity mode: " + cfg.getAtomicityMode(); switch (cfg.getAtomicityMode()) { case TRANSACTIONAL: { cache = isAffinityNode(cfg) ? new GridDhtColocatedCache(cacheCtx) : assert false : "Invalid cache atomicity mode: " + cfg.getAtomicityMode(); switch (cfg.getAtomicityMode()) { case TRANSACTIONAL: { assert cache instanceof GridNearTransactionalCache; assert false : "Invalid cache atomicity mode: " + cfg.getAtomicityMode();
if (cctx.config().getCacheMode() == LOCAL || cctx.config().getAtomicityMode() == ATOMIC)
dataCache = ggfsCtx.kernalContext().cache().internalCache(ggfsCtx.configuration().getDataCacheName()); if (dataCache.configuration().getAtomicityMode() != TRANSACTIONAL) throw new GridException("Data cache should be transactional: " + ggfsCtx.configuration().getDataCacheName());
.preloader().startFuture(); if (dataCache.configuration().getAtomicityMode() != TRANSACTIONAL) throw new GridException("Data cache should be transactional: " + ggfsCtx.configuration().getDataCacheName());
cfg.getAtomicityMode() == ATOMIC);
cfg.setPreloadMode(ASYNC); if (cfg.getAtomicityMode() == null) cfg.setAtomicityMode(ATOMIC); if (cfg.getAtomicityMode() == ATOMIC) { if (cfg.getAtomicWriteOrderMode() == null) { cfg.setAtomicWriteOrderMode(cfg.getWriteSynchronizationMode() == FULL_SYNC ?
if (cc.getAtomicityMode() == ATOMIC && cc.getWriteSynchronizationMode() == FULL_ASYNC) U.warn(log, "Cache write synchronization mode is set to FULL_ASYNC. All single-key 'put' and " + "'remove' operations will return 'null', all 'putx' and 'removex' operations will return" + if (cc.getAtomicityMode() == ATOMIC) assertParameter(cc.getTransactionManagerLookupClassName() == null, "transaction manager can not be used with ATOMIC cache");
atomicityMode = cfg.getAtomicityMode(); cacheMode = cfg.getCacheMode(); dfltConcurrency = cfg.getDefaultTxConcurrency();
cfg.mode(ccfg.getCacheMode()); cfg.distributionMode(ccfg.getDistributionMode()); cfg.atomicityMode(ccfg.getAtomicityMode()); cfg.atomicSequenceReserveSize(ccfg.getAtomicSequenceReserveSize()); cfg.atomicWriteOrderMode(ccfg.getAtomicWriteOrderMode());
atomicityMode = cc.getAtomicityMode(); atomicWriteOrderMode = cc.getAtomicWriteOrderMode(); backups = cc.getBackups();