You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/24 14:42:10 UTC

[1/7] ignite git commit: IGNITE-5066 .NET: Add continuous query test to verify that the problem from 1.9 no longer reproduces

Repository: ignite
Updated Branches:
  refs/heads/ignite-5009 8ff65316d -> 956e02938


IGNITE-5066 .NET: Add continuous query test to verify that the problem from 1.9 no longer reproduces


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

Branch: refs/heads/ignite-5009
Commit: 5a433469afca394fc97b59cc16dbe83b2d24f8c5
Parents: 1214d7e
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Mon Apr 24 14:09:01 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Mon Apr 24 14:09:01 2017 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core.Tests.csproj             |   1 +
 .../Query/Continuous/ContinuousQueryTest.cs     | 115 +++++++++++++++++++
 2 files changed, 116 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5a433469/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index f4f5e59..c6b183b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -101,6 +101,7 @@
     <Compile Include="Cache\Query\CacheDmlQueriesTestSimpleName.cs" />
     <Compile Include="Cache\Query\CacheLinqTestSimpleName.cs" />
     <Compile Include="Cache\Query\CacheQueriesTestSimpleName.cs" />
+    <Compile Include="Cache\Query\Continuous\ContinuousQueryTest.cs" />
     <Compile Include="Cache\Store\CacheStoreAdapterTest.cs" />
     <Compile Include="Cache\Store\NamedNodeCacheStoreTest.cs" />
     <Compile Include="Cache\TestReferenceObject.cs" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/5a433469/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryTest.cs
new file mode 100644
index 0000000..5148dcc
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryTest.cs
@@ -0,0 +1,115 @@
+\ufeff/*
+ * 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.
+ */
+
+
+namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
+{
+    using System;
+    using System.Collections.Concurrent;
+    using System.Collections.Generic;
+    using System.Threading;
+    using Apache.Ignite.Core.Cache;
+    using Apache.Ignite.Core.Cache.Event;
+    using Apache.Ignite.Core.Cache.Query.Continuous;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests continuous queries.
+    /// </summary>
+    [Category(TestUtils.CategoryIntensive)]
+    public class ContinuousQueryTest
+    {
+        /// <summary>
+        /// Tests same query on multiple nodes.
+        /// This tests verifies that there are no exception on Java side during event delivery.
+        /// </summary>
+        [Test]
+        public void TestSameQueryMultipleNodes()
+        {
+            using (var ignite = StartIgnite())
+            {
+                var cache = ignite.GetOrCreateCache<Guid, Data>("data");
+                cache.QueryContinuous(new ContinuousQuery<Guid, Data>(new Listener()));
+
+                using (var ignite2 = StartIgnite())
+                {
+                    var cache2 = ignite2.GetOrCreateCache<Guid, Data>("data");
+                    cache2.QueryContinuous(new ContinuousQuery<Guid, Data>(new Listener()));
+
+                    for (var i = 0; i < 100; i++)
+                    {
+                        PutEntry(cache2);
+                        PutEntry(cache);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Puts the entry and verifies events.
+        /// </summary>
+        private static void PutEntry(ICache<Guid, Data> cache)
+        {
+            // Put new entry.
+            var entry = new Data {Id = Guid.NewGuid()};
+            cache.Put(entry.Id, entry);
+
+            // Wait for events.
+            Thread.Sleep(100);
+
+            ICacheEntryEvent<Guid, Data> e;
+
+            // Two listeners  - two events.
+            Assert.IsTrue(Listener.Events.TryPop(out e));
+            Assert.AreEqual(entry.Id, e.Key);
+
+            Assert.IsTrue(Listener.Events.TryPop(out e));
+            Assert.AreEqual(entry.Id, e.Key);
+        }
+
+        /// <summary>
+        /// Starts the ignite.
+        /// </summary>
+        private static IIgnite StartIgnite()
+        {
+            return Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration())
+            {
+                BinaryConfiguration = new Core.Binary.BinaryConfiguration(typeof(Data)),
+                AutoGenerateIgniteInstanceName = true
+            });
+        }
+
+        private class Data
+        {
+            public Guid Id;
+        }
+
+        private class Listener : ICacheEntryEventListener<Guid, Data>
+        {
+            public static readonly ConcurrentStack<ICacheEntryEvent<Guid, Data>> Events 
+                = new ConcurrentStack<ICacheEntryEvent<Guid, Data>>();
+
+            public void OnEvent(IEnumerable<ICacheEntryEvent<Guid, Data>> evts)
+            {
+                foreach (var e in evts)
+                {
+                    Events.Push(e);
+                }
+            }
+        }
+    }
+}


[6/7] ignite git commit: Try avoid timeout in IgniteCacheGetRestartTest.

Posted by sb...@apache.org.
Try avoid timeout in IgniteCacheGetRestartTest.


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

Branch: refs/heads/ignite-5009
Commit: b41ecd1e0b9dc6199a618e8d4df740c96372eba1
Parents: 3402043
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 24 16:59:30 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 24 16:59:30 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/distributed/IgniteCacheGetRestartTest.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b41ecd1e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheGetRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheGetRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheGetRestartTest.java
index aaa83cc..69d9123 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheGetRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheGetRestartTest.java
@@ -219,7 +219,7 @@ public class IgniteCacheGetRestartTest extends GridCommonAbstractTest {
 
                         IgniteInternalFuture<?> syncFut = ((IgniteCacheProxy)cache).context().preloader().syncFuture();
 
-                        while (!syncFut.isDone())
+                        while (!syncFut.isDone() && U.currentTimeMillis() < stopTime)
                             checkGet(cache);
 
                         checkGet(cache);


[2/7] ignite git commit: IGNITE-3521: IGFS: Removed "maxSpace" property. This closes #1854.

Posted by sb...@apache.org.
IGNITE-3521: IGFS: Removed "maxSpace" property. This closes #1854.


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

Branch: refs/heads/ignite-5009
Commit: 7c249d7bbb3c6f65e2781e0da3cd21c62d2ce078
Parents: 5a43346
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Mon Apr 24 15:17:49 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Mon Apr 24 15:17:49 2017 +0300

----------------------------------------------------------------------
 .../configuration/FileSystemConfiguration.java  |  25 ----
 .../org/apache/ignite/igfs/IgfsMetrics.java     |   5 +-
 .../processors/cache/GridCacheAdapter.java      |  14 ---
 .../processors/cache/GridCacheProcessor.java    |   5 +-
 .../processors/cache/GridCacheProxyImpl.java    |  12 --
 .../processors/cache/IgniteInternalCache.java   |   7 --
 .../dht/GridDhtTransactionalCacheAdapter.java   |   1 -
 .../dht/preloader/GridDhtPartitionDemander.java |  12 --
 .../distributed/near/GridNearCacheAdapter.java  |   5 -
 .../processors/igfs/IgfsDataManager.java        |  36 +-----
 .../internal/visor/igfs/VisorIgfsMetrics.java   |   3 +-
 .../visor/node/VisorIgfsConfiguration.java      |  13 --
 .../processors/igfs/IgfsMaxSizeSelfTest.java    | 121 -------------------
 .../processors/igfs/IgfsSizeSelfTest.java       |  50 +++++---
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   3 -
 .../HadoopIgfs20FileSystemAbstractSelfTest.java |   1 -
 .../cache/hibernate/HibernateCacheProxy.java    |   5 -
 .../cache/hibernate/HibernateCacheProxy.java    |   5 -
 18 files changed, 47 insertions(+), 276 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
index af5be3c..e36f857 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
@@ -136,9 +136,6 @@ public class FileSystemConfiguration {
     /** Path modes. */
     private Map<String, IgfsMode> pathModes;
 
-    /** Maximum space. */
-    private long maxSpace;
-
     /** Maximum range length. */
     private long maxTaskRangeLen;
 
@@ -187,7 +184,6 @@ public class FileSystemConfiguration {
         secondaryFs = cfg.getSecondaryFileSystem();
         ipcEndpointCfg = cfg.getIpcEndpointConfiguration();
         ipcEndpointEnabled = cfg.isIpcEndpointEnabled();
-        maxSpace = cfg.getMaxSpaceSize();
         maxTaskRangeLen = cfg.getMaximumTaskRangeLength();
         metaCacheCfg = cfg.getMetaCacheConfiguration();
         mgmtPort = cfg.getManagementPort();
@@ -682,27 +678,6 @@ public class FileSystemConfiguration {
     }
 
     /**
-     * Get maximum space available for data cache to store file system entries.
-     *
-     * @return Maximum space available for data cache.
-     */
-    public long getMaxSpaceSize() {
-        return maxSpace;
-    }
-
-    /**
-     * Set maximum space in bytes available in data cache.
-     *
-     * @param maxSpace Maximum space available in data cache.
-     * @return {@code this} for chaining.
-     */
-    public FileSystemConfiguration setMaxSpaceSize(long maxSpace) {
-        this.maxSpace = maxSpace;
-
-        return this;
-    }
-
-    /**
      * Get maximum default range size of a file being split during IGFS task execution. When IGFS task is about to
      * be executed, it requests file block locations first. Each location is defined as {@link org.apache.ignite.igfs.mapreduce.IgfsFileRange} which
      * has length. In case this parameter is set to positive value, then IGFS will split single file range into smaller

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsMetrics.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsMetrics.java
index 3283eaf..28225fc 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsMetrics.java
@@ -32,9 +32,8 @@ public interface IgfsMetrics {
     public long localSpaceSize();
 
     /**
-     * Gets maximum amount of data that can be stored on local node. This metrics is either
-     * equal to {@link org.apache.ignite.configuration.FileSystemConfiguration#getMaxSpaceSize()}, or, if it is {@code 0}, equal to
-     * {@code 80%} of maximum heap size allocated for JVM.
+     * Gets maximum amount of data that can be stored on local node. This metrics is related to
+     * to the {@link org.apache.ignite.configuration.MemoryPolicyConfiguration#getSize()} of the IGFS data cache.
      *
      * @return Maximum IGFS local space size.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/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 c9f7430..b364df8 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
@@ -278,9 +278,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     /** Current IGFS data cache size. */
     private LongAdder8 igfsDataCacheSize;
 
-    /** Max space for IGFS. */
-    private long igfsDataSpaceMax;
-
     /** Asynchronous operations limit semaphore. */
     private Semaphore asyncOpsSem;
 
@@ -338,12 +335,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                     if (!ctx.isNear()) {
                         igfsDataCache = true;
                         igfsDataCacheSize = new LongAdder8();
-
-                        igfsDataSpaceMax = igfsCfg.getMaxSpaceSize();
-
-                        // Do we have limits?
-                        if (igfsDataSpaceMax <= 0)
-                            igfsDataSpaceMax = Long.MAX_VALUE;
                     }
 
                     break;
@@ -4363,11 +4354,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public long igfsDataSpaceMax() {
-        return igfsDataSpaceMax;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean isMongoDataCache() {
         return mongoDataCache;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/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 a555b55..4b79361 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
@@ -738,10 +738,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             else
                 cacheType = CacheType.USER;
 
-        if (cacheType != CacheType.USER)
-            cfg.setMemoryPolicyName(sharedCtx.database().systemMemoryPolicyName());
-
-        if (cacheType != CacheType.USER)
+        if (cacheType != CacheType.USER && cfg.getMemoryPolicyName() == null)
             cfg.setMemoryPolicyName(sharedCtx.database().systemMemoryPolicyName());
 
         boolean template = cfg.getName() != null && cfg.getName().endsWith("*");

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 2979a57..837c22a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -454,18 +454,6 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
     }
 
     /** {@inheritDoc} */
-    @Override public long igfsDataSpaceMax() {
-        CacheOperationContext prev = gate.enter(opCtx);
-
-        try {
-            return delegate.igfsDataSpaceMax();
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean isMongoDataCache() {
         CacheOperationContext prev = gate.enter(opCtx);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index ce65fd2..cc7fd3a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1719,13 +1719,6 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
     public long igfsDataSpaceUsed();
 
     /**
-     * Get maximum space available for IGFS.
-     *
-     * @return Amount of space available for IGFS in bytes.
-     */
-    public long igfsDataSpaceMax();
-
-    /**
      * Checks whether this cache is Mongo data cache.
      *
      * @return {@code True} if this cache is mongo data cache.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 6af1ef7..c91eb7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -55,7 +55,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearSing
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTransactionalCache;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxRemote;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearUnlockRequest;
-import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index d71a3ad..75cbd00 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -56,7 +56,6 @@ import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.T2;
-import org.apache.ignite.internal.util.typedef.internal.LT;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteInClosure;
@@ -744,17 +743,6 @@ public class GridDhtPartitionDemander {
                 if (log.isDebugEnabled())
                     log.debug("Rebalancing key [key=" + entry.key() + ", part=" + p + ", node=" + pick.id() + ']');
 
-                if (cctx.dht().isIgfsDataCache() &&
-                    cctx.dht().igfsDataSpaceUsed() > cctx.dht().igfsDataSpaceMax()) {
-                    LT.error(log, null, "Failed to rebalance IGFS data cache (IGFS space size exceeded maximum " +
-                        "value, will ignore rebalance entries)");
-
-                    if (cached.markObsoleteIfEmpty(null))
-                        cached.context().cache().removeEntry(cached);
-
-                    return true;
-                }
-
                 if (preloadPred == null || preloadPred.apply(entry)) {
                     if (cached.initialValue(
                         entry.value(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/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 f4ba043..59d986a 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
@@ -403,11 +403,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
     }
 
     /** {@inheritDoc} */
-    @Override public long igfsDataSpaceMax() {
-        return dht().igfsDataSpaceMax();
-    }
-
-    /** {@inheritDoc} */
     @Override public void onIgfsDataSizeChanged(long delta) {
         dht().onIgfsDataSizeChanged(delta);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
index acd0a1f..7fa2355 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
@@ -65,6 +65,7 @@ import org.apache.ignite.internal.managers.communication.GridIoPolicy;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
+import org.apache.ignite.internal.processors.cache.database.MemoryPolicy;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
 import org.apache.ignite.internal.processors.datastreamer.DataStreamerCacheUpdaters;
 import org.apache.ignite.internal.processors.igfs.data.IgfsDataPutProcessor;
@@ -242,7 +243,11 @@ public class IgfsDataManager extends IgfsManager {
      * @return Maximum number of bytes for IGFS data cache.
      */
     public long maxSpaceSize() {
-        return (igfsCtx.configuration().getMaxSpaceSize() <= 0) ? 0 : dataCachePrj.igfsDataSpaceMax();
+        MemoryPolicy plc = dataCachePrj.context().memoryPolicy();
+
+        long size = plc != null ? plc.config().getSize() : 0;
+
+        return (size <= 0) ? 0 : size ;
     }
 
     /**
@@ -1022,27 +1027,6 @@ public class IgfsDataManager extends IgfsManager {
      */
     private void processPartialBlockWrite(IgniteUuid fileId, IgfsBlockKey colocatedKey, int startOff,
         byte[] data, int blockSize) throws IgniteCheckedException {
-        if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.igfsDataSpaceMax()) {
-            final WriteCompletionFuture completionFut = pendingWrites.get(fileId);
-
-            if (completionFut == null) {
-                if (log.isDebugEnabled())
-                    log.debug("Missing completion future for file write request (most likely exception occurred " +
-                        "which will be thrown upon stream close) [fileId=" + fileId + ']');
-
-                return;
-            }
-
-            IgfsOutOfSpaceException e = new IgfsOutOfSpaceException("Failed to write data block " +
-                "(IGFS maximum data size exceeded) [used=" + dataCachePrj.igfsDataSpaceUsed() +
-                ", allowed=" + dataCachePrj.igfsDataSpaceMax() + ']');
-
-            completionFut.onDone(new IgniteCheckedException("Failed to write data (not enough space on node): " +
-                igfsCtx.kernalContext().localNodeId(), e));
-
-            return;
-        }
-
         // No affinity key present, just concat and return.
         if (colocatedKey.affinityKey() == null) {
             dataCachePrj.invoke(colocatedKey, new UpdateProcessor(startOff, data));
@@ -1097,14 +1081,6 @@ public class IgfsDataManager extends IgfsManager {
     @SuppressWarnings("unchecked")
     private IgniteInternalFuture<?> storeBlocksAsync(Map<IgfsBlockKey, byte[]> blocks) {
         assert !blocks.isEmpty();
-
-        if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.igfsDataSpaceMax()) {
-            return new GridFinishedFuture<Object>(
-                new IgfsOutOfSpaceException("Failed to write data block (IGFS maximum data size " +
-                    "exceeded) [used=" + dataCachePrj.igfsDataSpaceUsed() +
-                    ", allowed=" + dataCachePrj.igfsDataSpaceMax() + ']'));
-        }
-
         return dataCachePrj.putAllAsync(blocks);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
index 6ce5d80..f90ca89 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
@@ -22,6 +22,7 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.igfs.IgfsMetrics;
+import org.apache.ignite.internal.processors.igfs.IgfsEx;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
@@ -91,7 +92,7 @@ public class VisorIgfsMetrics extends VisorDataTransferObject {
 
         IgfsMetrics m = igfs.metrics();
 
-        totalSpaceSz = igfs.configuration().getMaxSpaceSize();
+        totalSpaceSz = ((IgfsEx)igfs).context().data().maxSpaceSize();
         usedSpaceSz = m.localSpaceSize();
         foldersCnt = m.directoriesCount();
         filesCnt = m.filesCount();

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
index 3b97129..db91982 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
@@ -92,9 +92,6 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
     /** IPC endpoint enabled flag. */
     private boolean ipcEndpointEnabled;
 
-    /** Maximum space. */
-    private long maxSpace;
-
     /** Management port. */
     private int mgmtPort;
 
@@ -135,7 +132,6 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
         ipcEndpointCfg = endpointCfg != null ? endpointCfg.toString() : null;
 
         ipcEndpointEnabled = igfs.isIpcEndpointEnabled();
-        maxSpace = igfs.getMaxSpaceSize();
         mgmtPort = igfs.getManagementPort();
         seqReadsBeforePrefetch = igfs.getSequentialReadsBeforePrefetch();
     }
@@ -277,13 +273,6 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
     }
 
     /**
-     * @return Maximum space.
-     */
-    public long getMaxSpace() {
-        return maxSpace;
-    }
-
-    /**
      * @return Management port.
      */
     public int getManagementPort() {
@@ -316,7 +305,6 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
         out.writeLong(fragmentizerThrottlingDelay);
         U.writeString(out, ipcEndpointCfg);
         out.writeBoolean(ipcEndpointEnabled);
-        out.writeLong(maxSpace);
         out.writeInt(mgmtPort);
         out.writeInt(seqReadsBeforePrefetch);
     }
@@ -340,7 +328,6 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
         fragmentizerThrottlingDelay = in.readLong();
         ipcEndpointCfg = U.readString(in);
         ipcEndpointEnabled = in.readBoolean();
-        maxSpace = in.readLong();
         mgmtPort = in.readInt();
         seqReadsBeforePrefetch = in.readInt();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java
deleted file mode 100644
index 2e0be3f..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.internal.processors.igfs;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.FileSystemConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
-import org.apache.ignite.internal.IgniteEx;
-
-/**
- * Check max size limit.
- */
-@SuppressWarnings("ConstantConditions")
-public class IgfsMaxSizeSelfTest extends IgfsCommonAbstractTest {
-    /** Work directory. */
-    private static long maxSize;
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
-        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
-
-        igfsCfg.setName("test");
-
-        if (maxSize > 0)
-            igfsCfg.setMaxSpaceSize(maxSize);
-
-        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
-
-        dataCacheCfg.setName("dataCache");
-        dataCacheCfg.setCacheMode(CacheMode.PARTITIONED);
-        dataCacheCfg.setNearConfiguration(null);
-        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(2));
-        dataCacheCfg.setBackups(0);
-        dataCacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
-
-        metaCacheCfg.setName("metaCache");
-        metaCacheCfg.setNearConfiguration(null);
-        metaCacheCfg.setCacheMode(CacheMode.REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        metaCacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-
-        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
-        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
-
-        cfg.setFileSystemConfiguration(igfsCfg);
-        cfg.setIgniteInstanceName(igniteInstanceName);
-
-        return cfg;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testDefaultOrZero() throws  Exception {
-        IgniteEx ig = startGrid(0);
-
-        try {
-            assertEquals(0, ((IgfsImpl)ig.igfsx("test")).globalSpace().spaceTotal());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testNegative() throws  Exception {
-        maxSize = -1;
-
-        IgniteEx ig = startGrid(0);
-
-        try {
-            assertEquals(0, ((IgfsImpl)ig.igfsx("test")).globalSpace().spaceTotal());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPositive() throws  Exception {
-        maxSize = 1 << 20;
-
-        IgniteEx ig = startGrid(0);
-
-        try {
-            assertEquals(maxSize, ((IgfsImpl)ig.igfsx("test")).globalSpace().spaceTotal());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
index 645f341..fbe0872 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
+import java.io.IOException;
+import java.util.concurrent.Callable;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.CacheWriteSynchronizationMode;
@@ -24,17 +26,20 @@ import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
 import org.apache.ignite.igfs.IgfsInputStream;
-import org.apache.ignite.igfs.IgfsOutOfSpaceException;
 import org.apache.ignite.igfs.IgfsOutputStream;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
@@ -42,14 +47,12 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.jsr166.ThreadLocalRandom8;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.UUID;
-import java.util.concurrent.Callable;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
@@ -87,14 +90,13 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
     /** Whether near cache is enabled (applicable for PARTITIONED cache only). */
     private boolean nearEnabled;
 
-    /** IGFS maximum space. */
-    private long igfsMaxData;
+    /** Mem policy setter. */
+    private IgniteInClosure<IgniteConfiguration> memIgfsdDataPlcSetter;
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
         cacheMode = null;
         nearEnabled = false;
-        igfsMaxData = 0;
 
         mgmtPort = 11400;
     }
@@ -113,7 +115,6 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
         igfsCfg.setName(IGFS_NAME);
         igfsCfg.setBlockSize(BLOCK_SIZE);
         igfsCfg.setFragmentizerEnabled(false);
-        igfsCfg.setMaxSpaceSize(igfsMaxData);
         igfsCfg.setManagementPort(++mgmtPort);
 
         CacheConfiguration dataCfg = defaultCacheConfiguration();
@@ -150,6 +151,9 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
         cfg.setDiscoverySpi(discoSpi);
         cfg.setFileSystemConfiguration(igfsCfg);
 
+        if (memIgfsdDataPlcSetter != null)
+            memIgfsdDataPlcSetter.apply(cfg);
+
         return cfg;
     }
 
@@ -221,7 +225,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
         cacheMode = PARTITIONED;
         nearEnabled = false;
 
-        check();
+        checkOversize();
     }
 
     /**
@@ -232,7 +236,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
     public void testReplicatedOversize() throws Exception {
         cacheMode = REPLICATED;
 
-        check();
+        checkOversize();
     }
 
     /**
@@ -386,15 +390,32 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
      * @throws Exception If failed.
      */
     private void checkOversize() throws Exception {
-        igfsMaxData = BLOCK_SIZE;
+        final long maxSize = 32 * 1024 * 1024;
+
+        memIgfsdDataPlcSetter = new IgniteInClosure<IgniteConfiguration>() {
+            @Override public void apply(IgniteConfiguration cfg) {
+                String memPlcName = "igfsDataMemPlc";
+
+                cfg.setMemoryConfiguration(new MemoryConfiguration().setMemoryPolicies(
+                    new MemoryPolicyConfiguration().setSize(maxSize).setName(memPlcName)));
+
+                FileSystemConfiguration igfsCfg = cfg.getFileSystemConfiguration()[0];
+
+                igfsCfg.getDataCacheConfiguration().setMemoryPolicyName(memPlcName);
+
+                cfg.setCacheConfiguration(new CacheConfiguration().setName("QQQ").setMemoryPolicyName(memPlcName));
+            }
+        };
 
         startUp();
 
         final IgfsPath path = new IgfsPath("/file");
 
+        final int writeChunkSize = (int)(maxSize / 1024);
+
         // This write is expected to be successful.
         IgfsOutputStream os = igfs(0).create(path, false);
-        os.write(chunk(BLOCK_SIZE - 1));
+        os.write(chunk(writeChunkSize));
         os.close();
 
         // This write must be successful as well.
@@ -408,7 +429,9 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
                 IgfsOutputStream osErr = igfs(0).append(path, false);
 
                 try {
-                    osErr.write(chunk(BLOCK_SIZE));
+                    for (int i = 0; i < maxSize / writeChunkSize * GRID_CNT; ++i)
+                        osErr.write(chunk(writeChunkSize));
+
                     osErr.close();
 
                     return null;
@@ -425,8 +448,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
                     U.closeQuiet(osErr);
                 }
             }
-        }, IgfsOutOfSpaceException.class, "Failed to write data block (IGFS maximum data size exceeded) [used=" +
-            igfsMaxData + ", allowed=" + igfsMaxData + ']');
+        }, IgniteOutOfMemoryException.class, "Not enough memory allocated");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index 7efc7de..b16f7e9 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -32,7 +32,6 @@ import org.apache.ignite.internal.processors.igfs.IgfsCacheSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsDualAsyncClientSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsDualSyncClientSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsLocalSecondaryFileSystemProxyClientSelfTest;
-import org.apache.ignite.internal.processors.igfs.IgfsMaxSizeSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimaryClientSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsDataManagerSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsDualAsyncSelfTest;
@@ -150,8 +149,6 @@ public class IgniteIgfsTestSuite extends TestSuite {
         // TODO: Enable when IGFS failover is fixed.
         //suite.addTestSuite(IgfsBackupFailoverSelfTest.class);
 
-        suite.addTestSuite(IgfsMaxSizeSelfTest.class);
-
         suite.addTestSuite(IgfsProxySelfTest.class);
         suite.addTestSuite(IgfsLocalSecondaryFileSystemProxySelfTest.class);
         suite.addTestSuite(IgfsLocalSecondaryFileSystemProxyClientSelfTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
index 77e6757..016fadf 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
@@ -305,7 +305,6 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
 
         cfg.setName("igfs");
         cfg.setPrefetchBlocks(1);
-        cfg.setMaxSpaceSize(64 * 1024 * 1024);
         cfg.setDefaultMode(mode);
         cfg.setMetaCacheConfiguration(metaCacheConfiguration(igniteInstanceName));
         cfg.setDataCacheConfiguration(dataCacheConfiguration(igniteInstanceName));

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
index 48fc1f8..7204083 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
@@ -627,11 +627,6 @@ public class HibernateCacheProxy implements IgniteInternalCache<Object, Object>
     }
 
     /** {@inheritDoc} */
-    @Override public long igfsDataSpaceMax() {
-        return delegate.igfsDataSpaceMax();
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean isMongoDataCache() {
         return delegate.isMongoDataCache();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c249d7b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
index 48fc1f8..7204083 100644
--- a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
+++ b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
@@ -627,11 +627,6 @@ public class HibernateCacheProxy implements IgniteInternalCache<Object, Object>
     }
 
     /** {@inheritDoc} */
-    @Override public long igfsDataSpaceMax() {
-        return delegate.igfsDataSpaceMax();
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean isMongoDataCache() {
         return delegate.isMongoDataCache();
     }


[5/7] ignite git commit: Removed unused swap-related code.

Posted by sb...@apache.org.
Removed unused swap-related code.


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

Branch: refs/heads/ignite-5009
Commit: 340204333624ecbc4166e52a83056885c673373c
Parents: b58d584
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 24 16:49:02 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 24 16:49:02 2017 +0300

----------------------------------------------------------------------
 .../cache/GridCacheBatchSwapEntry.java          |  76 -----
 .../processors/cache/GridCacheEntryEx.java      |  23 --
 .../cache/GridCacheEvictionManager.java         |  95 +-----
 .../processors/cache/GridCacheMapEntry.java     |  73 ----
 .../processors/cache/GridCacheSwapEntry.java    |  82 -----
 .../cache/GridCacheSwapEntryImpl.java           | 339 -------------------
 .../cache/IgniteCacheOffheapManager.java        |   3 -
 .../cache/IgniteCacheOffheapManagerImpl.java    |   5 -
 .../processors/cache/GridCacheTestEntryEx.java  |  15 -
 9 files changed, 9 insertions(+), 702 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheBatchSwapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheBatchSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheBatchSwapEntry.java
deleted file mode 100644
index 01c9bab..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheBatchSwapEntry.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.internal.processors.cache;
-
-import java.nio.ByteBuffer;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.lang.IgniteUuid;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Entry for batch swap operations.
- */
-public class GridCacheBatchSwapEntry extends GridCacheSwapEntryImpl {
-    /** Key. */
-    private KeyCacheObject key;
-
-    /** Partition. */
-    private int part;
-
-    /**
-     * Creates batch swap entry.
-     *
-     * @param key Key.
-     * @param part Partition id.
-     * @param valBytes Value bytes.
-     * @param type Value type.
-     * @param ver Version.
-     * @param ttl Time to live.
-     * @param expireTime Expire time.
-     * @param keyClsLdrId Key class loader ID.
-     * @param valClsLdrId Optional value class loader ID.
-     */
-    public GridCacheBatchSwapEntry(KeyCacheObject key,
-        int part,
-        ByteBuffer valBytes,
-        byte type,
-        GridCacheVersion ver,
-        long ttl,
-        long expireTime,
-        IgniteUuid keyClsLdrId,
-        @Nullable IgniteUuid valClsLdrId) {
-        super(valBytes, type, ver, ttl, expireTime, keyClsLdrId, valClsLdrId);
-
-        this.key = key;
-        this.part = part;
-    }
-
-    /**
-     * @return Key.
-     */
-    public KeyCacheObject key() {
-        return key;
-    }
-
-    /**
-     * @return Partition id.
-     */
-    public int partition() {
-        return part;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index 1eab04e..6a5b4b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -221,16 +221,6 @@ public interface GridCacheEntryEx {
         boolean evictOffheap) throws IgniteCheckedException;
 
     /**
-     * Evicts entry when batch evict is performed. When called, does not write entry data to swap, but instead
-     * returns batch swap entry if entry was marked obsolete.
-     *
-     * @param obsoleteVer Version to mark obsolete with.
-     * @return Swap entry if this entry was marked obsolete, {@code null} if entry was not evicted.
-     * @throws IgniteCheckedException If failed.
-     */
-    public GridCacheBatchSwapEntry evictInBatchInternal(GridCacheVersion obsoleteVer) throws IgniteCheckedException;
-
-    /**
      * This method should be called each time entry is marked obsolete
      * other than by calling {@link #markObsolete(GridCacheVersion)}.
      */
@@ -695,19 +685,6 @@ public interface GridCacheEntryEx {
         boolean fromStore) throws IgniteCheckedException, GridCacheEntryRemovedException;
 
     /**
-     * Sets new value if current version is <tt>0</tt> using swap entry data.
-     * Note that this method does not update cache index.
-     *
-     * @param key Key.
-     * @param unswapped Swap entry to set entry state from.
-     * @return {@code True} if  initial value was set.
-     * @throws IgniteCheckedException In case of error.
-     * @throws GridCacheEntryRemovedException If entry was removed.
-     */
-    public boolean initialValue(KeyCacheObject key, GridCacheSwapEntry unswapped)
-        throws IgniteCheckedException, GridCacheEntryRemovedException;
-
-    /**
      * Create versioned entry for this cache entry.
      *
      * @param keepBinary Keep binary flag.

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 0deae07..8ba10a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -17,12 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
 import java.util.Set;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cache.eviction.EvictionFilter;
@@ -31,8 +26,8 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager;
 import org.apache.ignite.internal.util.GridBusyLock;
-import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
@@ -260,96 +255,24 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter implements
     /** {@inheritDoc} */
     @Override public void batchEvict(Collection<?> keys, @Nullable GridCacheVersion obsoleteVer)
         throws IgniteCheckedException {
-        List<GridCacheEntryEx> locked = new ArrayList<>(keys.size());
-
-        Set<GridCacheEntryEx> notRmv = null;
-
-        Collection<GridCacheBatchSwapEntry> swapped = new ArrayList<>(keys.size());
-
         boolean recordable = cctx.events().isRecordable(EVT_CACHE_ENTRY_EVICTED);
 
         GridCacheAdapter cache = cctx.cache();
 
-        Map<Object, GridCacheEntryEx> cached = U.newLinkedHashMap(keys.size());
-
         // Get all participating entries to avoid deadlock.
         for (Object k : keys) {
             KeyCacheObject cacheKey = cctx.toCacheKeyObject(k);
 
-            GridCacheEntryEx e = cache.peekEx(cacheKey);
-
-            if (e != null)
-                cached.put(k, e);
-        }
-
-        try {
-            for (GridCacheEntryEx entry : cached.values()) {
-                // Do not evict internal entries.
-                if (entry.key().internal())
-                    continue;
-
-                // Lock entry.
-                GridUnsafe.monitorEnter(entry);
-
-                locked.add(entry);
-
-                if (entry.obsolete()) {
-                    if (notRmv == null)
-                        notRmv = new HashSet<>();
-
-                    notRmv.add(entry);
-
-                    continue;
-                }
-
-                if (obsoleteVer == null)
-                    obsoleteVer = cctx.versions().next();
-
-                GridCacheBatchSwapEntry swapEntry = entry.evictInBatchInternal(obsoleteVer);
-
-                if (swapEntry != null) {
-                    assert entry.obsolete() : entry;
-
-                    swapped.add(swapEntry);
-
-                    if (log.isDebugEnabled())
-                        log.debug("Entry was evicted [entry=" + entry + ", localNode=" + cctx.nodeId() + ']');
-                }
-                else if (!entry.obsolete()) {
-                    if (notRmv == null)
-                        notRmv = new HashSet<>();
-
-                    notRmv.add(entry);
-                }
-            }
-
-            // Batch write to swap.
-            if (!swapped.isEmpty())
-                cctx.offheap().writeAll(swapped);
-        }
-        finally {
-            // Unlock entries in reverse order.
-            for (ListIterator<GridCacheEntryEx> it = locked.listIterator(locked.size()); it.hasPrevious(); ) {
-                GridCacheEntryEx e = it.previous();
-
-                GridUnsafe.monitorExit(e);
-            }
-
-            // Remove entries and fire events outside the locks.
-            for (GridCacheEntryEx entry : locked) {
-                if (entry.obsolete() && (notRmv == null || !notRmv.contains(entry))) {
-                    entry.onMarkedObsolete();
-
-                    cache.removeEntry(entry);
+            GridCacheEntryEx entry = cache.peekEx(cacheKey);
 
-                    if (plcEnabled)
-                        notifyPolicy(entry);
+            if (entry != null && entry.evictInternal(GridCacheVersionManager.EVICT_VER, null, false)) {
+                if (plcEnabled)
+                    notifyPolicy(entry);
 
-                    if (recordable)
-                        cctx.events().addEvent(entry.partition(), entry.key(), cctx.nodeId(), (IgniteUuid)null, null,
-                            EVT_CACHE_ENTRY_EVICTED, null, false, entry.rawGet(), entry.hasValue(), null, null, null,
-                            false);
-                }
+                if (recordable)
+                    cctx.events().addEvent(entry.partition(), entry.key(), cctx.nodeId(), (IgniteUuid)null, null,
+                        EVT_CACHE_ENTRY_EVICTED, null, false, entry.rawGet(), entry.hasValue(), null, null, null,
+                        false);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/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 856ac993..21c58fa 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
@@ -2709,31 +2709,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
     }
 
     /** {@inheritDoc} */
-    @Override public synchronized boolean initialValue(KeyCacheObject key, GridCacheSwapEntry unswapped) throws
-        IgniteCheckedException,
-        GridCacheEntryRemovedException {
-        checkObsolete();
-
-        if (isNew()) {
-            CacheObject val = unswapped.value();
-
-            val = cctx.kernalContext().cacheObjects().prepareForCache(val, cctx);
-
-            // Version does not change for load ops.
-            update(val,
-                unswapped.expireTime(),
-                unswapped.ttl(),
-                unswapped.version(),
-                true
-            );
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /** {@inheritDoc} */
     @Override public synchronized GridCacheVersionedEntryEx versionedEntry(final boolean keepBinary)
         throws IgniteCheckedException, GridCacheEntryRemovedException {
         boolean isNew = isStartVersion();
@@ -3518,54 +3493,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         return false;
     }
 
-    /** {@inheritDoc} */
-    @Override public final GridCacheBatchSwapEntry evictInBatchInternal(GridCacheVersion obsoleteVer)
-        throws IgniteCheckedException {
-        assert Thread.holdsLock(this);
-        assert !obsolete();
-
-        GridCacheBatchSwapEntry ret = null;
-
-        try {
-            if (!hasReaders() && markObsolete0(obsoleteVer, false, null)) {
-                if (!isStartVersion() && hasValueUnlocked()) {
-                    IgniteUuid valClsLdrId = null;
-                    IgniteUuid keyClsLdrId = null;
-
-                    if (cctx.deploymentEnabled()) {
-                        if (val != null) {
-                            valClsLdrId = cctx.deploy().getClassLoaderId(
-                                U.detectObjectClassLoader(val.value(cctx.cacheObjectContext(), false)));
-                        }
-
-                        keyClsLdrId = cctx.deploy().getClassLoaderId(
-                            U.detectObjectClassLoader(keyValue(false)));
-                    }
-
-                    IgniteBiTuple<byte[], Byte> valBytes = valueBytes0();
-
-                    ret = new GridCacheBatchSwapEntry(key(),
-                        partition(),
-                        ByteBuffer.wrap(valBytes.get1()),
-                        valBytes.get2(),
-                        ver,
-                        ttlExtras(),
-                        expireTimeExtras(),
-                        keyClsLdrId,
-                        valClsLdrId);
-                }
-
-                value(null);
-            }
-        }
-        catch (GridCacheEntryRemovedException ignored) {
-            if (log.isDebugEnabled())
-                log.debug("Got removed entry when evicting (will simply return): " + this);
-        }
-
-        return ret;
-    }
-
     /**
      * @param filter Entry filter.
      * @return {@code True} if entry is visitable.

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntry.java
deleted file mode 100644
index 73519eb..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntry.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.internal.processors.cache;
-
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.lang.IgniteUuid;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Swap entry.
- */
-public interface GridCacheSwapEntry {
-    /**
-     * @return Value bytes.
-     */
-    public byte[] valueBytes();
-
-    /**
-     * @return Object type.
-     */
-    public byte type();
-
-    /**
-     * @param valBytes Value bytes.
-     */
-    public void valueBytes(@Nullable byte[] valBytes);
-
-    /**
-     * @return Value.
-     */
-    public CacheObject value();
-
-    /**
-     * @param val Value.
-     */
-    public void value(CacheObject val);
-
-    /**
-     * @return Version.
-     */
-    public GridCacheVersion version();
-
-    /**
-     * @return Time to live.
-     */
-    public long ttl();
-
-    /**
-     * @return Expire time.
-     */
-    public long expireTime();
-
-    /**
-     * @return Class loader ID for entry key ({@code null} for local class loader).
-     */
-    @Nullable public IgniteUuid keyClassLoaderId();
-
-    /**
-     * @return Class loader ID for entry value ({@code null} for local class loader).
-     */
-    @Nullable public IgniteUuid valueClassLoaderId();
-
-    /**
-     * @return If entry is offheap based returns offheap address, otherwise 0.
-     */
-    public long offheapPointer();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntryImpl.java
deleted file mode 100644
index 410a6ee..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapEntryImpl.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * 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.internal.processors.cache;
-
-import java.nio.ByteBuffer;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx;
-import org.apache.ignite.internal.util.GridUnsafe;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.lang.IgniteUuid;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Swap entry.
- */
-public class GridCacheSwapEntryImpl implements GridCacheSwapEntry {
-    /** */
-    static final int EXPIRE_TIME_OFFSET = 8;
-
-    /** */
-    static final int VERSION_OFFSET = 16;
-
-    /** */
-    static final int VERSION_SIZE = 16;
-
-    /** */
-    static final int VERSION_EX_SIZE = 32;
-
-    /** */
-    static final int GUID_SIZE = 24;
-
-    /** Value bytes. */
-    private ByteBuffer valBytes;
-
-    /** Value. */
-    private CacheObject val;
-
-    /** Type. */
-    private byte type;
-
-    /** Class loader ID. */
-    private IgniteUuid keyClsLdrId;
-
-    /** Class loader ID. */
-    private IgniteUuid valClsLdrId;
-
-    /** Version. */
-    private GridCacheVersion ver;
-
-    /** Time to live. */
-    private long ttl;
-
-    /** Expire time. */
-    private long expireTime;
-
-    /**
-     * @param valBytes Value.
-     * @param type Type.
-     * @param ver Version.
-     * @param ttl Entry time to live.
-     * @param expireTime Expire time.
-     * @param keyClsLdrId Class loader ID for entry key (can be {@code null} for local class loader).
-     * @param valClsLdrId Class loader ID for entry value (can be {@code null} for local class loader).
-     */
-    public GridCacheSwapEntryImpl(
-        ByteBuffer valBytes,
-        byte type,
-        GridCacheVersion ver,
-        long ttl,
-        long expireTime,
-        @Nullable IgniteUuid keyClsLdrId,
-        @Nullable IgniteUuid valClsLdrId) {
-        this.valBytes = valBytes;
-        this.type = type;
-        this.ver = ver;
-        this.ttl = ttl;
-        this.expireTime = expireTime;
-        this.valClsLdrId = valClsLdrId;
-        this.keyClsLdrId = keyClsLdrId;
-    }
-
-    /**
-     * @param bytes Entry bytes.
-     * @return TTL.
-     */
-    public static long timeToLive(byte[] bytes) {
-        return GridUnsafe.getLong(bytes, GridUnsafe.BYTE_ARR_OFF);
-    }
-
-    /**
-     * @param bytes Entry bytes.
-     * @return Expire time.
-     */
-    public static long expireTime(byte[] bytes) {
-        return GridUnsafe.getLong(bytes, GridUnsafe.BYTE_ARR_OFF + EXPIRE_TIME_OFFSET);
-    }
-
-    /**
-     * @param bytes Entry bytes.
-     * @return Version.
-     */
-    public static GridCacheVersion version(byte[] bytes) {
-        long off = GridUnsafe.BYTE_ARR_OFF + VERSION_OFFSET; // Skip ttl, expire time.
-
-        boolean verEx = GridUnsafe.getByte(bytes, off++) != 0;
-
-        return U.readVersion(bytes, off, verEx);
-    }
-
-    /**
-     * @param bytes Entry bytes.
-     * @return Value if value is byte array, otherwise {@code null}.
-     */
-    @Nullable public static IgniteBiTuple<byte[], Byte> getValue(byte[] bytes) {
-        long off = GridUnsafe.BYTE_ARR_OFF + VERSION_OFFSET; // Skip ttl, expire time.
-
-        boolean verEx = GridUnsafe.getByte(bytes, off++) != 0;
-
-        off += verEx ? VERSION_EX_SIZE : VERSION_SIZE;
-
-        int arrLen = GridUnsafe.getInt(bytes, off);
-
-        off += 4;
-
-        byte type = GridUnsafe.getByte(bytes, off++);
-
-        byte[] valBytes = new byte[arrLen];
-
-        GridUnsafe.copyMemory(bytes, off, valBytes, GridUnsafe.BYTE_ARR_OFF, arrLen);
-
-        return new IgniteBiTuple<>(valBytes, type);
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] valueBytes() {
-        if (valBytes != null) {
-            assert valBytes.capacity() == valBytes.limit();
-
-            return valBytes.array();
-        }
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void valueBytes(@Nullable byte[] valBytes) {
-        this.valBytes = valBytes != null ? ByteBuffer.wrap(valBytes) : null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheObject value() {
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void value(CacheObject val) {
-        this.val = val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte type() {
-        return type;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheVersion version() {
-        return ver;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long ttl() {
-        return ttl;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long expireTime() {
-        return expireTime;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid keyClassLoaderId() {
-        return keyClsLdrId;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid valueClassLoaderId() {
-        return valClsLdrId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long offheapPointer() {
-        return 0;
-    }
-
-    /**
-     * @return Entry bytes.
-     */
-    public byte[] marshal() {
-        // Ttl + expire time + Ex Version flag + Version.
-        int size = 16 + 1 + ((ver instanceof GridCacheVersionEx) ? VERSION_EX_SIZE : VERSION_SIZE);
-
-        size += 1; // Plain byte array flag.
-
-        int len = valBytes.limit();
-
-        size += len + 4; // Value bytes.
-
-        size += (valClsLdrId == null ? 1 : (1 + GUID_SIZE));
-
-        size += (keyClsLdrId == null ? 1 : (1 + GUID_SIZE));
-
-        byte[] arr = new byte[size];
-
-        long off = GridUnsafe.BYTE_ARR_OFF;
-
-        GridUnsafe.putLong(arr, off, ttl);
-
-        off += 8;
-
-        GridUnsafe.putLong(arr, off, expireTime);
-
-        off += 8;
-
-        off = U.writeVersion(arr, off, ver);
-
-        GridUnsafe.putInt(arr, off, len);
-
-        off += 4;
-
-        GridUnsafe.putByte(arr, off++, type);
-
-        GridUnsafe.copyMemory(valBytes.array(), GridUnsafe.BYTE_ARR_OFF, arr, off, len);
-
-        off += len;
-
-        off = U.writeGridUuid(arr, off, valClsLdrId);
-
-        U.writeGridUuid(arr, off, keyClsLdrId);
-
-        return arr;
-    }
-
-    /**
-     * @param arr Entry bytes.
-     * @param valOnly If {@code true} unmarshalls only entry value.
-     * @return Entry.
-     */
-    public static GridCacheSwapEntryImpl unmarshal(byte[] arr, boolean valOnly) {
-        if (valOnly) {
-            long off = GridUnsafe.BYTE_ARR_OFF + VERSION_OFFSET; // Skip ttl, expire time.
-
-            boolean verEx = GridUnsafe.getByte(arr, off++) != 0;
-
-            off += verEx ? VERSION_EX_SIZE : VERSION_SIZE;
-
-            int arrLen = GridUnsafe.getInt(arr, off);
-
-            off += 4;
-
-            byte type = GridUnsafe.getByte(arr, off++);
-
-            byte[] valBytes = new byte[arrLen];
-
-            GridUnsafe.copyMemory(arr, off, valBytes, GridUnsafe.BYTE_ARR_OFF, arrLen);
-
-            return new GridCacheSwapEntryImpl(ByteBuffer.wrap(valBytes),
-                type,
-                null,
-                0L,
-                0L,
-                null,
-                null);
-        }
-
-        long off = GridUnsafe.BYTE_ARR_OFF;
-
-        long ttl = GridUnsafe.getLong(arr, off);
-
-        off += 8;
-
-        long expireTime = GridUnsafe.getLong(arr, off);
-
-        off += 8;
-
-        boolean verEx = GridUnsafe.getBoolean(arr, off++);
-
-        GridCacheVersion ver = U.readVersion(arr, off, verEx);
-
-        off += verEx ? VERSION_EX_SIZE : VERSION_SIZE;
-
-        int arrLen = GridUnsafe.getInt(arr, off);
-
-        off += 4;
-
-        byte type = GridUnsafe.getByte(arr, off++);
-
-        byte[] valBytes = new byte[arrLen];
-
-        GridUnsafe.copyMemory(arr, off, valBytes, GridUnsafe.BYTE_ARR_OFF, arrLen);
-
-        off += arrLen;
-
-        IgniteUuid valClsLdrId = U.readGridUuid(arr, off);
-
-        off += valClsLdrId == null ? 1 : (1 + GUID_SIZE);
-
-        IgniteUuid keyClsLdrId = U.readGridUuid(arr, off);
-
-        return new GridCacheSwapEntryImpl(ByteBuffer.wrap(valBytes),
-            type,
-            ver,
-            ttl,
-            expireTime,
-            keyClsLdrId,
-            valClsLdrId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridCacheSwapEntryImpl.class, this);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
index 4a98f6a..9eb5368 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
@@ -239,9 +239,6 @@ public interface IgniteCacheOffheapManager extends GridCacheManager {
      */
     public GridAtomicLong globalRemoveId();
 
-    // TODO GG-10884: moved from GridCacheSwapManager.
-    void writeAll(Iterable<GridCacheBatchSwapEntry> swapped) throws IgniteCheckedException;
-
     /**
      * @param idxName Index name.
      * @return Root page for index tree.

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index 73edbe1..650f65e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -431,11 +431,6 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
         return 0;
     }
 
-    /** {@inheritDoc} */
-    @Override public void writeAll(Iterable<GridCacheBatchSwapEntry> swapped) throws IgniteCheckedException {
-        // No-op.
-    }
-
     /**
      * @param primary {@code True} if need return primary entries.
      * @param backup {@code True} if need return backup entries.

http://git-wip-us.apache.org/repos/asf/ignite/blob/34020433/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index a060f7e..53764ca 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -376,14 +376,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
         return false;
     }
 
-    /** {@inheritDoc} */
-    @Override public GridCacheBatchSwapEntry evictInBatchInternal(GridCacheVersion obsoleteVer)
-        throws IgniteCheckedException {
-        assert false;
-
-        return null;
-    }
-
     /** @inheritDoc */
     @Override public boolean isNew() {
         assert false; return false;
@@ -663,13 +655,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
     }
 
     /** @inheritDoc */
-    @Override public boolean initialValue(KeyCacheObject key, GridCacheSwapEntry unswapped) {
-        assert false;
-
-        return false;
-    }
-
-    /** @inheritDoc */
     @Override public GridCacheVersionedEntryEx versionedEntry(final boolean keepBinary) throws IgniteCheckedException {
         return null;
     }


[3/7] ignite git commit: IGNITE-5057 .NET: Fix build.ps1 to handle Any CPU config on PowerShell 4.0 and lower

Posted by sb...@apache.org.
IGNITE-5057 .NET: Fix build.ps1 to handle Any CPU config on PowerShell 4.0 and lower


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

Branch: refs/heads/ignite-5009
Commit: de421ffc492e3536b885f2d90c21bcfa71e435a5
Parents: 7c249d7
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Mon Apr 24 15:37:42 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Mon Apr 24 15:37:42 2017 +0300

----------------------------------------------------------------------
 modules/platforms/dotnet/build.ps1 | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/de421ffc/modules/platforms/dotnet/build.ps1
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/build.ps1 b/modules/platforms/dotnet/build.ps1
index 4b5d937..b8e6a37 100644
--- a/modules/platforms/dotnet/build.ps1
+++ b/modules/platforms/dotnet/build.ps1
@@ -143,9 +143,12 @@ echo "MSBuild detected at '$msbuildExe'."
 # Detect NuGet
 $ng = "nuget"
 if ((Get-Command $ng -ErrorAction SilentlyContinue) -eq $null) { 
-    echo "Downloading NuGet..."
-    (New-Object System.Net.WebClient).DownloadFile("https://dist.nuget.org/win-x86-commandline/v3.3.0/nuget.exe", "nuget.exe");    
     $ng = ".\nuget.exe"
+
+    if (-not (Test-Path $ng)) {
+        echo "Downloading NuGet..."
+        (New-Object System.Net.WebClient).DownloadFile("https://dist.nuget.org/win-x86-commandline/v3.3.0/nuget.exe", "nuget.exe");    
+    }
 }
 
 # Restore NuGet packages
@@ -153,10 +156,11 @@ echo "Restoring NuGet..."
 & $ng restore
 
 # Build
-echo "Starting MsBuild..."
 $targets = if ($clean) {"Clean;Rebuild"} else {"Build"}
 $codeAnalysis = if ($skipCodeAnalysis) {"/p:RunCodeAnalysis=false"} else {""}
-& $msbuildExe Apache.Ignite.sln /target:$targets /p:Configuration=$configuration /p:Platform=`"$platform`" $codeAnalysis /p:UseSharedCompilation=false
+$msBuildCommand = "`"$msBuildExe`" Apache.Ignite.sln /target:$targets /p:Configuration=$configuration /p:Platform=`"$platform`" $codeAnalysis /p:UseSharedCompilation=false"
+echo "Starting MsBuild: '$msBuildCommand'"
+cmd /c $msBuildCommand
 
 # Check result
 if ($LastExitCode -ne 0) {


[4/7] ignite git commit: ignite-2.0 - SQL: Geo tests fixed + distributed join on replicated cache

Posted by sb...@apache.org.
ignite-2.0 - SQL: Geo tests fixed + distributed join on replicated cache


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

Branch: refs/heads/ignite-5009
Commit: b58d584290fc4ca5f18031fac582130ffab59a24
Parents: de421ff
Author: Sergi Vladykin <se...@gmail.com>
Authored: Mon Apr 24 16:31:25 2017 +0300
Committer: Sergi Vladykin <se...@gmail.com>
Committed: Mon Apr 24 16:31:25 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheProxy.java      |  8 ----
 .../query/h2/H2IndexingAbstractGeoSelfTest.java |  2 +-
 .../processors/query/h2/IgniteH2Indexing.java   |  2 +-
 .../query/IgniteSqlSplitterSelfTest.java        | 46 ++++++++++++++++----
 4 files changed, 40 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b58d5842/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 186212d..b38520d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -774,10 +774,6 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
                     opCtxCall != null && opCtxCall.isKeepBinary());
 
             if (qry instanceof SqlQuery) {
-                if (isReplicatedDataNode() && ((SqlQuery)qry).isDistributedJoins())
-                    throw new CacheException("Queries using distributed JOINs have to be run on partitioned cache, " +
-                        "not on replicated.");
-
                 final SqlQuery p = (SqlQuery)qry;
 
                 if ((p.isReplicatedOnly() && isReplicatedDataNode()) || ctx.isLocal() || qry.isLocal())
@@ -788,10 +784,6 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
             }
 
             if (qry instanceof SqlFieldsQuery) {
-                if (isReplicatedDataNode() && ((SqlFieldsQuery)qry).isDistributedJoins())
-                    throw new CacheException("Queries using distributed JOINs have to be run on partitioned cache, " +
-                        "not on replicated.");
-
                 SqlFieldsQuery p = (SqlFieldsQuery)qry;
 
                 if ((p.isReplicatedOnly() && isReplicatedDataNode()) || ctx.isLocal() || qry.isLocal())

http://git-wip-us.apache.org/repos/asf/ignite/blob/b58d5842/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/H2IndexingAbstractGeoSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/H2IndexingAbstractGeoSelfTest.java b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/H2IndexingAbstractGeoSelfTest.java
index f57d573..2a83941 100644
--- a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/H2IndexingAbstractGeoSelfTest.java
+++ b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/H2IndexingAbstractGeoSelfTest.java
@@ -632,7 +632,7 @@ public abstract class H2IndexingAbstractGeoSelfTest extends GridCacheAbstractSel
      */
     private static class Enemy {
         /** */
-        @QuerySqlField
+        @QuerySqlField(index = true)
         int campId;
 
         /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b58d5842/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index bf0276a..798ca9b 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -1569,7 +1569,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         Connection c = connectionForSpace(space);
 
         final boolean enforceJoinOrder = qry.isEnforceJoinOrder();
-        final boolean distributedJoins = qry.isDistributedJoins() && cctx.isPartitioned();
+        final boolean distributedJoins = qry.isDistributedJoins();
         final boolean grpByCollocated = qry.isCollocated();
 
         final DistributedJoinMode distributedJoinMode = distributedJoinMode(qry.isLocal(), distributedJoins);

http://git-wip-us.apache.org/repos/asf/ignite/blob/b58d5842/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
index 4578171..fa4eded 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
@@ -290,6 +290,35 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
         }
     }
 
+    /**
+     * @throws InterruptedException If failed.
+     */
+    public void testDistributedJoinFromReplicatedCache() throws InterruptedException {
+        CacheConfiguration ccfg1 = cacheConfig("pers", true,
+            Integer.class, Person2.class);
+
+        CacheConfiguration ccfg2 = cacheConfig("org", true,
+            Integer.class, Organization.class);
+
+        CacheConfiguration ccfg3 = cacheConfig("orgRepl", false,
+            Integer.class, Organization.class);
+
+        IgniteCache<Integer, Person2> c1 = ignite(0).getOrCreateCache(ccfg1);
+        IgniteCache<Integer, Organization> c2 = ignite(0).getOrCreateCache(ccfg2);
+        IgniteCache<Integer, Organization> c3 = ignite(0).getOrCreateCache(ccfg3);
+
+        try {
+            awaitPartitionMapExchange();
+
+            doTestDistributedJoins(c3, c1, c2, 300, 2000, 5, false);
+            doTestDistributedJoins(c3, c1, c2, 300, 2000, 5, true);
+        }
+        finally {
+            c1.destroy();
+            c2.destroy();
+        }
+    }
+
     @SuppressWarnings("SuspiciousMethodCalls")
     public void testExists() {
         IgniteCache<Integer,Person2> x = ignite(0).getOrCreateCache(cacheConfig("x", true,
@@ -523,14 +552,14 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
         try {
             awaitPartitionMapExchange();
 
-            doTestDistributedJoins(c1, c2, 30, 100, 1000, false);
-            doTestDistributedJoins(c1, c2, 30, 100, 1000, true);
+            doTestDistributedJoins(c2, c1, c2, 30, 100, 1000, false);
+            doTestDistributedJoins(c2, c1, c2, 30, 100, 1000, true);
 
-            doTestDistributedJoins(c1, c2, 3, 10, 3, false);
-            doTestDistributedJoins(c1, c2, 3, 10, 3, true);
+            doTestDistributedJoins(c2, c1, c2, 3, 10, 3, false);
+            doTestDistributedJoins(c2, c1, c2, 3, 10, 3, true);
 
-            doTestDistributedJoins(c1, c2, 300, 2000, 5, false);
-            doTestDistributedJoins(c1, c2, 300, 2000, 5, true);
+            doTestDistributedJoins(c2, c1, c2, 300, 2000, 5, false);
+            doTestDistributedJoins(c2, c1, c2, 300, 2000, 5, true);
         }
         finally {
             c1.destroy();
@@ -1409,6 +1438,7 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
      * @param enforceJoinOrder Enforce join order.
      */
     private void doTestDistributedJoins(
+        IgniteCache<?,?> qryCache,
         IgniteCache<Integer, Person2> c1,
         IgniteCache<Integer, Organization> c2,
         int orgs,
@@ -1442,7 +1472,7 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
 
         String select = "select count(*) from \"org\".Organization o, \"pers\".Person2 p where p.orgId = o._key";
 
-        String plan = (String)c2.query(new SqlFieldsQuery("explain " + select)
+        String plan = (String)qryCache.query(new SqlFieldsQuery("explain " + select)
             .setDistributedJoins(true).setEnforceJoinOrder(enforceJoinOrder).setPageSize(pageSize))
             .getAll().get(0).get(0);
 
@@ -1453,7 +1483,7 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
         else
             assertTrue(plan, plan.contains("batched:unicast"));
 
-        assertEquals(Long.valueOf(persons), c2.query(new SqlFieldsQuery(select).setDistributedJoins(true)
+        assertEquals((long)persons, qryCache.query(new SqlFieldsQuery(select).setDistributedJoins(true)
             .setEnforceJoinOrder(enforceJoinOrder).setPageSize(pageSize)).getAll().get(0).get(0));
 
         c1.clear();


[7/7] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-2.0' into ignite-5009

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-2.0' into ignite-5009


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

Branch: refs/heads/ignite-5009
Commit: 956e02938c01f6d2d16fc806520fd616f8112dc4
Parents: 8ff6531 b41ecd1
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 24 17:41:27 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 24 17:41:27 2017 +0300

----------------------------------------------------------------------
 .../configuration/FileSystemConfiguration.java  |  25 --
 .../org/apache/ignite/igfs/IgfsMetrics.java     |   5 +-
 .../processors/cache/GridCacheAdapter.java      |  14 -
 .../cache/GridCacheBatchSwapEntry.java          |  76 -----
 .../processors/cache/GridCacheEntryEx.java      |  23 --
 .../cache/GridCacheEvictionManager.java         |  95 +-----
 .../processors/cache/GridCacheMapEntry.java     |  73 ----
 .../processors/cache/GridCacheProcessor.java    |   5 +-
 .../processors/cache/GridCacheProxyImpl.java    |  12 -
 .../processors/cache/GridCacheSwapEntry.java    |  82 -----
 .../cache/GridCacheSwapEntryImpl.java           | 339 -------------------
 .../cache/IgniteCacheOffheapManager.java        |   3 -
 .../cache/IgniteCacheOffheapManagerImpl.java    |   5 -
 .../processors/cache/IgniteCacheProxy.java      |   8 -
 .../processors/cache/IgniteInternalCache.java   |   7 -
 .../dht/GridDhtTransactionalCacheAdapter.java   |   1 -
 .../dht/preloader/GridDhtPartitionDemander.java |  12 -
 .../distributed/near/GridNearCacheAdapter.java  |   5 -
 .../processors/igfs/IgfsDataManager.java        |  36 +-
 .../internal/visor/igfs/VisorIgfsMetrics.java   |   3 +-
 .../visor/node/VisorIgfsConfiguration.java      |  13 -
 .../processors/cache/GridCacheTestEntryEx.java  |  15 -
 .../distributed/IgniteCacheGetRestartTest.java  |   2 +-
 .../processors/igfs/IgfsMaxSizeSelfTest.java    | 121 -------
 .../processors/igfs/IgfsSizeSelfTest.java       |  50 ++-
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   3 -
 .../query/h2/H2IndexingAbstractGeoSelfTest.java |   2 +-
 .../HadoopIgfs20FileSystemAbstractSelfTest.java |   1 -
 .../cache/hibernate/HibernateCacheProxy.java    |   5 -
 .../cache/hibernate/HibernateCacheProxy.java    |   5 -
 .../processors/query/h2/IgniteH2Indexing.java   |   2 +-
 .../query/IgniteSqlSplitterSelfTest.java        |  46 ++-
 .../Apache.Ignite.Core.Tests.csproj             |   1 +
 .../Query/Continuous/ContinuousQueryTest.cs     | 115 +++++++
 modules/platforms/dotnet/build.ps1              |  12 +-
 35 files changed, 221 insertions(+), 1001 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/956e0293/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/956e0293/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/956e0293/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/956e0293/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/956e0293/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------