/** * @param ccfg Cache configuration. * @return Data transfer object for default cache configuration properties. */ public static VisorDefaultConfig from(GridCacheConfiguration ccfg) { VisorDefaultConfig cfg = new VisorDefaultConfig(); cfg.txIsolation(ccfg.getDefaultTxIsolation()); cfg.txConcurrency(ccfg.getDefaultTxConcurrency()); cfg.timeToLive(ccfg.getDefaultTimeToLive()); cfg.txTimeout(ccfg.getDefaultTxTimeout()); cfg.txLockTimeout(ccfg.getDefaultLockTimeout()); cfg.queryTimeout(ccfg.getDefaultQueryTimeout()); return cfg; }
/** * @param key Entry key. * @param topVer Topology version at the time of creation. * @param create Flag to create entry if it does not exist. * @param touch Flag to touch created entry (only if entry was actually created). * @return Entry or <tt>null</tt>. */ @Nullable private GridCacheEntryEx<K, V> entry0(K key, long topVer, boolean create, boolean touch) { GridTriple<GridCacheMapEntry<K, V>> t = map.putEntryIfObsoleteOrAbsent(topVer, key, null, ctx.config().getDefaultTimeToLive(), create); GridCacheEntryEx<K, V> cur = t.get1(); GridCacheEntryEx<K, V> created = t.get2(); GridCacheEntryEx<K, V> doomed = t.get3(); if (doomed != null && ctx.events().isRecordable(EVT_CACHE_ENTRY_DESTROYED)) // Event notification. ctx.events().addEvent(doomed.partition(), doomed.key(), locNodeId, (GridUuid)null, null, EVT_CACHE_ENTRY_DESTROYED, null, false, null, false, null, null, null); if (created != null) { // Event notification. if (ctx.events().isRecordable(EVT_CACHE_ENTRY_CREATED)) ctx.events().addEvent(created.partition(), created.key(), locNodeId, (GridUuid)null, null, EVT_CACHE_ENTRY_CREATED, null, false, null, false, null, null, null); if (touch) ctx.evicts().touch(cur, topVer); } return cur; }
storeValBytes = cfg.isStoreValueBytes(); swapEnabled = cfg.isSwapEnabled(); ttl = cfg.getDefaultTimeToLive(); txBatchUpdate = cfg.isBatchUpdateOnCommit(); txSerEnabled = cfg.isTxSerializableEnabled();
swapEnabled = cc.isSwapEnabled(); tmLookupClsName = cc.getTransactionManagerLookupClassName(); ttl = cc.getDefaultTimeToLive(); txBatchUpdate = cc.isBatchUpdateOnCommit(); txSerEnabled = cc.isTxSerializableEnabled();