You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dm...@apache.org on 2016/01/18 08:38:04 UTC
[1/2] ignite git commit: IGNITE-2202: support entry version for local
queries
Repository: ignite
Updated Branches:
refs/heads/ignite-2202 d8814178c -> b0dab5afc
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java
index 293234e..0dd60e1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java
@@ -26,11 +26,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
public class CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest extends
CacheVersionedEntryReplicatedTransactionalSelfTest {
/** {@inheritDoc} */
- @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
- CacheConfiguration cfg = super.cacheConfiguration(gridName);
-
- cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-
- return cfg;
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapValuesSelfTest.java
new file mode 100644
index 0000000..3a98191
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapValuesSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ *
+ */
+public class CacheVersionedEntryReplicatedTransactionalOffHeapValuesSelfTest extends
+ CacheVersionedEntryReplicatedTransactionalSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_VALUES;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java
index e9d7611..9e5146c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java
@@ -23,7 +23,7 @@ import org.apache.ignite.cache.CacheMode;
/**
*
*/
-public class CacheVersionedEntryReplicatedTransactionalSelfTest extends CacheVersionedEntryAbstractTest {
+public class CacheVersionedEntryReplicatedTransactionalSelfTest extends CacheVersionedEntryBasicTest {
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return CacheMode.REPLICATED;
@@ -33,4 +33,4 @@ public class CacheVersionedEntryReplicatedTransactionalSelfTest extends CacheVer
@Override protected CacheAtomicityMode atomicityMode() {
return CacheAtomicityMode.TRANSACTIONAL;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 04d0881..c72e53e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -121,15 +121,18 @@ import org.apache.ignite.internal.processors.cache.integration.IgniteCacheTxNoRe
import org.apache.ignite.internal.processors.cache.integration.IgniteCacheTxNoWriteThroughTest;
import org.apache.ignite.internal.processors.cache.integration.IgniteCacheTxStoreSessionTest;
import org.apache.ignite.internal.processors.cache.integration.IgniteCacheTxStoreSessionWriteBehindTest;
-import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryLocalAtomicSwapDisabledSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryLocalTransactionalSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedAtomicOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedAtomicOffHeapValuesSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedAtomicSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedTransactionalOffHeapValuesSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryPartitionedTransactionalSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedAtomicOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedAtomicOffHeapValuesSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedAtomicSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedTransactionalOffHeapValuesSelfTest;
import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryReplicatedTransactionalSelfTest;
/**
@@ -264,16 +267,21 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(CacheReadThroughAtomicRestartSelfTest.class);
// Versioned entry tests
- suite.addTestSuite(CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.class);
suite.addTestSuite(CacheVersionedEntryLocalTransactionalSelfTest.class);
+
suite.addTestSuite(CacheVersionedEntryPartitionedAtomicSelfTest.class);
- suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalSelfTest.class);
suite.addTestSuite(CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.class);
- suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryPartitionedAtomicOffHeapValuesSelfTest.class);
suite.addTestSuite(CacheVersionedEntryReplicatedAtomicSelfTest.class);
- suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalSelfTest.class);
suite.addTestSuite(CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryReplicatedAtomicOffHeapValuesSelfTest.class);
+
+ suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalOffHeapValuesSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalSelfTest.class);
suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalOffHeapValuesSelfTest.class);
suite.addTestSuite(CacheSwapUnswapGetTest.class);
@@ -295,4 +303,4 @@ public class IgniteCacheTestSuite4 extends TestSuite {
return suite;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
index 170ab65..6107cd0 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
@@ -115,7 +115,7 @@ public class GridCacheReduceQueryMultithreadedSelfTest extends GridCacheAbstract
// Create query.
final CacheQuery<List<?>> sumQry = c.context().queries().
- createSqlFieldsQuery("select _val from Integer", false).timeout(TEST_TIMEOUT);
+ createSqlFieldsQuery("select _val from Integer", false, false).timeout(TEST_TIMEOUT);
final R1<List<?>, Integer> rmtRdc = new R1<List<?>, Integer>() {
/** */
@@ -165,4 +165,4 @@ public class GridCacheReduceQueryMultithreadedSelfTest extends GridCacheAbstract
fut2.get();
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
index 82456fb..7e3bc70 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
@@ -165,7 +165,8 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
*/
public void testNoDataInCache() throws Exception {
CacheQuery<List<?>> qry = ((IgniteKernal)grid(0))
- .getCache(null).context().queries().createSqlFieldsQuery("select age from Person where orgId = 999", false);
+ .getCache(null).context().queries().createSqlFieldsQuery("select age from Person where orgId = 999",
+ false, false);
Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
@@ -177,7 +178,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
*/
public void testAverageQuery() throws Exception {
CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).context().queries().
- createSqlFieldsQuery("select age from Person", false);
+ createSqlFieldsQuery("select age from Person", false, false);
Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
@@ -189,7 +190,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
*/
public void testAverageQueryWithArguments() throws Exception {
CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).context().queries().createSqlFieldsQuery(
- "select age from Person where orgId = ?", false);
+ "select age from Person where orgId = ?", false, false);
Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer(), 1).get();
@@ -417,4 +418,4 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
return cnt == 0 ? 0 : sum / cnt;
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
index f5b16f5..ed3dfd6 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
@@ -44,7 +44,7 @@ public class GridCacheReduceFieldsQueryPartitionedSelfTest extends GridCacheAbst
*/
public void testIncludeBackups() throws Exception {
CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).context().queries().
- createSqlFieldsQuery("select age from Person", false);
+ createSqlFieldsQuery("select age from Person", false, false);
qry.includeBackups(true);
@@ -56,4 +56,4 @@ public class GridCacheReduceFieldsQueryPartitionedSelfTest extends GridCacheAbst
// One backup, so sum is two times greater
assertEquals("Sum", 200, sum);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesAbstractTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesAbstractTest.java
new file mode 100644
index 0000000..1d84dac
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesAbstractTest.java
@@ -0,0 +1,116 @@
+/*
+ * 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.version;
+
+import java.util.List;
+import javax.cache.Cache;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheEntry;
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
+import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.cache.query.TextQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ * Versioned entry abstract test.
+ */
+public abstract class CacheVersionedEntryQueriesAbstractTest extends CacheVersionedEntryAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+ CacheConfiguration<Integer, String> cfg = super.cacheConfiguration(gridName);
+
+ cfg.setIndexedTypes(Integer.class, String.class);
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLocalSqlQuery() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ SqlQuery<Integer, String> query = new SqlQuery<Integer, String>(String.class, "_key != -1");
+
+ query.setLocal(true);
+
+ List<Cache.Entry<Integer, String>> res = cache.query(query).getAll();
+
+ assert !res.isEmpty() : "Wrong entries size: " + res.size();
+
+ for (Cache.Entry<Integer, String> entry : res)
+ checkVersionedEntry(entry.unwrap(CacheEntry.class));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLocalSqlQueryNoVersion() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ SqlQuery<Integer, String> query = new SqlQuery<Integer, String>(String.class, "_key != -1");
+
+ List<Cache.Entry<Integer, String>> res = cache.query(query).getAll();
+
+ assert !res.isEmpty() : "Wrong entries size: " + res.size();
+
+ for (Cache.Entry<Integer, String> entry : res) {
+ CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
+
+ assertNull(verEntry.version());
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLocalTextQuery() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ TextQuery<Integer, String> query = new TextQuery<Integer, String>(String.class, "value*");
+
+ query.setLocal(true);
+
+ List<Cache.Entry<Integer, String>> res = cache.query(query).getAll();
+
+ assert !res.isEmpty() : "Wrong entries size: " + res.size();
+
+ for (Cache.Entry<Integer, String> entry : res)
+ checkVersionedEntry(entry.unwrap(CacheEntry.class));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLocalTextQueryNoVersion() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ TextQuery<Integer, String> query = new TextQuery<Integer, String>(String.class, "value*");
+
+ List<Cache.Entry<Integer, String>> res = cache.query(query).getAll();
+
+ assert !res.isEmpty() : "Wrong entries size: " + res.size();
+
+ for (Cache.Entry<Integer, String> entry : res) {
+ CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
+
+ assertNull(verEntry.version());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesLocalTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesLocalTransactionalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesLocalTransactionalSelfTest.java
new file mode 100644
index 0000000..c132e55
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesLocalTransactionalSelfTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesLocalTransactionalSelfTest extends CacheVersionedEntryQueriesAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.LOCAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicOffHeapSelfTest.java
new file mode 100644
index 0000000..c34ddfb
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicOffHeapSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesPartitionedAtomicOffHeapSelfTest extends
+ CacheVersionedEntryQueriesPartitionedAtomicSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicSelfTest.java
new file mode 100644
index 0000000..f4c81b0
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedAtomicSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesPartitionedAtomicSelfTest extends CacheVersionedEntryQueriesAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.ATOMIC;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalOffHeapSelfTest.java
new file mode 100644
index 0000000..7719ffb
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalOffHeapSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesPartitionedTransactionalOffHeapSelfTest extends
+ CacheVersionedEntryQueriesPartitionedTransactionalSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalSelfTest.java
new file mode 100644
index 0000000..8987667
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesPartitionedTransactionalSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesPartitionedTransactionalSelfTest extends CacheVersionedEntryQueriesAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicOffHeapSelfTest.java
new file mode 100644
index 0000000..882d58e
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicOffHeapSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesReplicatedAtomicOffHeapSelfTest
+ extends CacheVersionedEntryQueriesReplicatedAtomicSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicSelfTest.java
new file mode 100644
index 0000000..7ba3a03
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedAtomicSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesReplicatedAtomicSelfTest extends CacheVersionedEntryQueriesAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.REPLICATED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.ATOMIC;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalOffHeapSelfTest.java
new file mode 100644
index 0000000..61bf9c2
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalOffHeapSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesReplicatedTransactionalOffHeapSelfTest extends
+ CacheVersionedEntryQueriesReplicatedTransactionalSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalSelfTest.java
new file mode 100644
index 0000000..0bafd21
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryQueriesReplicatedTransactionalSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ *
+ */
+public class CacheVersionedEntryQueriesReplicatedTransactionalSelfTest extends CacheVersionedEntryQueriesAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.REPLICATED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index 4b1eafa..f6845f6 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -94,6 +94,15 @@ import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceF
import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryLocalSelfTest;
import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryPartitionedSelfTest;
import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesLocalTransactionalSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesPartitionedAtomicOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesPartitionedAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesPartitionedTransactionalOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesPartitionedTransactionalSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesReplicatedAtomicOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesReplicatedAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesReplicatedTransactionalOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryQueriesReplicatedTransactionalSelfTest;
import org.apache.ignite.internal.processors.query.IgniteSqlSchemaIndexingTest;
import org.apache.ignite.internal.processors.query.IgniteSqlSplitterSelfTest;
import org.apache.ignite.internal.processors.query.h2.sql.BaseH2CompareQueryTest;
@@ -217,6 +226,19 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
suite.addTestSuite(IgniteCacheNoClassQuerySelfTest.class);
+ // Versioned entry tests
+ suite.addTestSuite(CacheVersionedEntryQueriesLocalTransactionalSelfTest.class);
+
+ suite.addTestSuite(CacheVersionedEntryQueriesPartitionedAtomicSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryQueriesPartitionedAtomicOffHeapSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryQueriesReplicatedAtomicSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryQueriesReplicatedAtomicOffHeapSelfTest.class);
+
+ suite.addTestSuite(CacheVersionedEntryQueriesPartitionedTransactionalSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryQueriesPartitionedTransactionalOffHeapSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryQueriesReplicatedTransactionalSelfTest.class);
+ suite.addTestSuite(CacheVersionedEntryQueriesReplicatedTransactionalOffHeapSelfTest.class);
+
return suite;
}
}
[2/2] ignite git commit: IGNITE-2202: support entry version for local
queries
Posted by dm...@apache.org.
IGNITE-2202: support entry version for local queries
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b0dab5af
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b0dab5af
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b0dab5af
Branch: refs/heads/ignite-2202
Commit: b0dab5afc55b415ed247942636d71c8116be2788
Parents: d881417
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jan 18 10:37:50 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jan 18 10:37:50 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 120 +++++++++++-
.../processors/cache/GridCacheSwapManager.java | 26 ++-
.../processors/cache/IgniteCacheProxy.java | 12 +-
.../binary/CacheObjectBinaryProcessorImpl.java | 2 +-
.../cache/query/GridCacheQueryAdapter.java | 16 ++
.../cache/query/GridCacheQueryManager.java | 55 ++++--
.../cache/version/VersionedMapEntry.java | 49 +++++
.../datastructures/GridCacheSetImpl.java | 6 +-
.../processors/query/GridQueryProcessor.java | 170 ++++++++++++-----
.../service/GridServiceProcessor.java | 4 +-
...CacheFullTextQueryMultithreadedSelfTest.java | 4 +-
...achePartitionedPreloadLifecycleSelfTest.java | 5 +-
...CacheReplicatedPreloadLifecycleSelfTest.java | 5 +-
.../CacheVersionedEntryAbstractTest.java | 137 ++++----------
.../version/CacheVersionedEntryBasicTest.java | 182 +++++++++++++++++++
...nedEntryLocalAtomicSwapDisabledSelfTest.java | 46 -----
...ersionedEntryLocalTransactionalSelfTest.java | 4 +-
...edEntryPartitionedAtomicOffHeapSelfTest.java | 11 +-
...yPartitionedAtomicOffHeapValuesSelfTest.java | 31 ++++
...VersionedEntryPartitionedAtomicSelfTest.java | 4 +-
...PartitionedTransactionalOffHeapSelfTest.java | 10 +-
...ionedTransactionalOffHeapValuesSelfTest.java | 32 ++++
...edEntryPartitionedTransactionalSelfTest.java | 4 +-
...nedEntryReplicatedAtomicOffHeapSelfTest.java | 10 +-
...ryReplicatedAtomicOffHeapValuesSelfTest.java | 31 ++++
...eVersionedEntryReplicatedAtomicSelfTest.java | 4 +-
...yReplicatedTransactionalOffHeapSelfTest.java | 10 +-
...catedTransactionalOffHeapValuesSelfTest.java | 32 ++++
...nedEntryReplicatedTransactionalSelfTest.java | 4 +-
.../testsuites/IgniteCacheTestSuite4.java | 20 +-
...idCacheReduceQueryMultithreadedSelfTest.java | 4 +-
...dCacheAbstractReduceFieldsQuerySelfTest.java | 9 +-
...cheReduceFieldsQueryPartitionedSelfTest.java | 4 +-
.../CacheVersionedEntryQueriesAbstractTest.java | 116 ++++++++++++
...dEntryQueriesLocalTransactionalSelfTest.java | 41 +++++
...QueriesPartitionedAtomicOffHeapSelfTest.java | 31 ++++
...edEntryQueriesPartitionedAtomicSelfTest.java | 36 ++++
...PartitionedTransactionalOffHeapSelfTest.java | 31 ++++
...QueriesPartitionedTransactionalSelfTest.java | 36 ++++
...yQueriesReplicatedAtomicOffHeapSelfTest.java | 31 ++++
...nedEntryQueriesReplicatedAtomicSelfTest.java | 36 ++++
...sReplicatedTransactionalOffHeapSelfTest.java | 31 ++++
...yQueriesReplicatedTransactionalSelfTest.java | 36 ++++
.../IgniteCacheQuerySelfTestSuite.java | 22 +++
44 files changed, 1234 insertions(+), 276 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/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 5d4c386..b474550 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
@@ -812,6 +812,124 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
+ * Peeks entry verion locally.
+ *
+ * @param key Entry key.
+ * @param peekModes Peek modes.
+ * @return Entry version.
+ * @throws IgniteCheckedException If failed.
+ */
+ @SuppressWarnings("ForLoopReplaceableByForEach")
+ @Nullable public GridCacheVersion peekVersion(K key, CachePeekMode[] peekModes)
+ throws IgniteCheckedException {
+ A.notNull(key, "key");
+
+ if (keyCheck)
+ validateCacheKey(key);
+
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
+
+ PeekModes modes = parsePeekModes(peekModes, false);
+
+ try {
+ KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
+
+ if (!ctx.isLocal()) {
+ AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
+
+ int part = ctx.affinity().partition(cacheKey);
+
+ boolean nearKey;
+
+ if (!(modes.near && modes.primary && modes.backup)) {
+ boolean keyPrimary = ctx.affinity().primary(ctx.localNode(), part, topVer);
+
+ if (keyPrimary) {
+ if (!modes.primary)
+ return null;
+
+ nearKey = false;
+ }
+ else {
+ boolean keyBackup = ctx.affinity().belongs(ctx.localNode(), part, topVer);
+
+ if (keyBackup) {
+ if (!modes.backup)
+ return null;
+
+ nearKey = false;
+ }
+ else {
+ if (!modes.near)
+ return null;
+
+ nearKey = true;
+
+ // Swap and offheap are disabled for near cache.
+ modes.offheap = false;
+ modes.swap = false;
+ }
+ }
+ }
+ else {
+ nearKey = !ctx.affinity().belongs(ctx.localNode(), part, topVer);
+
+ if (nearKey) {
+ // Swap and offheap are disabled for near cache.
+ modes.offheap = false;
+ modes.swap = false;
+ }
+ }
+
+ if (nearKey && !ctx.isNear())
+ return null;
+
+ if (modes.heap) {
+ GridCacheEntryEx e = nearKey ? peekEx(cacheKey) :
+ (ctx.isNear() ? ctx.near().dht().peekEx(cacheKey) : peekEx(cacheKey));
+
+ if (e != null)
+ return e.version();
+ }
+
+ if (modes.offheap || modes.swap) {
+ GridCacheSwapManager swapMgr = ctx.isNear() ? ctx.near().dht().context().swap() : ctx.swap();
+
+ GridCacheSwapEntry e = swapMgr.read(cacheKey, false, modes.offheap, modes.swap, false);
+
+ if (e != null)
+ return e.version();
+ }
+ }
+ else {
+ if (modes.heap) {
+ GridCacheEntryEx e = peekEx(key);
+
+ if (e != null)
+ return e.version();
+ }
+
+ if (modes.offheap || modes.swap) {
+ GridCacheSwapManager swapMgr = ctx.isNear() ? ctx.near().dht().context().swap() : ctx.swap();
+
+ GridCacheSwapEntry e = swapMgr.read(cacheKey, false, modes.offheap, modes.swap, false);
+
+ if (e != null)
+ return e.version();
+ }
+ }
+
+ return null;
+ }
+ catch (GridCacheEntryRemovedException ignore) {
+ if (log.isDebugEnabled())
+ log.debug("Got removed entry during 'peek': " + key);
+
+ return null;
+ }
+ }
+
+ /**
* @param key Key.
* @param heap Read heap flag.
* @param offheap Read offheap flag.
@@ -3838,7 +3956,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1)
return localIteratorHonorExpirePolicy(opCtx);
- CacheQueryFuture<Map.Entry<K, V>> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary())
+ CacheQueryFuture<Map.Entry<K, V>> fut = ctx0.queries().createScanQuery(null, null, false, ctx.keepBinary())
.keepAll(false)
.execute();
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 37b5e15..b0f9483 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -779,6 +779,30 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/**
+ * @param key Key to read swap entry for.
+ * @param locked {@code True} if cache entry is locked.
+ * @param readOffheap Read offheap flag.
+ * @param readSwap Read swap flag.
+ * @param valOnly If {@code true} unmarshals only entry value.
+ * @return Read value.
+ * @throws IgniteCheckedException If read failed.
+ */
+ @Nullable GridCacheSwapEntry read(KeyCacheObject key,
+ boolean locked,
+ boolean readOffheap,
+ boolean readSwap,
+ boolean valOnly)
+ throws IgniteCheckedException
+ {
+ if (!offheapEnabled && !swapEnabled)
+ return null;
+
+ int part = cctx.affinity().partition(key);
+
+ return read(key, key.valueBytes(cctx.cacheObjectContext()), part, locked, readOffheap, readSwap, valOnly);
+ }
+
+ /**
* @param entry Entry to read.
* @return Read value address.
* @throws IgniteCheckedException If read failed.
@@ -2522,4 +2546,4 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
throw new UnsupportedOperationException();
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/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 b64c69c..5b5976b 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
@@ -67,6 +67,7 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.query.CacheQuery;
import org.apache.ignite.internal.processors.cache.query.CacheQueryFuture;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersionAware;
import org.apache.ignite.internal.processors.query.GridQueryProcessor;
import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
import org.apache.ignite.internal.util.GridEmptyIterator;
@@ -458,10 +459,12 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary();
+ final boolean incEntryVer = filter.isLocal();
+
if (filter instanceof ScanQuery) {
IgniteBiPredicate<K, V> p = ((ScanQuery)filter).getFilter();
- qry = ctx.queries().createScanQuery(p, ((ScanQuery)filter).getPartition(), isKeepBinary);
+ qry = ctx.queries().createScanQuery(p, ((ScanQuery)filter).getPartition(), incEntryVer, isKeepBinary);
if (grp != null)
qry.projection(grp);
@@ -476,7 +479,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
else if (filter instanceof TextQuery) {
TextQuery p = (TextQuery)filter;
- qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary);
+ qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), incEntryVer, isKeepBinary);
if (grp != null)
qry.projection(grp);
@@ -521,7 +524,10 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
cur = null;
- return new CacheEntryImpl<>(e.getKey(), e.getValue());
+ if (incEntryVer)
+ return new CacheEntryImpl<>(e.getKey(), e.getValue(), ((GridCacheVersionAware)e).version());
+ else
+ return new CacheEntryImpl<>(e.getKey(), e.getValue());
}
@Override protected boolean onHasNext() throws IgniteCheckedException {
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
index c9d6dad..ac89a34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
@@ -250,7 +250,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
GridCacheQueryManager qryMgr = metaDataCache.context().queries();
CacheQuery<Map.Entry<BinaryMetadataKey, BinaryMetadata>> qry =
- qryMgr.createScanQuery(new MetaDataPredicate(), null, false);
+ qryMgr.createScanQuery(new MetaDataPredicate(), null, false, false);
qry.keepAll(false);
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
index b948dc5..fbb1841 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
@@ -89,6 +89,9 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
private final boolean incMeta;
/** */
+ private final boolean incEntryVer;
+
+ /** */
private volatile GridCacheQueryMetricsAdapter metrics;
/** */
@@ -126,6 +129,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
* @param filter Scan filter.
* @param part Partition.
* @param incMeta Include metadata flag.
+ * @param incEntryVer Include versioned entry flag.
* @param keepBinary Keep binary flag.
*/
public GridCacheQueryAdapter(GridCacheContext<?, ?> cctx,
@@ -135,6 +139,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
@Nullable IgniteBiPredicate<Object, Object> filter,
@Nullable Integer part,
boolean incMeta,
+ boolean incEntryVer,
boolean keepBinary) {
assert cctx != null;
assert type != null;
@@ -147,6 +152,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
this.filter = filter;
this.part = part;
this.incMeta = incMeta;
+ this.incEntryVer = incEntryVer;
this.keepBinary = keepBinary;
log = cctx.logger(getClass());
@@ -207,6 +213,9 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
this.keepBinary = keepBinary;
this.subjId = subjId;
this.taskHash = taskHash;
+
+ // Versioned entry is never included for distributed queries.
+ incEntryVer = false;
}
/**
@@ -238,6 +247,13 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
}
/**
+ * @return Include versioned entry flag.
+ */
+ public boolean includeEntryVersion() {
+ return incEntryVer;
+ }
+
+ /**
* @return {@code True} if binary should not be deserialized.
*/
public boolean keepBinary() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 8f0cab7..2859eee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -69,6 +69,8 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheA
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtUnreservedPartitionException;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersionAware;
+import org.apache.ignite.internal.processors.cache.version.VersionedMapEntry;
import org.apache.ignite.internal.processors.datastructures.GridSetQueryPredicate;
import org.apache.ignite.internal.processors.datastructures.SetItemKey;
import org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilter;
@@ -611,7 +613,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
taskName));
}
- iter = qryProc.queryText(space, qry.clause(), qry.queryClassName(), filter(qry));
+ iter = qryProc.queryText(space, qry.clause(), qry.queryClassName(), filter(qry),
+ qry.includeEntryVersion());
break;
@@ -892,6 +895,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
private void advance() {
IgniteBiTuple<K, V> next0 = null;
+ GridCacheVersion ver = null;
+
while (iter.hasNext()) {
next0 = null;
@@ -906,6 +911,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
entry != null ? entry.peek(true, false, false, topVer, expiryPlc) : null;
val = (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheVal, true);
+
+ if (qry.includeEntryVersion())
+ ver = entry.version();
}
catch (GridCacheEntryRemovedException e) {
val = null;
@@ -934,7 +942,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
}
next = next0 != null ?
- new IgniteBiTuple<>(next0.getKey(), next0.getValue()) :
+ (ver != null ? new VersionedMapEntry<>(next0.getKey(), next0.getValue(), ver) :
+ new IgniteBiTuple<>(next0.getKey(), next0.getValue())) :
null;
if (next == null)
@@ -1041,7 +1050,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
Iterator<Map.Entry<byte[], byte[]>> it = part == null ? cctx.swap().rawSwapIterator(true, backups) :
cctx.swap().rawSwapIterator(part);
- return scanIterator(it, filter, qry.keepBinary());
+ return scanIterator(it, filter, qry.keepBinary(), qry.includeEntryVersion());
}
/**
@@ -1060,7 +1069,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
else {
Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator(qry.partition(), true, backups);
- return scanIterator(it, filter, qry.keepBinary());
+ return scanIterator(it, filter, qry.keepBinary(), qry.includeEntryVersion());
}
}
@@ -1068,12 +1077,14 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
* @param it Lazy swap or offheap iterator.
* @param filter Scan filter.
* @param keepBinary Keep binary flag.
+ * @param incVerEntry Include versioned entry flag.
* @return Iterator.
*/
private GridIteratorAdapter<IgniteBiTuple<K, V>> scanIterator(
@Nullable final Iterator<Map.Entry<byte[], byte[]>> it,
@Nullable final IgniteBiPredicate<K, V> filter,
- final boolean keepBinary) {
+ final boolean keepBinary,
+ final boolean incVerEntry) {
if (it == null)
return new GridEmptyCloseableIterator<>();
@@ -1117,7 +1128,10 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
continue;
}
- next = new IgniteBiTuple<>(e.key(), e.value());
+ if (incVerEntry)
+ next = new VersionedMapEntry<>(e.key(), e.value(), e.version());
+ else
+ next = new IgniteBiTuple<>(e.key(), e.value());
break;
}
@@ -1549,8 +1563,20 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
continue;
}
- data.add(trans != null ? trans.apply(entry) :
- !loc ? new GridCacheQueryResponseEntry<>(key, val) : F.t(key, val));
+ Object ret;
+
+ if (trans != null)
+ ret = trans.apply(entry);
+ else if (!loc)
+ ret = new GridCacheQueryResponseEntry<>(key, val);
+ else {
+ if (qry.includeEntryVersion() && row instanceof GridCacheVersionAware)
+ ret = new VersionedMapEntry<K, V>(key, val, ((GridCacheVersionAware)row).version());
+ else
+ ret = F.t(key, val);
+ }
+
+ data.add(ret);
if (!loc) {
if (++cnt == pageSize || !iter.hasNext()) {
@@ -3051,6 +3077,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
null,
null,
false,
+ false,
keepBinary);
}
@@ -3059,11 +3086,12 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
*
* @param filter Scan filter.
* @param part Partition.
+ * @param incVerEntry Include versioned entry flag.
* @param keepBinary Keep binary flag.
* @return Created query.
*/
public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter,
- @Nullable Integer part, boolean keepBinary) {
+ @Nullable Integer part, boolean incVerEntry, boolean keepBinary) {
return new GridCacheQueryAdapter<>(cctx,
SCAN,
@@ -3072,6 +3100,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
(IgniteBiPredicate<Object, Object>)filter,
part,
false,
+ incVerEntry,
keepBinary);
}
@@ -3081,11 +3110,12 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
*
* @param clsName Query class name.
* @param search Search clause.
+ * @param incVerEntry Include versioned entry flag.
* @param keepBinary Keep binary flag.
* @return Created query.
*/
public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName,
- String search, boolean keepBinary) {
+ String search, boolean incVerEntry, boolean keepBinary) {
A.notNull("clsName", clsName);
A.notNull("search", search);
@@ -3096,6 +3126,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
null,
null,
false,
+ incVerEntry,
keepBinary);
}
@@ -3104,10 +3135,11 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
* documentation.
*
* @param qry Query.
+ * @param incVerEntry Include versioned entry flag.
* @param keepBinary Keep binary flag.
* @return Created query.
*/
- public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean keepBinary) {
+ public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incVerEntry, boolean keepBinary) {
A.notNull(qry, "qry");
return new GridCacheQueryAdapter<>(cctx,
@@ -3117,6 +3149,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
null,
null,
false,
+ incVerEntry,
keepBinary);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/VersionedMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/VersionedMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/VersionedMapEntry.java
new file mode 100644
index 0000000..077414b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/VersionedMapEntry.java
@@ -0,0 +1,49 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * {@link IgniteBiTuple} implementation that implements {@link GridCacheVersionAware} interface.
+ *
+ * @param <K> Entry key type.
+ * @param <V> Entry value type.
+ */
+public class VersionedMapEntry<K, V> extends IgniteBiTuple<K, V> implements GridCacheVersionAware {
+ /** Entry version. */
+ private final GridCacheVersion ver;
+
+ /**
+ * Constructor.
+ *
+ * @param val1 Entry key.
+ * @param val2 Entry value.
+ * @param ver Entry version.
+ */
+ public VersionedMapEntry(@Nullable K val1, @Nullable V val2, GridCacheVersion ver) {
+ super(val1, val2);
+ this.ver = ver;
+ }
+
+ /** {@inheritDoc} */
+ @Override public GridCacheVersion version() {
+ return ver;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
index f25e361..81eacc3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
@@ -150,7 +150,7 @@ public class GridCacheSetImpl<T> extends AbstractCollection<T> implements Ignite
}
CacheQuery qry = new GridCacheQueryAdapter<>(ctx, SET, null, null,
- new GridSetQueryPredicate<>(id, collocated), null, false, false);
+ new GridSetQueryPredicate<>(id, collocated), null, false, false, false);
Collection<ClusterNode> nodes = dataNodes(ctx.affinity().affinityTopologyVersion());
@@ -381,7 +381,7 @@ public class GridCacheSetImpl<T> extends AbstractCollection<T> implements Ignite
private GridCloseableIterator<T> iterator0() {
try {
CacheQuery qry = new GridCacheQueryAdapter<>(ctx, SET, null, null,
- new GridSetQueryPredicate<>(id, collocated), null, false, false);
+ new GridSetQueryPredicate<>(id, collocated), null, false, false, false);
Collection<ClusterNode> nodes = dataNodes(ctx.affinity().affinityTopologyVersion());
@@ -627,4 +627,4 @@ public class GridCacheSetImpl<T> extends AbstractCollection<T> implements Ignite
setName = U.readString(in);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 4808e96..94bc54c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -17,6 +17,30 @@
package org.apache.ignite.internal.processors.query;
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ExecutorService;
+import javax.cache.Cache;
+import javax.cache.CacheException;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
@@ -24,6 +48,7 @@ import org.apache.ignite.binary.BinaryField;
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.binary.BinaryType;
import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.CacheTypeMetadata;
import org.apache.ignite.cache.QueryEntity;
import org.apache.ignite.cache.QueryIndex;
@@ -40,12 +65,16 @@ import org.apache.ignite.internal.processors.GridProcessorAdapter;
import org.apache.ignite.internal.processors.cache.CacheEntryImpl;
import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.QueryCursorImpl;
import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
import org.apache.ignite.internal.processors.cache.query.CacheQueryFuture;
import org.apache.ignite.internal.processors.cache.query.CacheQueryType;
import org.apache.ignite.internal.processors.cache.query.GridCacheTwoStepQuery;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.processors.cache.version.VersionedMapEntry;
+import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
import org.apache.ignite.internal.util.GridSpinBusyLock;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -66,31 +95,6 @@ import org.apache.ignite.spi.indexing.IndexingQueryFilter;
import org.jetbrains.annotations.Nullable;
import org.jsr166.ConcurrentHashMap8;
-import javax.cache.Cache;
-import javax.cache.CacheException;
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.math.BigDecimal;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutorService;
-
import static org.apache.ignite.events.EventType.EVT_CACHE_QUERY_EXECUTED;
import static org.apache.ignite.internal.IgniteComponentType.INDEXING;
import static org.apache.ignite.internal.processors.query.GridQueryIndexType.FULLTEXT;
@@ -176,7 +180,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param ccfg Cache configuration.
* @return {@code true} If query index must be enabled for this cache.
*/
- public static boolean isEnabled(CacheConfiguration<?,?> ccfg) {
+ public static boolean isEnabled(CacheConfiguration<?, ?> ccfg) {
return !F.isEmpty(ccfg.getIndexedTypes()) ||
!F.isEmpty(ccfg.getTypeMetadata()) ||
!F.isEmpty(ccfg.getQueryEntities());
@@ -415,7 +419,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param desc Type descriptor.
* @throws IgniteCheckedException If failed.
*/
- private void addTypeByName(CacheConfiguration<?,?> ccfg, TypeDescriptor desc) throws IgniteCheckedException {
+ private void addTypeByName(CacheConfiguration<?, ?> ccfg, TypeDescriptor desc) throws IgniteCheckedException {
if (typesByName.putIfAbsent(new TypeName(ccfg.getName(), desc.name()), desc) != null)
throw new IgniteCheckedException("Type with name '" + desc.name() + "' already indexed " +
"in cache '" + ccfg.getName() + "'.");
@@ -789,7 +793,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param qry Query.
* @return Cursor.
*/
- public QueryCursor<List<?>> queryTwoStep(final GridCacheContext<?,?> cctx, final SqlFieldsQuery qry) {
+ public QueryCursor<List<?>> queryTwoStep(final GridCacheContext<?, ?> cctx, final SqlFieldsQuery qry) {
checkxEnabled();
if (!busyLock.enterBusy())
@@ -815,7 +819,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param qry Query.
* @return Cursor.
*/
- public <K,V> QueryCursor<Cache.Entry<K,V>> queryTwoStep(final GridCacheContext<?,?> cctx, final SqlQuery qry) {
+ public <K, V> QueryCursor<Cache.Entry<K, V>> queryTwoStep(final GridCacheContext<?, ?> cctx, final SqlQuery qry) {
checkxEnabled();
if (!busyLock.enterBusy())
@@ -839,6 +843,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
/**
* @param cctx Cache context.
* @param qry Query.
+ * @param keepBinary Keep binary flag.
* @return Cursor.
*/
public <K, V> Iterator<Cache.Entry<K, V>> queryLocal(
@@ -878,6 +883,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
sqlQry,
params);
+ final boolean incVerEntry = qry.isLocal();
+
return new ClIter<Cache.Entry<K, V>>() {
@Override public void close() throws Exception {
i.close();
@@ -890,6 +897,22 @@ public class GridQueryProcessor extends GridProcessorAdapter {
@Override public Cache.Entry<K, V> next() {
IgniteBiTuple<K, V> t = i.next();
+ if (incVerEntry) {
+ try {
+ GridCacheVersion ver = ((GridCacheAdapter<K, V>)cctx.cache()).peekVersion(
+ t.getKey(), new CachePeekMode[] {CachePeekMode.ALL});
+
+ return new CacheEntryImpl<>(
+ (K)cctx.unwrapBinaryIfNeeded(t.getKey(), keepBinary, false),
+ (V)cctx.unwrapBinaryIfNeeded(t.getValue(), keepBinary, false),
+ ver);
+ }
+ catch (IgniteCheckedException e) {
+ log.warning("Failed to get entry version. The entry is removed: " +
+ e.getMessage());
+ }
+ }
+
return new CacheEntryImpl<>(
(K)cctx.unwrapBinaryIfNeeded(t.getKey(), keepBinary, false),
(V)cctx.unwrapBinaryIfNeeded(t.getValue(), keepBinary, false));
@@ -944,7 +967,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param qry Query.
* @return Iterator.
*/
- public QueryCursor<List<?>> queryLocalFields(final GridCacheContext<?,?> cctx, final SqlFieldsQuery qry) {
+ public QueryCursor<List<?>> queryLocalFields(final GridCacheContext<?, ?> cctx, final SqlFieldsQuery qry) {
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to execute query (grid is stopping).");
@@ -1089,6 +1112,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param clause Clause.
* @param resType Result type.
* @param filters Key and value filters.
+ * @param incVerEntry Include versioned entry.
* @param <K> Key type.
* @param <V> Value type.
* @return Key/value rows.
@@ -1096,7 +1120,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
*/
@SuppressWarnings("unchecked")
public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> queryText(final String space, final String clause,
- final String resType, final IndexingQueryFilter filters) throws IgniteCheckedException {
+ final String resType, final IndexingQueryFilter filters, final boolean incVerEntry)
+ throws IgniteCheckedException {
checkEnabled();
if (!busyLock.enterBusy())
@@ -1112,11 +1137,16 @@ public class GridQueryProcessor extends GridProcessorAdapter {
if (type == null || !type.registered())
throw new CacheException("Failed to find SQL table for type: " + resType);
- return idx.queryText(
+ GridCloseableIterator<IgniteBiTuple<K, V>> it = idx.queryText(
space,
clause,
type,
filters);
+
+ if (incVerEntry)
+ return new VersionedEntryIter<>(it, cctx);
+ else
+ return it;
}
}, false);
}
@@ -1274,7 +1304,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
*/
private void processClassMeta(CacheTypeMetadata meta, TypeDescriptor d, CacheObjectContext coCtx)
throws IgniteCheckedException {
- Map<String,String> aliases = meta.getAliases();
+ Map<String, String> aliases = meta.getAliases();
if (aliases == null)
aliases = Collections.emptyMap();
@@ -1352,7 +1382,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
int idxOrder,
IndexType idxType,
String idxName,
- Map<String,String> aliases,
+ Map<String, String> aliases,
CacheObjectContext coCtx
) throws IgniteCheckedException {
String propName;
@@ -1400,7 +1430,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
*/
private void processBinaryMeta(CacheTypeMetadata meta, TypeDescriptor d)
throws IgniteCheckedException {
- Map<String,String> aliases = meta.getAliases();
+ Map<String, String> aliases = meta.getAliases();
if (aliases == null)
aliases = Collections.emptyMap();
@@ -1477,7 +1507,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @throws IgniteCheckedException If failed.
*/
private void processBinaryMeta(QueryEntity qryEntity, TypeDescriptor d) throws IgniteCheckedException {
- Map<String,String> aliases = qryEntity.getAliases();
+ Map<String, String> aliases = qryEntity.getAliases();
if (aliases == null)
aliases = Collections.emptyMap();
@@ -1503,7 +1533,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
TypeDescriptor d,
CacheObjectContext coCtx
) throws IgniteCheckedException {
- Map<String,String> aliases = qryEntity.getAliases();
+ Map<String, String> aliases = qryEntity.getAliases();
if (aliases == null)
aliases = Collections.emptyMap();
@@ -1517,7 +1547,6 @@ public class GridQueryProcessor extends GridProcessorAdapter {
aliases,
coCtx);
-
d.addProperty(prop, false);
}
@@ -1580,13 +1609,12 @@ public class GridQueryProcessor extends GridProcessorAdapter {
/**
* Builds binary object property.
*
- * @param pathStr String representing path to the property. May contains dots '.' to identify
- * nested fields.
+ * @param pathStr String representing path to the property. May contains dots '.' to identify nested fields.
* @param resType Result type.
* @param aliases Aliases.
* @return Binary property.
*/
- private BinaryProperty buildBinaryProperty(String pathStr, Class<?> resType, Map<String,String> aliases) {
+ private BinaryProperty buildBinaryProperty(String pathStr, Class<?> resType, Map<String, String> aliases) {
String[] path = pathStr.split("\\.");
BinaryProperty res = null;
@@ -1617,7 +1645,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @throws IgniteCheckedException If failed.
*/
private static ClassProperty buildClassProperty(Class<?> keyCls, Class<?> valCls, String pathStr, Class<?> resType,
- Map<String,String> aliases, CacheObjectContext coCtx) throws IgniteCheckedException {
+ Map<String, String> aliases, CacheObjectContext coCtx) throws IgniteCheckedException {
ClassProperty res = buildClassProperty(
true,
keyCls,
@@ -1646,7 +1674,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @return Property instance corresponding to the given path.
*/
static ClassProperty buildClassProperty(boolean key, Class<?> cls, String pathStr, Class<?> resType,
- Map<String,String> aliases, CacheObjectContext coCtx) {
+ Map<String, String> aliases, CacheObjectContext coCtx) {
String[] path = pathStr.split("\\.");
ClassProperty res = null;
@@ -1764,7 +1792,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
res = clo.apply();
if (res instanceof CacheQueryFuture) {
- CacheQueryFuture fut = (CacheQueryFuture) res;
+ CacheQueryFuture fut = (CacheQueryFuture)res;
err = fut.error();
}
@@ -1843,7 +1871,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
member instanceof Method && member.getName().startsWith("get") && member.getName().length() > 3 ?
member.getName().substring(3) : member.getName();
- ((AccessibleObject) member).setAccessible(true);
+ ((AccessibleObject)member).setAccessible(true);
field = member instanceof Field;
@@ -2314,7 +2342,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
if (descending) {
if (descendings == null)
- descendings = new HashSet<>();
+ descendings = new HashSet<>();
descendings.add(field);
}
@@ -2450,4 +2478,54 @@ public class GridQueryProcessor extends GridProcessorAdapter {
private enum IndexType {
ASC, DESC, TEXT
}
+
+ /**
+ * Iterator wrapper.
+ */
+ private class VersionedEntryIter<K, V> extends GridCloseableIteratorAdapter<IgniteBiTuple<K, V>> {
+ /** */
+ private final GridCloseableIterator<IgniteBiTuple<K, V>> it;
+
+ /** */
+ private final GridCacheContext<?, ?> cctx;
+
+ /**
+ * Constructor.
+ *
+ * @param it Underlying iterator.
+ */
+ public VersionedEntryIter(
+ GridCloseableIterator<IgniteBiTuple<K, V>> it, GridCacheContext<?, ?> cctx) {
+ this.it = it;
+ this.cctx = cctx;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteBiTuple<K, V> onNext() throws IgniteCheckedException {
+ IgniteBiTuple<K, V> t = it.next();
+
+ try {
+ GridCacheVersion ver = ((GridCacheAdapter<K, V>)cctx.cache()).peekVersion(
+ t.getKey(), new CachePeekMode[] {CachePeekMode.ALL});
+
+ return new VersionedMapEntry<>(t.getKey(), t.getValue(), ver);
+ }
+ catch (IgniteCheckedException e) {
+ log.warning("Failed to get entry version. The entry is removed: " +
+ e.getMessage());
+ }
+
+ return t;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean onHasNext() throws IgniteCheckedException {
+ return it.hasNext();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void onClose() throws IgniteCheckedException {
+ it.close();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index 6b05edd..d8df30d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -1026,7 +1026,7 @@ public class GridServiceProcessor extends GridProcessorAdapter {
GridCacheQueryManager qryMgr = cache.context().queries();
- CacheQuery<Map.Entry<Object, Object>> qry = qryMgr.createScanQuery(p, null, false);
+ CacheQuery<Map.Entry<Object, Object>> qry = qryMgr.createScanQuery(p, null, false, false);
qry.keepAll(false);
@@ -1458,4 +1458,4 @@ public class GridServiceProcessor extends GridProcessorAdapter {
return S.toString(ServiceAssignmentsPredicate.class, this);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
index 56a480e..19d7f0e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
@@ -92,7 +92,7 @@ public class GridCacheFullTextQueryMultithreadedSelfTest extends GridCacheAbstra
// Create query.
final CacheQuery<Map.Entry<Integer, H2TextValue>> qry = c.context().queries().createFullTextQuery(
- H2TextValue.class.getName(), txt, false);
+ H2TextValue.class.getName(), txt, false, false);
qry.enableDedup(false);
qry.includeBackups(false);
@@ -155,4 +155,4 @@ public class GridCacheFullTextQueryMultithreadedSelfTest extends GridCacheAbstra
return S.toString(H2TextValue.class, this);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
index e434b49..c51336e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
@@ -180,7 +180,8 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
for (int j = 0; j < G.allGrids().size(); j++) {
GridCacheAdapter<Object, MyValue> c2 = ((IgniteKernal)grid(j)).internalCache("two");
- CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, null, false);
+ CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, null, false,
+ false);
int totalCnt = F.sumInt(qry.execute(new EntryIntegerIgniteReducer()).get());
@@ -283,4 +284,4 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
return cnt;
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
index 6a7a68b..30dec7d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
@@ -185,7 +185,8 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
for (int j = 0; j < G.allGrids().size(); j++) {
GridCacheAdapter<Object, MyValue> c2 = ((IgniteKernal)grid(j)).internalCache("two");
- CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, null, false);
+ CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, null, false,
+ false);
final int i0 = j;
final int j0 = i;
@@ -315,4 +316,4 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
return cnt;
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
index 37cf26d..e524e4b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache.version;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import javax.cache.Cache;
@@ -26,7 +27,13 @@ import javax.cache.processor.EntryProcessorException;
import javax.cache.processor.MutableEntry;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheEntry;
+import org.apache.ignite.cache.CacheMemoryMode;
import org.apache.ignite.cache.CachePeekMode;
+import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
+import org.apache.ignite.cache.query.ScanQuery;
+import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
/**
@@ -34,7 +41,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
*/
public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractSelfTest {
/** Entries number to store in a cache. */
- private static final int ENTRIES_NUM = 500;
+ protected static final int ENTRIES_NUM = 500;
/** {@inheritDoc} */
@Override protected int gridCount() {
@@ -42,126 +49,50 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
}
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- super.beforeTest();
-
- Cache<Integer, String> cache = grid(0).cache(null);
-
- for (int i = 0 ; i < ENTRIES_NUM; i++)
- cache.put(i, "value_" + i);
+ @Override protected NearCacheConfiguration nearConfiguration() {
+ return null;
}
/**
- * @throws Exception If failed.
+ * Memory mode.
+ *
+ * @return Cache memory mode.
*/
- public void testInvoke() throws Exception {
- Cache<Integer, String> cache = grid(0).cache(null);
-
- final AtomicInteger invoked = new AtomicInteger();
-
- cache.invoke(100, new EntryProcessor<Integer, String, Object>() {
- @Override public Object process(MutableEntry<Integer, String> entry, Object... arguments)
- throws EntryProcessorException {
-
- invoked.incrementAndGet();
-
- CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
-
- checkVersionedEntry(verEntry);
-
- return entry;
- }
- });
-
- assert invoked.get() > 0;
+ protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.ONHEAP_TIERED;
}
- /**
- * @throws Exception If failed.
- */
- public void testInvokeAll() throws Exception {
- Cache<Integer, String> cache = grid(0).cache(null);
-
- Set<Integer> keys = new HashSet<>();
-
- for (int i = 0; i < ENTRIES_NUM; i++)
- keys.add(i);
-
- final AtomicInteger invoked = new AtomicInteger();
-
- cache.invokeAll(keys, new EntryProcessor<Integer, String, Object>() {
- @Override public Object process(MutableEntry<Integer, String> entry, Object... arguments)
- throws EntryProcessorException {
-
- invoked.incrementAndGet();
-
- CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
-
- checkVersionedEntry(verEntry);
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+ CacheConfiguration<Integer, String> cfg = super.cacheConfiguration(gridName);
- return null;
- }
- });
+ cfg.setMemoryMode(memoryMode());
- assert invoked.get() > 0;
- }
+ if (swapEnabled()) {
+ if (cfg.getMemoryMode() == CacheMemoryMode.ONHEAP_TIERED)
+ cfg.setOffHeapMaxMemory(-1);
- /**
- * @throws Exception If failed.
- */
- public void testRandomEntry() throws Exception {
- IgniteCache<Integer, String> cache = grid(0).cache(null);
+ cfg.setEvictionPolicy(new LruEvictionPolicy(ENTRIES_NUM / 2));
+ cfg.setStatisticsEnabled(true);
+ }
- for (int i = 0; i < 5; i++)
- checkVersionedEntry(cache.randomEntry().unwrap(CacheEntry.class));
+ return cfg;
}
- /**
- * @throws Exception If failed.
- */
- public void testLocalPeek() throws Exception {
- IgniteCache<Integer, String> cache = grid(0).cache(null);
-
- Iterable<Cache.Entry<Integer, String>> entries = offheapTiered(cache) ?
- cache.localEntries(CachePeekMode.SWAP, CachePeekMode.OFFHEAP) :
- cache.localEntries(CachePeekMode.ONHEAP);
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ super.beforeTest();
- for (Cache.Entry<Integer, String> entry : entries)
- checkVersionedEntry(entry.unwrap(CacheEntry.class));
- }
+ Cache<Integer, String> cache = grid(0).cache(null);
- /**
- * @throws Exception If failed.
- */
- public void testVersionComparision() throws Exception {
- IgniteCache<Integer, String> cache = grid(0).cache(null);
-
- CacheEntry<String, Integer> ver1 = cache.invoke(100,
- new EntryProcessor<Integer, String, CacheEntry<String, Integer>>() {
- @Override public CacheEntry<String, Integer> process(MutableEntry<Integer, String> entry,
- Object... arguments) throws EntryProcessorException {
- return entry.unwrap(CacheEntry.class);
- }
- });
-
- cache.put(100, "new value 100");
-
- CacheEntry<String, Integer> ver2 = cache.invoke(100,
- new EntryProcessor<Integer, String, CacheEntry<String, Integer>>() {
- @Override public CacheEntry<String, Integer> process(MutableEntry<Integer, String> entry,
- Object... arguments) throws EntryProcessorException {
- return entry.unwrap(CacheEntry.class);
- }
- });
-
- assert ver1.version().compareTo(ver2.version()) < 0;
- assert ver1.updateTime() <= ver2.updateTime();
+ for (int i = 0 ; i < ENTRIES_NUM; i++)
+ cache.put(i, "value_" + i);
}
/**
* @param entry Versioned entry.
*/
- private void checkVersionedEntry(CacheEntry<Integer, String> entry) {
+ protected void checkVersionedEntry(CacheEntry<Integer, String> entry) {
assertNotNull(entry);
assertNotNull(entry.version());
@@ -170,4 +101,4 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
assertNotNull(entry.getKey());
assertNotNull(entry.getValue());
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryBasicTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryBasicTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryBasicTest.java
new file mode 100644
index 0000000..ae8b4b8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryBasicTest.java
@@ -0,0 +1,182 @@
+/*
+ * 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.version;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+import javax.cache.Cache;
+import javax.cache.processor.EntryProcessor;
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheEntry;
+import org.apache.ignite.cache.CachePeekMode;
+import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
+import org.apache.ignite.cache.query.ScanQuery;
+import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
+
+/**
+ * Versioned entry abstract test.
+ */
+public abstract class CacheVersionedEntryBasicTest extends CacheVersionedEntryAbstractTest {
+ /**
+ * @throws Exception If failed.
+ */
+ public void testInvoke() throws Exception {
+ Cache<Integer, String> cache = grid(0).cache(null);
+
+ final AtomicInteger invoked = new AtomicInteger();
+
+ cache.invoke(100, new EntryProcessor<Integer, String, Object>() {
+ @Override public Object process(MutableEntry<Integer, String> entry, Object... arguments)
+ throws EntryProcessorException {
+
+ invoked.incrementAndGet();
+
+ CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
+
+ checkVersionedEntry(verEntry);
+
+ return entry;
+ }
+ });
+
+ assert invoked.get() > 0;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testInvokeAll() throws Exception {
+ Cache<Integer, String> cache = grid(0).cache(null);
+
+ Set<Integer> keys = new HashSet<>();
+
+ for (int i = 0; i < ENTRIES_NUM; i++)
+ keys.add(i);
+
+ final AtomicInteger invoked = new AtomicInteger();
+
+ cache.invokeAll(keys, new EntryProcessor<Integer, String, Object>() {
+ @Override public Object process(MutableEntry<Integer, String> entry, Object... arguments)
+ throws EntryProcessorException {
+
+ invoked.incrementAndGet();
+
+ CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
+
+ checkVersionedEntry(verEntry);
+
+ return null;
+ }
+ });
+
+ assert invoked.get() > 0;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testRandomEntry() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ for (int i = 0; i < 5; i++)
+ checkVersionedEntry(cache.randomEntry().unwrap(CacheEntry.class));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLocalPeek() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ Iterable<Cache.Entry<Integer, String>> entries = offheapTiered(cache) ?
+ cache.localEntries(CachePeekMode.SWAP, CachePeekMode.OFFHEAP) :
+ cache.localEntries(CachePeekMode.ONHEAP);
+
+ for (Cache.Entry<Integer, String> entry : entries)
+ checkVersionedEntry(entry.unwrap(CacheEntry.class));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testVersionComparision() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ CacheEntry<Integer, String> ver1 = cache.invoke(100,
+ new EntryProcessor<Integer, String, CacheEntry<Integer, String>>() {
+ @Override public CacheEntry<Integer, String> process(MutableEntry<Integer, String> entry,
+ Object... arguments) throws EntryProcessorException {
+ return entry.unwrap(CacheEntry.class);
+ }
+ });
+
+ cache.put(100, "new value 100");
+
+ CacheEntry<Integer, String> ver2 = cache.invoke(100,
+ new EntryProcessor<Integer, String, CacheEntry<Integer, String>>() {
+ @Override public CacheEntry<Integer, String> process(MutableEntry<Integer, String> entry,
+ Object... arguments) throws EntryProcessorException {
+ return entry.unwrap(CacheEntry.class);
+ }
+ });
+
+ assert ver1.version().compareTo(ver2.version()) < 0;
+ assert ver1.updateTime() <= ver2.updateTime();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLocalScanQuery() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ ScanQuery<Integer, String> query = new ScanQuery<>();
+
+ query.setLocal(true);
+
+ List<Cache.Entry<Integer, String>> res = cache.query(query).getAll();
+
+ for (Cache.Entry<Integer, String> entry : res)
+ checkVersionedEntry(entry.unwrap(CacheEntry.class));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLocalScanQueryNoVersion() throws Exception {
+ IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+ ScanQuery<Integer, String> query = new ScanQuery<>();
+
+ List<Cache.Entry<Integer, String>> res = cache.query(query).getAll();
+
+ assert !res.isEmpty() : "Wrong entries size: " + res.size();
+
+ for (Cache.Entry<Integer, String> entry : res) {
+ CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
+
+ assertNull(verEntry.version());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java
deleted file mode 100644
index 2409b00..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java
+++ /dev/null
@@ -1,46 +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.version;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-
-/**
- *
- */
-public class CacheVersionedEntryLocalAtomicSwapDisabledSelfTest extends CacheVersionedEntryAbstractTest {
- /** {@inheritDoc} */
- @Override protected int gridCount() {
- return 1;
- }
-
- /** {@inheritDoc} */
- @Override protected CacheMode cacheMode() {
- return CacheMode.LOCAL;
- }
-
- /** {@inheritDoc} */
- @Override protected CacheAtomicityMode atomicityMode() {
- return CacheAtomicityMode.ATOMIC;
- }
-
- /** {@inheritDoc} */
- @Override protected boolean swapEnabled() {
- return false;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java
index d7fc938..0ec12f6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java
@@ -23,7 +23,7 @@ import org.apache.ignite.cache.CacheMode;
/**
*
*/
-public class CacheVersionedEntryLocalTransactionalSelfTest extends CacheVersionedEntryAbstractTest {
+public class CacheVersionedEntryLocalTransactionalSelfTest extends CacheVersionedEntryBasicTest {
/** {@inheritDoc} */
@Override protected int gridCount() {
return 1;
@@ -38,4 +38,4 @@ public class CacheVersionedEntryLocalTransactionalSelfTest extends CacheVersione
@Override protected CacheAtomicityMode atomicityMode() {
return CacheAtomicityMode.TRANSACTIONAL;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java
index 029aa71..6239dbf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java
@@ -18,18 +18,13 @@
package org.apache.ignite.internal.processors.cache.version;
import org.apache.ignite.cache.CacheMemoryMode;
-import org.apache.ignite.configuration.CacheConfiguration;
/**
*
*/
public class CacheVersionedEntryPartitionedAtomicOffHeapSelfTest extends CacheVersionedEntryPartitionedAtomicSelfTest {
/** {@inheritDoc} */
- @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
- CacheConfiguration cfg = super.cacheConfiguration(gridName);
-
- cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-
- return cfg;
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapValuesSelfTest.java
new file mode 100644
index 0000000..c2d8cb2
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapValuesSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ *
+ */
+public class CacheVersionedEntryPartitionedAtomicOffHeapValuesSelfTest extends CacheVersionedEntryPartitionedAtomicSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_VALUES;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java
index 53dc473..80d1e61 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java
@@ -23,7 +23,7 @@ import org.apache.ignite.cache.CacheMode;
/**
*
*/
-public class CacheVersionedEntryPartitionedAtomicSelfTest extends CacheVersionedEntryAbstractTest {
+public class CacheVersionedEntryPartitionedAtomicSelfTest extends CacheVersionedEntryBasicTest {
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return CacheMode.PARTITIONED;
@@ -33,4 +33,4 @@ public class CacheVersionedEntryPartitionedAtomicSelfTest extends CacheVersioned
@Override protected CacheAtomicityMode atomicityMode() {
return CacheAtomicityMode.ATOMIC;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java
index d7f8119..1e63481 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java
@@ -26,11 +26,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
public class CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest extends
CacheVersionedEntryPartitionedTransactionalSelfTest {
/** {@inheritDoc} */
- @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
- CacheConfiguration cfg = super.cacheConfiguration(gridName);
-
- cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-
- return cfg;
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapValuesSelfTest.java
new file mode 100644
index 0000000..8787bad
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapValuesSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ *
+ */
+public class CacheVersionedEntryPartitionedTransactionalOffHeapValuesSelfTest extends
+ CacheVersionedEntryPartitionedTransactionalSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_VALUES;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java
index cdc8c1e..2f5064c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java
@@ -23,7 +23,7 @@ import org.apache.ignite.cache.CacheMode;
/**
*
*/
-public class CacheVersionedEntryPartitionedTransactionalSelfTest extends CacheVersionedEntryAbstractTest {
+public class CacheVersionedEntryPartitionedTransactionalSelfTest extends CacheVersionedEntryBasicTest {
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return CacheMode.PARTITIONED;
@@ -33,4 +33,4 @@ public class CacheVersionedEntryPartitionedTransactionalSelfTest extends CacheVe
@Override protected CacheAtomicityMode atomicityMode() {
return CacheAtomicityMode.TRANSACTIONAL;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java
index 11cc0b9..a0730a8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java
@@ -25,11 +25,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
*/
public class CacheVersionedEntryReplicatedAtomicOffHeapSelfTest extends CacheVersionedEntryReplicatedAtomicSelfTest {
/** {@inheritDoc} */
- @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
- CacheConfiguration cfg = super.cacheConfiguration(gridName);
-
- cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-
- return cfg;
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapValuesSelfTest.java
new file mode 100644
index 0000000..6843f97
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapValuesSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ *
+ */
+public class CacheVersionedEntryReplicatedAtomicOffHeapValuesSelfTest extends CacheVersionedEntryReplicatedAtomicSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_VALUES;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b0dab5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java
index 747f139..4d2953c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java
@@ -23,7 +23,7 @@ import org.apache.ignite.cache.CacheMode;
/**
*
*/
-public class CacheVersionedEntryReplicatedAtomicSelfTest extends CacheVersionedEntryAbstractTest {
+public class CacheVersionedEntryReplicatedAtomicSelfTest extends CacheVersionedEntryBasicTest {
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return CacheMode.REPLICATED;
@@ -33,4 +33,4 @@ public class CacheVersionedEntryReplicatedAtomicSelfTest extends CacheVersionedE
@Override protected CacheAtomicityMode atomicityMode() {
return CacheAtomicityMode.ATOMIC;
}
-}
\ No newline at end of file
+}