Merge branch ignite-sql-tests into ignite-45
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/769cdab3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/769cdab3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/769cdab3 Branch: refs/heads/ignite-45 Commit: 769cdab3a9a5f29156ab195b4db3b721e8a74a0f Parents: c82d4d8 Author: Alexey Goncharuk <agoncha...@gridgain.com> Authored: Fri Mar 13 18:43:09 2015 -0700 Committer: Alexey Goncharuk <agoncha...@gridgain.com> Committed: Fri Mar 13 18:43:09 2015 -0700 ---------------------------------------------------------------------- .../datagrid/CachePopularNumbersExample.java | 11 ++----- .../examples/datagrid/CacheQueryExample.java | 34 +++++++------------- .../starschema/CacheStarSchemaExample.java | 24 ++++++++------ .../ScalarCachePopularNumbersExample.scala | 1 - .../processors/cache/GridCacheAdapter.java | 32 +++++++++--------- .../processors/cache/GridCacheAttributes.java | 29 +++-------------- .../processors/cache/GridCacheProcessor.java | 27 ++++------------ .../cache/IgniteCacheTxPreloadNoWriteTest.java | 1 - .../processors/query/h2/IgniteH2Indexing.java | 27 +++------------- ...niteCachePartitionedFieldsQuerySelfTest.java | 6 ++-- 10 files changed, 63 insertions(+), 129 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java index 9d3cd4c..f16b71e 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java @@ -69,14 +69,9 @@ public class CachePopularNumbersExample { cfg.setCacheMode(CacheMode.PARTITIONED); cfg.setName(CACHE_NAME); - cfg.setQueryIndexEnabled(true); - - CacheQueryConfiguration qCfg = new CacheQueryConfiguration(); - - qCfg.setIndexPrimitiveKey(true); - qCfg.setIndexPrimitiveValue(true); - - cfg.setQueryConfiguration(qCfg); + cfg.setIndexedTypes( + Integer.class, Long.class + ); try (IgniteCache<Integer, Long> cache = ignite.createCache(cfg)) { ClusterGroup prj = ignite.cluster().forCacheNodes(CACHE_NAME); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java index 08acfec..663b3c8 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java @@ -86,7 +86,10 @@ public class CacheQueryExample { cfg.setCacheMode(CacheMode.PARTITIONED); cfg.setName(CACHE_NAME); - cfg.setQueryIndexEnabled(true); + cfg.setIndexedTypes( + UUID.class, Organization.class, + CacheAffinityKey.class, Person.class + ); try (IgniteCache<?, ?> cache = ignite.createCache(cfg)) { // Populate cache. @@ -122,10 +125,8 @@ public class CacheQueryExample { /** * Example for SQL queries based on salary ranges. - * - * @throws IgniteCheckedException In case of error. */ - private static void sqlQuery() throws IgniteCheckedException { + private static void sqlQuery() { IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().jcache(CACHE_NAME); // SQL clause which selects salaries based on range. @@ -144,10 +145,8 @@ public class CacheQueryExample { /** * Example for SQL queries based on all employees working for a specific organization. - * - * @throws IgniteCheckedException In case of error. */ - private static void sqlQueryWithJoin() throws IgniteCheckedException { + private static void sqlQueryWithJoin() { IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().jcache(CACHE_NAME); // SQL clause query which joins on 2 types to select people for a specific organization. @@ -165,10 +164,8 @@ public class CacheQueryExample { /** * Example for TEXT queries using LUCENE-based indexing of people's resumes. - * - * @throws IgniteCheckedException In case of error. */ - private static void textQuery() throws IgniteCheckedException { + private static void textQuery() { IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().jcache(CACHE_NAME); // Query for all people with "Master Degree" in their resumes. @@ -185,10 +182,8 @@ public class CacheQueryExample { /** * Example for SQL queries to calculate average salary for a specific organization. - * - * @throws IgniteCheckedException In case of error. */ - private static void sqlQueryWithAggregation() throws IgniteCheckedException { + private static void sqlQueryWithAggregation() { IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().jcache(CACHE_NAME); // Calculate average of salary of all persons in GridGain. @@ -203,10 +198,8 @@ public class CacheQueryExample { /** * Example for SQL-based fields queries that return only required * fields instead of whole key-value pairs. - * - * @throws IgniteCheckedException In case of error. */ - private static void sqlFieldsQuery() throws IgniteCheckedException { + private static void sqlFieldsQuery() { IgniteCache<?, ?> cache = Ignition.ignite().jcache(CACHE_NAME); // Create query to get names of all employees. @@ -224,10 +217,8 @@ public class CacheQueryExample { /** * Example for SQL-based fields queries that return only required * fields instead of whole key-value pairs. - * - * @throws IgniteCheckedException In case of error. */ - private static void sqlFieldsQueryWithJoin() throws IgniteCheckedException { + private static void sqlFieldsQueryWithJoin() { IgniteCache<?, ?> cache = Ignition.ignite().jcache(CACHE_NAME); // Execute query to get names of all employees. @@ -244,11 +235,8 @@ public class CacheQueryExample { /** * Populate cache with test data. - * - * @throws IgniteCheckedException In case of error. - * @throws InterruptedException In case of error. */ - private static void initialize() throws IgniteCheckedException, InterruptedException { + private static void initialize() { IgniteCache cache = Ignition.ignite().jcache(CACHE_NAME); // Organizations. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java index 539cf8d..0c8dd35 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java @@ -69,9 +69,8 @@ public class CacheStarSchemaExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. */ - public static void main(String[] args) throws IgniteCheckedException { + public static void main(String[] args) { try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); @@ -81,21 +80,26 @@ public class CacheStarSchemaExample { factCacheCfg.setCacheMode(CacheMode.PARTITIONED); factCacheCfg.setName(PARTITIONED_CACHE_NAME); - factCacheCfg.setQueryIndexEnabled(true); + factCacheCfg.setIndexedTypes( + Integer.class, FactPurchase.class + ); CacheConfiguration<Integer, Object> dimCacheCfg = new CacheConfiguration<>(); dimCacheCfg.setCacheMode(CacheMode.REPLICATED); dimCacheCfg.setName(REPLICATED_CACHE_NAME); - dimCacheCfg.setQueryIndexEnabled(true); + dimCacheCfg.setIndexedTypes( + Integer.class, DimStore.class, + Integer.class, DimProduct.class + ); try (IgniteCache<Integer, FactPurchase> factCache = ignite.createCache(factCacheCfg); IgniteCache<Integer, Object> dimCache = ignite.createCache(dimCacheCfg)) { populateDimensions(dimCache); populateFacts(factCache); - queryStorePurchases(factCache); - queryProductPurchases(factCache); + queryStorePurchases(); + queryProductPurchases(); } } } @@ -107,7 +111,7 @@ public class CacheStarSchemaExample { * * @throws IgniteException If failed. */ - private static void populateDimensions(IgniteCache<Integer, Object> dimCache) throws IgniteException { + private static void populateDimensions(Cache<Integer, Object> dimCache) throws IgniteException { DimStore store1 = new DimStore(idGen++, "Store1", "12345", "321 Chilly Dr, NY"); DimStore store2 = new DimStore(idGen++, "Store2", "54321", "123 Windy Dr, San Francisco"); @@ -136,7 +140,7 @@ public class CacheStarSchemaExample { * * @throws IgniteException If failed. */ - private static void populateFacts(IgniteCache<Integer, FactPurchase> factCache) throws IgniteException { + private static void populateFacts(Cache<Integer, FactPurchase> factCache) throws IgniteException { for (int i = 0; i < 100; i++) { int id = idGen++; @@ -154,7 +158,7 @@ public class CacheStarSchemaExample { * * @throws IgniteException If failed. */ - private static void queryStorePurchases() throws IgniteCheckedException { + private static void queryStorePurchases() { IgniteCache<Integer, FactPurchase> factCache = Ignition.ignite().jcache(PARTITIONED_CACHE_NAME); // All purchases for store1. @@ -177,7 +181,7 @@ public class CacheStarSchemaExample { * * @throws IgniteException If failed. */ - private static void queryProductPurchases() throws IgniteCheckedException { + private static void queryProductPurchases() { IgniteCache<Integer, FactPurchase> factCache = Ignition.ignite().jcache(PARTITIONED_CACHE_NAME); // All purchases for certain product made at store2. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala index e65a679..2a5b8c6 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala @@ -21,7 +21,6 @@ import java.util.Timer import org.apache.ignite.IgniteException import org.apache.ignite.examples.ExampleNodeStartup -import org.apache.ignite.examples.datagrid.CacheNodeStartup import org.apache.ignite.internal.util.scala.impl import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/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 7846eb7..81aa5eb 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 @@ -84,7 +84,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** Deserialization stash. */ private static final ThreadLocal<IgniteBiTuple<String, String>> stash = new ThreadLocal<IgniteBiTuple<String, - String>>() { + String>>() { @Override protected IgniteBiTuple<String, String> initialValue() { return F.t2(); } @@ -93,7 +93,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@link GridCacheReturn}-to-value conversion. */ private static final IgniteClosure RET2VAL = new CX1<IgniteInternalFuture<GridCacheReturn>, Object>() { - @Nullable @Override public Object applyx(IgniteInternalFuture<GridCacheReturn> fut) throws IgniteCheckedException { + @Nullable @Override public Object applyx(IgniteInternalFuture<GridCacheReturn> fut) + throws IgniteCheckedException { return fut.get().value(); } @@ -105,7 +106,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@link GridCacheReturn}-to-null conversion. */ protected static final IgniteClosure RET2NULL = new CX1<IgniteInternalFuture<GridCacheReturn>, Object>() { - @Nullable @Override public Object applyx(IgniteInternalFuture<GridCacheReturn> fut) throws IgniteCheckedException { + @Nullable @Override public Object applyx(IgniteInternalFuture<GridCacheReturn> fut) + throws IgniteCheckedException { fut.get(); return null; @@ -746,8 +748,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Nullable @Override public V localPeek(K key, CachePeekMode[] peekModes, @Nullable IgniteCacheExpiryPolicy plc) - throws IgniteCheckedException - { + throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -888,7 +889,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public V peek(K key) { - return peek(key, (CacheEntryPredicate) null); + return peek(key, (CacheEntryPredicate)null); } /** {@inheritDoc} */ @@ -946,7 +947,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, val0 = ctx.unwrapPortableIfNeeded(val0, ctx.keepPortable()); - return F.t((V) val0); + return F.t((V)val0); } } @@ -1185,7 +1186,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, * @param touch Flag to touch created entry (only if entry was actually created). * @return Entry or <tt>null</tt>. */ - @Nullable private GridCacheEntryEx entry0(KeyCacheObject key, AffinityTopologyVersion topVer, boolean create, boolean touch) { + @Nullable private GridCacheEntryEx entry0(KeyCacheObject key, AffinityTopologyVersion topVer, boolean create, + boolean touch) { GridTriple<GridCacheMapEntry> t = map.putEntryIfObsoleteOrAbsent(topVer, key, null, ctx.config().getDefaultTimeToLive(), create); @@ -1227,7 +1229,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public Set<Cache.Entry<K, V>> entrySet() { - return entrySet((CacheEntryPredicate[]) null); + return entrySet((CacheEntryPredicate[])null); } /** {@inheritDoc} */ @@ -1250,22 +1252,22 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public Set<Cache.Entry<K, V>> primaryEntrySet() { - return primaryEntrySet((CacheEntryPredicate[]) null); + return primaryEntrySet((CacheEntryPredicate[])null); } /** {@inheritDoc} */ @Override public Set<K> keySet() { - return keySet((CacheEntryPredicate[]) null); + return keySet((CacheEntryPredicate[])null); } /** {@inheritDoc} */ @Override public Set<K> primaryKeySet() { - return primaryKeySet((CacheEntryPredicate[]) null); + return primaryKeySet((CacheEntryPredicate[])null); } /** {@inheritDoc} */ @Override public Collection<V> values() { - return values((CacheEntryPredicate[]) null); + return values((CacheEntryPredicate[])null); } /** {@inheritDoc} */ @@ -1477,7 +1479,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, try { // Send job to remote nodes only. Collection<ClusterNode> nodes = - ctx.grid().cluster().forCacheNodes(name(), NEAR_AND_DATA_NODES).forRemotes().nodes(); + ctx.grid().cluster().forCacheNodes(name(), true, true, false).forRemotes().nodes(); IgniteInternalFuture<Object> fut = null; @@ -1512,7 +1514,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, * @return Future. */ private IgniteInternalFuture<?> clearAsync(GlobalClearCallable clearCall) { - Collection<ClusterNode> nodes = ctx.grid().cluster().forCacheNodes(name(), NEAR_AND_DATA_NODES).nodes(); + Collection<ClusterNode> nodes = ctx.grid().cluster().forCacheNodes(name(), true, true, false).nodes(); if (!nodes.isEmpty()) { IgniteInternalFuture<Object> fut = http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java index e8f9ce7..bf89b98 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java @@ -104,8 +104,8 @@ public class GridCacheAttributes implements Serializable { /** * @return Preload mode. */ - public CachePreloadMode cachePreloadMode() { - return ccfg.getPreloadMode(); + public CacheRebalanceMode cacheRebalanceMode() { + return ccfg.getRebalanceMode(); } /** @@ -228,13 +228,6 @@ public class GridCacheAttributes implements Serializable { } /** - * @return Default query timeout. - */ - public long defaultQueryTimeout() { - return ccfg.getDefaultQueryTimeout(); - } - - /** * @return Default lock timeout. */ public long defaultLockTimeout() { @@ -244,8 +237,8 @@ public class GridCacheAttributes implements Serializable { /** * @return Preload batch size. */ - public int preloadBatchSize() { - return ccfg.getPreloadBatchSize(); + public int rebalanceBatchSize() { + return ccfg.getRebalanceBatchSize(); } /** @@ -256,13 +249,6 @@ public class GridCacheAttributes implements Serializable { } /** - * @return Flag indicating whether query indexing is enabled. - */ - public boolean queryIndexEnabled() { - return ccfg.isQueryIndexEnabled(); - } - - /** * @return Flag indicating whether read-through behaviour is enabled. */ public boolean readThrough() { @@ -319,13 +305,6 @@ public class GridCacheAttributes implements Serializable { } /** - * @return Name of SPI to use for indexing. - */ - public String indexingSpiName() { - return ccfg.getIndexingSpiName(); - } - - /** * @return Interceptor class name. */ public String interceptorClassName() { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index a9b054d..ad23b14 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -697,12 +697,12 @@ public class GridCacheProcessor extends GridProcessorAdapter { for (Map.Entry<String, GridCacheAdapter<?, ?>> e : caches.entrySet()) { GridCacheAdapter cache = e.getValue(); - if (maxPreloadOrder > 0) { + if (maxRebalanceOrder > 0) { CacheConfiguration cfg = cache.configuration(); - int order = cfg.getPreloadOrder(); + int order = cfg.getRebalanceOrder(); - if (order > 0 && order != maxPreloadOrder && cfg.getCacheMode() != LOCAL) { + if (order > 0 && order != maxRebalanceOrder && cfg.getCacheMode() != LOCAL) { GridCompoundFuture<Object, Object> fut = (GridCompoundFuture<Object, Object>)preloadFuts .get(order); @@ -727,9 +727,9 @@ public class GridCacheProcessor extends GridProcessorAdapter { for (GridCacheAdapter<?, ?> cache : caches.values()) { CacheConfiguration cfg = cache.configuration(); - if (cfg.getPreloadMode() == SYNC) { + if (cfg.getRebalanceMode() == SYNC) { if (cfg.getCacheMode() == REPLICATED || - (cfg.getCacheMode() == PARTITIONED && cfg.getPreloadPartitionedDelay() >= 0)) + (cfg.getCacheMode() == PARTITIONED && cfg.getRebalanceDelay() >= 0)) cache.preloader().syncFuture().get(); } } @@ -1749,7 +1749,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { "Cache atomicity mode", locAttr.atomicityMode(), rmtAttr.atomicityMode(), true); CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cachePreloadMode", - "Cache preload mode", locAttr.cachePreloadMode(), rmtAttr.cachePreloadMode(), true); + "Cache preload mode", locAttr.cacheRebalanceMode(), rmtAttr.cacheRebalanceMode(), true); CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cacheAffinity", "Cache affinity", locAttr.cacheAffinityClassName(), rmtAttr.cacheAffinityClassName(), true); @@ -1775,15 +1775,11 @@ public class GridCacheProcessor extends GridProcessorAdapter { CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "defaultLockTimeout", "Default lock timeout", locAttr.defaultLockTimeout(), rmtAttr.defaultLockTimeout(), false); - CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "defaultQueryTimeout", - "Default query timeout", locAttr.defaultQueryTimeout(), rmtAttr.defaultQueryTimeout(), - false); - CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "defaultTimeToLive", "Default time to live", locAttr.defaultTimeToLive(), rmtAttr.defaultTimeToLive(), false); CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "preloadBatchSize", - "Preload batch size", locAttr.preloadBatchSize(), rmtAttr.preloadBatchSize(), false); + "Preload batch size", locAttr.rebalanceBatchSize(), rmtAttr.rebalanceBatchSize(), false); CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "swapEnabled", "Swap enabled", locAttr.swapEnabled(), rmtAttr.swapEnabled(), false); @@ -1815,15 +1811,6 @@ public class GridCacheProcessor extends GridProcessorAdapter { "Eviction max overflow ratio", locAttr.evictMaxOverflowRatio(), rmtAttr.evictMaxOverflowRatio(), true); - CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "indexingSpiName", "IndexingSpiName", - locAttr.indexingSpiName(), rmtAttr.indexingSpiName(), true); - - CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "queryIndexEnabled", - "Query index enabled", locAttr.queryIndexEnabled(), rmtAttr.queryIndexEnabled(), true); - - CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "queryIndexEnabled", - "Query index enabled", locAttr.queryIndexEnabled(), rmtAttr.queryIndexEnabled(), true); - if (locAttr.cacheMode() == PARTITIONED) { CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "evictSynchronized", "Eviction synchronized", locAttr.evictSynchronized(), rmtAttr.evictSynchronized(), http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPreloadNoWriteTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPreloadNoWriteTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPreloadNoWriteTest.java index 0a9b89d..95c71f9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPreloadNoWriteTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTxPreloadNoWriteTest.java @@ -57,7 +57,6 @@ public class IgniteCacheTxPreloadNoWriteTest extends GridCommonAbstractTest { CacheConfiguration ccfg = new CacheConfiguration(); ccfg.setCacheMode(REPLICATED); - ccfg.setDistributionMode(PARTITIONED_ONLY); ccfg.setAtomicityMode(TRANSACTIONAL); ccfg.setRebalanceMode(CacheRebalanceMode.ASYNC); ccfg.setAffinity(new CacheRendezvousAffinityFunction(false, 100)); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java index 9965b05..f28a479 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java @@ -252,7 +252,7 @@ public class IgniteH2Indexing implements GridQueryIndexing { * @param schema Schema name. * @throws IgniteCheckedException If failed to create db schema. */ - private void dropSchemaIfExists(String schema) throws IgniteCheckedException { + private void dropSchema(String schema) throws IgniteCheckedException { executeStatement("INFORMATION_SCHEMA", "DROP SCHEMA IF EXISTS \"" + schema + '"'); if (log.isDebugEnabled()) @@ -1200,17 +1200,14 @@ public class IgniteH2Indexing implements GridQueryIndexing { /** {@inheritDoc} */ @Override public void onCacheStarted(GridCacheContext ctx) throws IgniteCheckedException { - if (registerSpace(ctx.name())) - createSchemaIfAbsent(schema(ctx.name())); + createSchema(schema(ctx.name())); } /** {@inheritDoc} */ @Override public void onCacheStopped(GridCacheContext ctx) throws IgniteCheckedException { - if (unregisterSpace(ctx.name())) { - dropSchemaIfExists(schema(ctx.name())); + dropSchema(schema(ctx.name())); - schemas.remove(schema(ctx.name())); - } + schemas.remove(schema(ctx.name())); } /** @@ -1308,22 +1305,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { } /** - * @param spaceName Space name. - * @return {@code True} if space was added by this call. - */ - public boolean registerSpace(String spaceName) { - return schemaNames.add(schema(spaceName)); - } - - /** - * @param spaceName Space name. - * @return {@code True} if space was removed by this call. - */ - public boolean unregisterSpace(String spaceName) { - return schemaNames.remove(schema(spaceName)); - } - - /** * Wrapper to store connection and flag is schema set or not. */ private static class ConnectionWrapper { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/769cdab3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java index f20a998..38700f2 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java @@ -37,8 +37,8 @@ public class IgniteCachePartitionedFieldsQuerySelfTest extends IgniteCacheAbstra /** * @return Distribution. */ - protected CacheDistributionMode distributionMode() { - return NEAR_PARTITIONED; + protected NearCacheConfiguration nearConfiguration() { + return new NearCacheConfiguration(); } /** {@inheritDoc} */ @@ -50,7 +50,7 @@ public class IgniteCachePartitionedFieldsQuerySelfTest extends IgniteCacheAbstra @Override protected CacheConfiguration cache(@Nullable String name, boolean primitives) { CacheConfiguration cc = super.cache(name, primitives); - cc.setDistributionMode(distributionMode()); + cc.setNearConfiguration(nearConfiguration()); return cc; }