# ignite-670 removed defaultTtl from configuration

Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/93912fef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/93912fef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/93912fef

Branch: refs/heads/ignite-sprint-3
Commit: 93912fefab66605c2cbca4447753385b07c9cb1a
Parents: fd51341
Author: sboikov <sboi...@gridgain.com>
Authored: Thu Apr 2 15:22:47 2015 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Thu Apr 2 15:22:47 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       | 29 -----------
 .../processors/cache/GridCacheAdapter.java      |  3 +-
 .../processors/cache/GridCacheAttributes.java   |  8 ---
 .../cache/GridCacheConcurrentMap.java           | 34 +++++--------
 .../processors/cache/GridCacheMapEntry.java     | 28 ++++++-----
 .../cache/GridCacheMapEntryFactory.java         |  2 -
 .../processors/cache/GridCacheProcessor.java    |  3 --
 .../distributed/GridDistributedCacheEntry.java  |  4 +-
 .../distributed/dht/GridDhtCacheAdapter.java    | 16 ++++--
 .../distributed/dht/GridDhtCacheEntry.java      |  4 +-
 .../distributed/dht/GridNoStorageCacheMap.java  | 11 +++--
 .../dht/atomic/GridDhtAtomicCache.java          |  3 +-
 .../dht/atomic/GridDhtAtomicCacheEntry.java     |  4 +-
 .../dht/colocated/GridDhtColocatedCache.java    |  5 +-
 .../colocated/GridDhtColocatedCacheEntry.java   |  4 +-
 .../colocated/GridDhtDetachedCacheEntry.java    |  5 +-
 .../distributed/near/GridNearCacheAdapter.java  |  3 +-
 .../distributed/near/GridNearCacheEntry.java    |  4 +-
 .../processors/cache/local/GridLocalCache.java  |  3 +-
 .../cache/local/GridLocalCacheEntry.java        |  3 +-
 .../local/atomic/GridLocalAtomicCache.java      |  3 +-
 .../cache/VisorCacheDefaultConfiguration.java   | 11 -----
 ...idCacheConfigurationConsistencySelfTest.java |  3 --
 .../GridCacheDhtEvictionsDisabledSelfTest.java  |  8 +--
 .../distributed/dht/GridCacheDhtTestUtils.java  |  2 +-
 .../loadtests/hashmap/GridHashMapLoadTest.java  |  2 +-
 .../cache/ttl/CacheTtlAbstractSelfTest.java     |  5 +-
 .../IgniteCacheWithIndexingTestSuite.java       | 51 ++++++++++++++++++++
 .../IgniteH2IndexingSpiTestSuite.java           | 18 -------
 .../commands/cache/VisorCacheCommand.scala      |  1 -
 30 files changed, 121 insertions(+), 159 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 8d5ba6c..22148ad 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -63,12 +63,6 @@ public class CacheConfiguration<K, V> extends 
MutableConfiguration<K, V> {
     /** Time in milliseconds to wait between rebalance messages to avoid 
overloading CPU. */
     public static final long DFLT_REBALANCE_THROTTLE = 0;
 
-    /**
-     * Default time to live. The value is <tt>0</tt> which means that
-     * cached objects never expire based on time.
-     */
-    public static final long DFLT_TIME_TO_LIVE = 0;
-
     /** Default number of backups. */
     public static final int DFLT_BACKUPS = 0;
 
@@ -180,9 +174,6 @@ public class CacheConfiguration<K, V> extends 
MutableConfiguration<K, V> {
     /** Rebalance timeout. */
     private long rebalanceTimeout = DFLT_REBALANCE_TIMEOUT;
 
-    /** Default time to live for cache entries. */
-    private long ttl = DFLT_TIME_TO_LIVE;
-
     /** Cache expiration policy. */
     private EvictionPolicy evictPlc;
 
@@ -405,7 +396,6 @@ public class CacheConfiguration<K, V> extends 
MutableConfiguration<K, V> {
         storeFactory = cc.getCacheStoreFactory();
         swapEnabled = cc.isSwapEnabled();
         tmLookupClsName = cc.getTransactionManagerLookupClassName();
-        ttl = cc.getDefaultTimeToLive();
         typeMeta = cc.getTypeMetadata();
         writeBehindBatchSize = cc.getWriteBehindBatchSize();
         writeBehindEnabled = cc.isWriteBehindEnabled();
@@ -439,25 +429,6 @@ public class CacheConfiguration<K, V> extends 
MutableConfiguration<K, V> {
     }
 
     /**
-     * Gets time to live for all objects in cache. This value can be 
overridden for individual objects.
-     * If not set, then value is {@code 0} which means that objects never 
expire.
-     *
-     * @return Time to live for all objects in cache.
-     */
-    public long getDefaultTimeToLive() {
-        return ttl;
-    }
-
-    /**
-     * Sets time to live for all objects in cache. This value can be override 
for individual objects.
-     *
-     * @param ttl Time to live for all objects in cache.
-     */
-    public void setDefaultTimeToLive(long ttl) {
-        this.ttl = ttl;
-    }
-
-    /**
      * Gets cache eviction policy. By default, returns {@code null}
      * which means that evictions are disabled for cache.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index eb1a98f..1d53444 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1121,8 +1121,7 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
      */
     @Nullable private GridCacheEntryEx entry0(KeyCacheObject key, 
AffinityTopologyVersion topVer, boolean create,
         boolean touch) {
-        GridTriple<GridCacheMapEntry> t = 
map.putEntryIfObsoleteOrAbsent(topVer, key, null,
-            ctx.config().getDefaultTimeToLive(), create);
+        GridTriple<GridCacheMapEntry> t = 
map.putEntryIfObsoleteOrAbsent(topVer, key, null, create);
 
         GridCacheEntryEx cur = t.get1();
         GridCacheEntryEx created = t.get2();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index 496817e..755b89a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -198,14 +198,6 @@ public class GridCacheAttributes implements Serializable {
         return ccfg.isSwapEnabled();
     }
 
-
-    /**
-     * @return Default time to live for cache entries.
-     */
-    public long defaultTimeToLive() {
-        return ccfg.getDefaultTimeToLive();
-    }
-
     /**
      * @return Flag indicating whether eviction is synchronized.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index f45d00e..5e9c2da 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -461,24 +461,22 @@ public class GridCacheConcurrentMap {
      * @param topVer Topology version.
      * @param key Key.
      * @param val Value.
-     * @param ttl Time to live.
      * @return Cache entry for corresponding key-value pair.
      */
-    public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer, 
KeyCacheObject key, @Nullable CacheObject val, long ttl) {
+    public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer, 
KeyCacheObject key, @Nullable CacheObject val) {
         assert key != null;
 
         checkWeakQueue();
 
         int hash = hash(key.hashCode());
 
-        return segmentFor(hash).put(key, hash, val, topVer, ttl);
+        return segmentFor(hash).put(key, hash, val, topVer);
     }
 
     /**
      * @param topVer Topology version.
      * @param key Key.
      * @param val Value.
-     * @param ttl Time to live.
      * @param create Create flag.
      * @return Triple where the first element is current entry associated with 
the key,
      *      the second is created entry and the third is doomed (all may be 
null).
@@ -487,7 +485,6 @@ public class GridCacheConcurrentMap {
         AffinityTopologyVersion topVer,
         KeyCacheObject key,
         @Nullable CacheObject val,
-        long ttl,
         boolean create)
     {
         assert key != null;
@@ -496,7 +493,7 @@ public class GridCacheConcurrentMap {
 
         int hash = hash(key.hashCode());
 
-        return segmentFor(hash).putIfObsolete(key, hash, val, topVer, ttl, 
create);
+        return segmentFor(hash).putIfObsolete(key, hash, val, topVer, create);
     }
 
     /**
@@ -505,12 +502,11 @@ public class GridCacheConcurrentMap {
      * this map had for any of the keys currently in the specified map.
      *
      * @param m mappings to be stored in this map.
-     * @param ttl Time to live.
      * @throws NullPointerException If the specified map is null.
      */
-    public void putAll(Map<KeyCacheObject, CacheObject> m, long ttl) {
+    public void putAll(Map<KeyCacheObject, CacheObject> m) {
         for (Map.Entry<KeyCacheObject, CacheObject> e : m.entrySet())
-            putEntry(AffinityTopologyVersion.NONE, e.getKey(), e.getValue(), 
ttl);
+            putEntry(AffinityTopologyVersion.NONE, e.getKey(), e.getValue());
     }
 
     /**
@@ -896,15 +892,14 @@ public class GridCacheConcurrentMap {
          * @param hash Hash.
          * @param val Value.
          * @param topVer Topology version.
-         * @param ttl TTL.
          * @return Associated value.
          */
         @SuppressWarnings({"unchecked"})
-        GridCacheMapEntry put(KeyCacheObject key, int hash, @Nullable 
CacheObject val, AffinityTopologyVersion topVer, long ttl) {
+        GridCacheMapEntry put(KeyCacheObject key, int hash, @Nullable 
CacheObject val, AffinityTopologyVersion topVer) {
             lock();
 
             try {
-                return put0(key, hash, val, topVer, ttl);
+                return put0(key, hash, val, topVer);
             }
             finally {
                 unlock();
@@ -916,11 +911,10 @@ public class GridCacheConcurrentMap {
          * @param hash Hash.
          * @param val Value.
          * @param topVer Topology version.
-         * @param ttl TTL.
          * @return Associated value.
          */
         @SuppressWarnings({"unchecked", 
"SynchronizationOnLocalVariableOrMethodParameter"})
-        private GridCacheMapEntry put0(KeyCacheObject key, int hash, 
CacheObject val, AffinityTopologyVersion topVer, long ttl) {
+        private GridCacheMapEntry put0(KeyCacheObject key, int hash, 
CacheObject val, AffinityTopologyVersion topVer) {
             try {
                 SegmentHeader hdr = this.hdr;
 
@@ -950,12 +944,12 @@ public class GridCacheConcurrentMap {
                 if (e != null) {
                     retVal = e;
 
-                    e.rawPut(val, ttl);
+                    e.rawPut(val, 0);
                 }
                 else {
                     GridCacheMapEntry next = bin != null ? bin : null;
 
-                    GridCacheMapEntry newRoot = factory.create(ctx, topVer, 
key, hash, val, next, ttl, hdr.id());
+                    GridCacheMapEntry newRoot = factory.create(ctx, topVer, 
key, hash, val, next, hdr.id());
 
                     // Avoiding delete (decrement) before creation (increment).
                     synchronized (newRoot) {
@@ -989,7 +983,6 @@ public class GridCacheConcurrentMap {
          * @param hash Hash.
          * @param val Value.
          * @param topVer Topology version.
-         * @param ttl TTL.
          * @param create Create flag.
          * @return Triple where the first element is current entry associated 
with the key,
          *      the second is created entry and the third is doomed (all may 
be null).
@@ -999,7 +992,6 @@ public class GridCacheConcurrentMap {
             int hash,
             @Nullable CacheObject val,
             AffinityTopologyVersion topVer,
-            long ttl,
             boolean create)
         {
             lock();
@@ -1021,7 +1013,7 @@ public class GridCacheConcurrentMap {
 
                 if (bin == null) {
                     if (create)
-                        cur = created = put0(key, hash, val, topVer, ttl);
+                        cur = created = put0(key, hash, val, topVer);
 
                     return new GridTriple<>(cur, created, doomed);
                 }
@@ -1036,13 +1028,13 @@ public class GridCacheConcurrentMap {
                         doomed = remove(key, hash, null);
 
                         if (create)
-                            cur = created = put0(key, hash, val, topVer, ttl);
+                            cur = created = put0(key, hash, val, topVer);
                     }
                     else
                         cur = e;
                 }
                 else if (create)
-                    cur = created = put0(key, hash, val, topVer, ttl);
+                    cur = created = put0(key, hash, val, topVer);
 
                 return new GridTriple<>(cur, created, doomed);
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 58ff57f..78045d2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -139,7 +139,6 @@ public abstract class GridCacheMapEntry implements 
GridCacheEntryEx {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Header id.
      */
     protected GridCacheMapEntry(GridCacheContext<?, ?> cctx,
@@ -147,7 +146,6 @@ public abstract class GridCacheMapEntry implements 
GridCacheEntryEx {
         int hash,
         CacheObject val,
         GridCacheMapEntry next,
-        long ttl,
         int hdrId)
     {
         if (log == null)
@@ -161,8 +159,6 @@ public abstract class GridCacheMapEntry implements 
GridCacheEntryEx {
         this.hash = hash;
         this.cctx = cctx;
 
-        ttlAndExpireTimeExtras(ttl, CU.toExpireTime(ttl));
-
         val = cctx.kernalContext().cacheObjects().prepareForCache(val, cctx);
 
         synchronized (this) {
@@ -3515,19 +3511,25 @@ public abstract class GridCacheMapEntry implements 
GridCacheEntryEx {
                 boolean expired = checkExpired();
 
                 if (expired) {
-                    if (cctx.deferredDelete() && !detached() && !isInternal()) 
{
-                        if (!deletedUnlocked()) {
-                            update(null, 0L, 0L, ver);
+                    if (!obsolete()) {
+                        if (cctx.deferredDelete() && !detached() && 
!isInternal()) {
+                            if (!deletedUnlocked()) {
+                                update(null, 0L, 0L, ver);
 
-                            deletedUnlocked(true);
+                                deletedUnlocked(true);
 
-                            deferred = true;
+                                deferred = true;
+                            }
+                        }
+                        else {
+                            if (markObsolete0(obsoleteVer, true))
+                                obsolete = true; // Success, will return 
"true".
                         }
                     }
-                    else {
-                        if (markObsolete0(obsoleteVer, true))
-                            obsolete = true; // Success, will return "true".
-                    }
+
+                    clearIndex(saveValueForIndexUnlocked());
+
+                    releaseSwap();
 
                     if (cctx.events().isRecordable(EVT_CACHE_OBJECT_EXPIRED)) {
                         cctx.events().addEvent(partition(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
index 1e56674..2c7c28d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
@@ -31,7 +31,6 @@ public interface GridCacheMapEntryFactory {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Header id.
      * @return New cache entry.
      */
@@ -41,6 +40,5 @@ public interface GridCacheMapEntryFactory {
         int hash,
         CacheObject val,
         @Nullable GridCacheMapEntry next,
-        long ttl,
         int hdrId);
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 00852fc..91c35f4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1967,9 +1967,6 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
             CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, 
"defaultLockTimeout",
                 "Default lock timeout", locAttr.defaultLockTimeout(), 
rmtAttr.defaultLockTimeout(), false);
 
-            CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, 
"defaultTimeToLive",
-                "Default time to live", locAttr.defaultTimeToLive(), 
rmtAttr.defaultTimeToLive(), false);
-
             CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, 
"preloadBatchSize",
                 "Preload batch size", locAttr.rebalanceBatchSize(), 
rmtAttr.rebalanceBatchSize(), false);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
index a1d83d5..0947a8e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
@@ -42,7 +42,6 @@ public class GridDistributedCacheEntry extends 
GridCacheMapEntry {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Cache map header ID.
      */
     public GridDistributedCacheEntry(GridCacheContext ctx,
@@ -50,10 +49,9 @@ public class GridDistributedCacheEntry extends 
GridCacheMapEntry {
         int hash,
         CacheObject val,
         GridCacheMapEntry next,
-        long ttl,
         int hdrId)
     {
-        super(ctx, key, hash, val, next, ttl, hdrId);
+        super(ctx, key, hash, val, next, hdrId);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 6c27566..5594feb 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -94,9 +94,15 @@ public abstract class GridDhtCacheAdapter<K, V> extends 
GridDistributedCacheAdap
     @Override protected void init() {
         map.setEntryFactory(new GridCacheMapEntryFactory() {
             /** {@inheritDoc} */
-            @Override public GridCacheMapEntry create(GridCacheContext ctx, 
AffinityTopologyVersion topVer, KeyCacheObject key, int hash,
-                CacheObject val, GridCacheMapEntry next, long ttl, int hdrId) {
-                return new GridDhtCacheEntry(ctx, topVer, key, hash, val, 
next, ttl, hdrId);
+            @Override public GridCacheMapEntry create(GridCacheContext ctx,
+                AffinityTopologyVersion topVer,
+                KeyCacheObject key,
+                int hash,
+                CacheObject val,
+                GridCacheMapEntry next,
+                int hdrId)
+            {
+                return new GridDhtCacheEntry(ctx, topVer, key, hash, val, 
next, hdrId);
             }
         });
     }
@@ -346,14 +352,14 @@ public abstract class GridDhtCacheAdapter<K, V> extends 
GridDistributedCacheAdap
     public GridCacheEntryEx entryExx(KeyCacheObject key, 
AffinityTopologyVersion topVer, boolean allowDetached, boolean touch) {
         try {
             return allowDetached && !ctx.affinity().localNode(key, topVer) ?
-                new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, 
null, 0, 0) :
+                new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, 
null, 0) :
                 entryEx(key, touch);
         }
         catch (GridDhtInvalidPartitionException e) {
             if (!allowDetached)
                 throw e;
 
-            return new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), 
null, null, 0, 0);
+            return new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), 
null, null, 0);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
index 7195d1c..35ac08b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
@@ -63,7 +63,6 @@ public class GridDhtCacheEntry extends 
GridDistributedCacheEntry {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Header id.
      */
     public GridDhtCacheEntry(GridCacheContext ctx,
@@ -72,10 +71,9 @@ public class GridDhtCacheEntry extends 
GridDistributedCacheEntry {
         int hash,
         CacheObject val,
         GridCacheMapEntry next,
-        long ttl,
         int hdrId)
     {
-        super(ctx, key, hash, val, next, ttl, hdrId);
+        super(ctx, key, hash, val, next, hdrId);
 
         // Record this entry with partition.
         locPart = ctx.dht().topology().onAdded(topVer, this);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
index 7bcc5c3..8da4da5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
@@ -71,7 +71,10 @@ public class GridNoStorageCacheMap extends 
GridCacheConcurrentMap {
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheMapEntry putEntry(AffinityTopologyVersion 
topVer, KeyCacheObject key, @Nullable CacheObject val, long ttl) {
+    @Override public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer,
+        KeyCacheObject key,
+        @Nullable CacheObject val)
+    {
         throw new AssertionError();
     }
 
@@ -80,12 +83,10 @@ public class GridNoStorageCacheMap extends 
GridCacheConcurrentMap {
         AffinityTopologyVersion topVer,
         KeyCacheObject key,
         @Nullable CacheObject val,
-        long ttl,
         boolean create)
     {
         if (create) {
-            GridCacheMapEntry entry = new GridDhtCacheEntry(ctx, topVer, key, 
hash(key.hashCode()), val,
-                null, 0, 0);
+            GridCacheMapEntry entry = new GridDhtCacheEntry(ctx, topVer, key, 
hash(key.hashCode()), val, null, 0);
 
             return new GridTriple<>(entry, null, null);
         }
@@ -94,7 +95,7 @@ public class GridNoStorageCacheMap extends 
GridCacheConcurrentMap {
     }
 
     /** {@inheritDoc} */
-    @Override public void putAll(Map<KeyCacheObject, CacheObject> m, long ttl) 
{
+    @Override public void putAll(Map<KeyCacheObject, CacheObject> m) {
         throw new AssertionError();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index c376fa0..6e7c17f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -133,10 +133,9 @@ public class GridDhtAtomicCache<K, V> extends 
GridDhtCacheAdapter<K, V> {
                 int hash,
                 CacheObject val,
                 GridCacheMapEntry next,
-                long ttl,
                 int hdrId)
             {
-                return new GridDhtAtomicCacheEntry(ctx, topVer, key, hash, 
val, next, ttl, hdrId);
+                return new GridDhtAtomicCacheEntry(ctx, topVer, key, hash, 
val, next, hdrId);
             }
         });
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
index c918e1e..9ded1f1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
@@ -33,7 +33,6 @@ public class GridDhtAtomicCacheEntry extends 
GridDhtCacheEntry {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Header id.
      */
     public GridDhtAtomicCacheEntry(GridCacheContext ctx,
@@ -42,10 +41,9 @@ public class GridDhtAtomicCacheEntry extends 
GridDhtCacheEntry {
         int hash,
         CacheObject val,
         GridCacheMapEntry next,
-        long ttl,
         int hdrId)
     {
-        super(ctx, topVer, key, hash, val, next, ttl, hdrId);
+        super(ctx, topVer, key, hash, val, next, hdrId);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index eb6d9a6..77224ca 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -87,10 +87,9 @@ public class GridDhtColocatedCache<K, V> extends 
GridDhtTransactionalCacheAdapte
                 int hash,
                 CacheObject val,
                 GridCacheMapEntry next,
-                long ttl,
                 int hdrId)
             {
-                return new GridDhtColocatedCacheEntry(ctx, topVer, key, hash, 
val, next, ttl, hdrId);
+                return new GridDhtColocatedCacheEntry(ctx, topVer, key, hash, 
val, next, hdrId);
             }
         });
     }
@@ -130,7 +129,7 @@ public class GridDhtColocatedCache<K, V> extends 
GridDhtTransactionalCacheAdapte
         boolean allowDetached
     ) {
         return allowDetached && !ctx.affinity().primary(ctx.localNode(), key, 
topVer) ?
-            new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, 
null, 0, 0) : entryExx(key, topVer);
+            new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, 
null, 0) : entryExx(key, topVer);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
index 1ccc0da..fab9605 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
@@ -33,7 +33,6 @@ public class GridDhtColocatedCacheEntry extends 
GridDhtCacheEntry {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Header id.
      */
     public GridDhtColocatedCacheEntry(GridCacheContext ctx,
@@ -42,10 +41,9 @@ public class GridDhtColocatedCacheEntry extends 
GridDhtCacheEntry {
         int hash,
         CacheObject val,
         GridCacheMapEntry next,
-        long ttl,
         int hdrId
     ) {
-        super(ctx, topVer, key, hash, val, next, ttl, hdrId);
+        super(ctx, topVer, key, hash, val, next, hdrId);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
index 77547db..5c4dd13 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
@@ -34,12 +34,11 @@ public class GridDhtDetachedCacheEntry extends 
GridDistributedCacheEntry {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Header ID.
      */
     public GridDhtDetachedCacheEntry(GridCacheContext ctx, KeyCacheObject key, 
int hash, CacheObject val,
-        GridCacheMapEntry next, long ttl, int hdrId) {
-        super(ctx, key, hash, val, next, ttl, hdrId);
+        GridCacheMapEntry next, int hdrId) {
+        super(ctx, key, hash, val, next, hdrId);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 75c8978..846efff 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -75,12 +75,11 @@ public abstract class GridNearCacheAdapter<K, V> extends 
GridDistributedCacheAda
                 int hash,
                 CacheObject val,
                 GridCacheMapEntry next,
-                long ttl,
                 int hdrId
             ) {
                 // Can't hold any locks here - this method is invoked when
                 // holding write-lock on the whole cache map.
-                return new GridNearCacheEntry(ctx, key, hash, val, next, ttl, 
hdrId);
+                return new GridNearCacheEntry(ctx, key, hash, val, next, 
hdrId);
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index ce80ad9..13089aa 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@ -58,7 +58,6 @@ public class GridNearCacheEntry extends 
GridDistributedCacheEntry {
      * @param hash Key hash value.
      * @param val Entry value.
      * @param next Next entry in the linked list.
-     * @param ttl Time to live.
      * @param hdrId Header id.
      */
     public GridNearCacheEntry(GridCacheContext ctx,
@@ -66,10 +65,9 @@ public class GridNearCacheEntry extends 
GridDistributedCacheEntry {
         int hash,
         CacheObject val,
         GridCacheMapEntry next,
-        long ttl,
         int hdrId)
     {
-        super(ctx, key, hash, val, next, ttl, hdrId);
+        super(ctx, key, hash, val, next, hdrId);
 
         part = ctx.affinity().partition(key);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
index 272dca6..5780144 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
@@ -79,10 +79,9 @@ public class GridLocalCache<K, V> extends 
GridCacheAdapter<K, V> {
                 int hash,
                 CacheObject val,
                 GridCacheMapEntry next,
-                long ttl,
                 int hdrId
             ) {
-                return new GridLocalCacheEntry(ctx, key, hash, val, next, ttl, 
hdrId);
+                return new GridLocalCacheEntry(ctx, key, hash, val, next, 
hdrId);
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
index db8038d..d05d1bb 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
@@ -43,10 +43,9 @@ public class GridLocalCacheEntry extends GridCacheMapEntry {
         int hash,
         CacheObject val,
         GridCacheMapEntry next,
-        long ttl,
         int hdrId)
     {
-        super(ctx, key, hash, val, next, ttl, hdrId);
+        super(ctx, key, hash, val, next, hdrId);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index a9a6f23..d276501 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -81,10 +81,9 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
                 int hash,
                 CacheObject val,
                 @Nullable GridCacheMapEntry next,
-                long ttl,
                 int hdrId
             ) {
-                return new GridLocalCacheEntry(ctx, key, hash, val, next, ttl, 
hdrId);
+                return new GridLocalCacheEntry(ctx, key, hash, val, next, 
hdrId);
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
index 858ba75..a0d9990 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
@@ -29,9 +29,6 @@ public class VisorCacheDefaultConfiguration implements 
Serializable {
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** TTL value. */
-    private long ttl;
-
     /** Default transaction timeout. */
     private long txLockTimeout;
 
@@ -45,20 +42,12 @@ public class VisorCacheDefaultConfiguration implements 
Serializable {
     public static VisorCacheDefaultConfiguration from(CacheConfiguration ccfg) 
{
         VisorCacheDefaultConfiguration cfg = new 
VisorCacheDefaultConfiguration();
 
-        cfg.ttl = ccfg.getDefaultTimeToLive();
         cfg.txLockTimeout = ccfg.getDefaultLockTimeout();
 
         return cfg;
     }
 
     /**
-     * @return TTL value.
-     */
-    public long timeToLive() {
-        return ttl;
-    }
-
-    /**
      * @return Default transaction timeout.
      */
     public long txLockTimeout() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
index 3737f46..44171a8 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
@@ -576,7 +576,6 @@ public class GridCacheConfigurationConsistencySelfTest 
extends GridCommonAbstrac
             /** {@inheritDoc} */
             @Override public Void apply(CacheConfiguration cfg) {
                 cfg.setDefaultLockTimeout(1000);
-                cfg.setDefaultTimeToLive(1000);
 
                 return null;
             }
@@ -590,7 +589,6 @@ public class GridCacheConfigurationConsistencySelfTest 
extends GridCommonAbstrac
             /** {@inheritDoc} */
             @Override public Void apply(CacheConfiguration cfg) {
                 cfg.setDefaultLockTimeout(2 * 1000);
-                cfg.setDefaultTimeToLive(2 * 1000);
 
                 return null;
             }
@@ -601,7 +599,6 @@ public class GridCacheConfigurationConsistencySelfTest 
extends GridCommonAbstrac
         String log = strLog.toString();
 
         assertTrue(log.contains("Default lock timeout"));
-        assertTrue(log.contains("Default time to live"));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
index c35f106..6662413 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache.distributed.dht;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -26,6 +25,8 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.apache.ignite.testframework.junits.common.*;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
 
 /**
  * Test cache closure execution.
@@ -54,9 +55,8 @@ public class GridCacheDhtEvictionsDisabledSelfTest extends 
GridCommonAbstractTes
         CacheConfiguration cc = defaultCacheConfiguration();
 
         cc.setName("test");
-        cc.setCacheMode(CacheMode.PARTITIONED);
-        cc.setDefaultTimeToLive(0);
-        
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cc.setCacheMode(PARTITIONED);
+        cc.setWriteSynchronizationMode(FULL_SYNC);
         cc.setAtomicityMode(TRANSACTIONAL);
         cc.setNearConfiguration(null);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
index 51a3d1c..765fd0e 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
@@ -71,7 +71,7 @@ public class GridCacheDhtTestUtils {
         for (int i = 0; i < keyCnt; i++) {
             KeyCacheObject cacheKey = ctx.toCacheKeyObject(i);
 
-            cacheMap.putEntry(AffinityTopologyVersion.NONE, cacheKey, 
ctx.toCacheKeyObject("value" + i), 0);
+            cacheMap.putEntry(AffinityTopologyVersion.NONE, cacheKey, 
ctx.toCacheKeyObject("value" + i));
 
             dht.preloader().request(Collections.singleton(cacheKey), 
AffinityTopologyVersion.NONE);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
 
b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
index 00ee851..de85025 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
@@ -80,7 +80,7 @@ public class GridHashMapLoadTest extends 
GridCommonAbstractTest {
             Integer val = i++;
 
             map.put(key, new GridCacheMapEntry(ctx, ctx.toCacheKeyObject(key),
-                key.hashCode(), ctx.toCacheObject(val), null, 0, 1) {
+                key.hashCode(), ctx.toCacheObject(val), null, 1) {
                 @Override public boolean tmLock(IgniteInternalTx tx, long 
timeout) {
                     return false;
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
index 552e2ea..ebe6f16 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.apache.ignite.testframework.junits.common.*;
 
+import javax.cache.configuration.*;
 import javax.cache.expiry.*;
 import java.util.*;
 
@@ -58,10 +59,12 @@ public abstract class CacheTtlAbstractSelfTest extends 
GridCommonAbstractTest {
         cache.setAtomicityMode(atomicityMode());
         cache.setMemoryMode(memoryMode());
         cache.setOffHeapMaxMemory(0);
-        cache.setDefaultTimeToLive(DEFAULT_TIME_TO_LIVE);
         cache.setEvictionPolicy(new LruEvictionPolicy(MAX_CACHE_SIZE));
         cache.setIndexedTypes(Integer.class, Integer.class);
 
+        cache.setExpiryPolicyFactory(
+            FactoryBuilder.factoryOf(new TouchedExpiryPolicy(new 
Duration(MILLISECONDS, DEFAULT_TIME_TO_LIVE))));
+
         cfg.setCacheConfiguration(cache);
 
         TcpDiscoverySpi disco = new TcpDiscoverySpi();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
new file mode 100644
index 0000000..ba6fe36
--- /dev/null
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.ttl.*;
+
+/**
+ * Cache tests using indexing.
+ */
+public class IgniteCacheWithIndexingTestSuite extends TestSuite {
+    /**
+     * @return Test suite.
+     * @throws Exception Thrown in case of the failure.
+     */
+    public static TestSuite suite() throws Exception {
+        TestSuite suite = new TestSuite("Ignite Cache With Indexing Test 
Suite");
+
+        suite.addTestSuite(GridCacheOffHeapAndSwapSelfTest.class);
+        suite.addTestSuite(GridIndexingWithNoopSwapSelfTest.class);
+        suite.addTestSuite(GridCacheSwapSelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapSelfTest.class);
+
+        suite.addTestSuite(CacheTtlOffheapAtomicLocalSelfTest.class);
+        suite.addTestSuite(CacheTtlOffheapAtomicPartitionedSelfTest.class);
+        suite.addTestSuite(CacheTtlOffheapTransactionalLocalSelfTest.class);
+        
suite.addTestSuite(CacheTtlOffheapTransactionalPartitionedSelfTest.class);
+        suite.addTestSuite(CacheTtlOnheapTransactionalLocalSelfTest.class);
+        
suite.addTestSuite(CacheTtlOnheapTransactionalPartitionedSelfTest.class);
+        suite.addTestSuite(CacheTtlOnheapAtomicLocalSelfTest.class);
+        suite.addTestSuite(CacheTtlOnheapAtomicPartitionedSelfTest.class);
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
index 21076bd..3aff923 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
@@ -18,8 +18,6 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.ttl.*;
 import org.apache.ignite.internal.processors.query.h2.*;
 import org.apache.ignite.internal.processors.query.h2.opt.*;
 
@@ -46,22 +44,6 @@ public class IgniteH2IndexingSpiTestSuite extends TestSuite {
         // Index rebuilding.
         suite.addTest(new TestSuite(GridH2IndexRebuildTest.class));
 
-        // Tests moved to this suite since they require GridH2IndexingSpi.
-        suite.addTestSuite(GridCacheOffHeapAndSwapSelfTest.class);
-        suite.addTestSuite(GridIndexingWithNoopSwapSelfTest.class);
-        suite.addTestSuite(GridCacheSwapSelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapSelfTest.class);
-
-        //ttl
-        suite.addTestSuite(CacheTtlOffheapAtomicLocalSelfTest.class);
-        suite.addTestSuite(CacheTtlOffheapAtomicPartitionedSelfTest.class);
-        suite.addTestSuite(CacheTtlOffheapTransactionalLocalSelfTest.class);
-        
suite.addTestSuite(CacheTtlOffheapTransactionalPartitionedSelfTest.class);
-        suite.addTestSuite(CacheTtlOnheapTransactionalLocalSelfTest.class);
-        
suite.addTestSuite(CacheTtlOnheapTransactionalPartitionedSelfTest.class);
-        suite.addTestSuite(CacheTtlOnheapAtomicLocalSelfTest.class);
-        suite.addTestSuite(CacheTtlOnheapAtomicPartitionedSelfTest.class);
-
         return suite;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git 
a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
 
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index eb6e040..4365364 100644
--- 
a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ 
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -766,7 +766,6 @@ object VisorCacheCommand {
         cacheT += ("Statistic Enabled", bool2Str(cfg.statisticsEnabled()))
         cacheT += ("Management Enabled", bool2Str(cfg.managementEnabled()))
 
-        cacheT += ("Time To Live", defaultCfg.timeToLive())
         cacheT += ("Time To Live Eager Flag", cfg.eagerTtl)
 
         cacheT += ("Write Synchronization Mode", 
safe(cfg.writeSynchronizationMode))

Reply via email to