You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/02/15 10:45:11 UTC
[46/50] [abbrv] ignite git commit: Megre 2.0
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java
index 0000000,50107e4..48b2b98
mode 000000,100644..100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java
@@@ -1,0 -1,273 +1,277 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package org.apache.ignite.internal.processors.cache;
+
+ import java.util.Collection;
+ import java.util.Map;
+ import java.util.concurrent.CountDownLatch;
+ import java.util.concurrent.ExecutorService;
+ import java.util.concurrent.TimeUnit;
+ import java.util.concurrent.atomic.AtomicInteger;
+ import org.apache.ignite.Ignite;
+ import org.apache.ignite.Ignition;
+ import org.apache.ignite.cache.CachePeekMode;
+ import org.apache.ignite.cluster.ClusterNode;
+ import org.apache.ignite.configuration.CacheConfiguration;
+ import org.apache.ignite.configuration.IgniteConfiguration;
+ import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
+ import org.apache.ignite.internal.util.typedef.internal.U;
+ import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage;
+ import org.apache.ignite.spi.discovery.DiscoverySpiListener;
+ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+ import org.jetbrains.annotations.Nullable;
+
+ import static org.apache.ignite.cache.CacheMode.REPLICATED;
+ import static org.apache.ignite.cache.CacheRebalanceMode.SYNC;
+ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+ /**
+ * Tests situation when two nodes in cluster simultaneously propose different classes with the same typeId
+ * (which is actually class name's <b>hashCode</b> ).
+ *
+ * In that case one of the propose requests should be rejected
+ * and {@link org.apache.ignite.internal.processors.marshaller.MappingProposedMessage} is sent
+ * with not-null <b>conflictingClsName</b> field.
+ */
+ public class IgniteMarshallerCacheClassNameConflictTest extends GridCommonAbstractTest {
+ /** */
+ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private volatile boolean bbClsRejected;
+
+ /** */
+ private volatile boolean aaClsRejected;
+
+ /** */
+ private volatile boolean rejectObserved;
+
+ /**
+ * Latch used to synchronize two nodes on sending mapping requests for classes with conflicting names.
+ */
+ private static final CountDownLatch startLatch = new CountDownLatch(3);
+
+ /** */
+ private static volatile boolean busySpinFlag;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TcpDiscoverySpi disco = new TestTcpDiscoverySpi();
+ disco.setIpFinder(ipFinder);
+
+ cfg.setDiscoverySpi(disco);
+
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setCacheMode(REPLICATED);
+ ccfg.setRebalanceMode(SYNC);
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCachePutGetClassesWithNameConflict() throws Exception {
+ Ignite srv1 = startGrid(0);
+ Ignite srv2 = startGrid(1);
+ ExecutorService exec1 = srv1.executorService();
+ ExecutorService exec2 = srv2.executorService();
+
+ final AtomicInteger trickCompilerVar = new AtomicInteger(1);
+
+ final Organization aOrg1 = new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA");
+ final OrganizatioN bOrg2 = new OrganizatioN(2, "Apple", "1 Infinite Loop, Cupertino, CA 95014, USA");
+
+ exec1.submit(new Runnable() {
+ @Override public void run() {
+ startLatch.countDown();
+
+ try {
+ startLatch.await();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ //busy spinning after waking up from startLatch.await
+ // to reduce probability that one thread starts significantly earlier than the other
+ while (!busySpinFlag) {
+ if (trickCompilerVar.get() < 0)
+ break;
+ }
+
+ Ignition.localIgnite().cache(null).put(1, aOrg1);
+ }
+ });
+
+ exec2.submit(new Runnable() {
+ @Override public void run() {
+ startLatch.countDown();
+
+ try {
+ startLatch.await();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ //busy spinning after waking up from startLatch.await
+ // to reduce probability that one thread starts significantly earlier than the other
+ while (!busySpinFlag) {
+ if (trickCompilerVar.get() < 0)
+ break;
+ }
+
+ Ignition.localIgnite().cache(null).put(2, bOrg2);
+ }
+ });
+ startLatch.countDown();
+
+ busySpinFlag = true;
+
+ exec1.shutdown();
+ exec2.shutdown();
+
+ exec1.awaitTermination(100, TimeUnit.MILLISECONDS);
+ exec2.awaitTermination(100, TimeUnit.MILLISECONDS);
+
+ Ignite ignite = startGrid(2);
+
+ int cacheSize = ignite.cache(null).size(CachePeekMode.PRIMARY);
+
+ assertTrue("Expected cache size 1 but was " + cacheSize, cacheSize == 1);
+
+ if (rejectObserved)
+ assertTrue(aaClsRejected || bbClsRejected);
+ }
+
+ /** */
+ private class TestTcpDiscoverySpi extends TcpDiscoverySpi {
-
+ /** */
+ private class DiscoverySpiListenerWrapper implements DiscoverySpiListener {
+ /** */
+ private DiscoverySpiListener delegate;
+
+ /**
+ * @param delegate Delegate.
+ */
+ private DiscoverySpiListenerWrapper(DiscoverySpiListener delegate) {
+ this.delegate = delegate;
+ }
+
+ /** {@inheritDoc} */
++ @Override public void onLocalNodeInitialized(ClusterNode locNode) {
++ // No-op.
++ }
++
++ /** {@inheritDoc} */
+ @Override public void onDiscovery(
+ int type,
+ long topVer,
+ ClusterNode node,
+ Collection<ClusterNode> topSnapshot,
+ @Nullable Map<Long, Collection<ClusterNode>> topHist,
+ @Nullable DiscoverySpiCustomMessage spiCustomMsg
+ ) {
+ DiscoveryCustomMessage customMsg = spiCustomMsg == null ? null
+ : (DiscoveryCustomMessage) U.field(spiCustomMsg, "delegate");
+
+ if (customMsg != null)
+ //don't want to make this class public, using equality of class name instead of instanceof operator
+ if ("MappingProposedMessage".equals(customMsg.getClass().getSimpleName())) {
+ String conflClsName = U.field(customMsg, "conflictingClsName");
+ if (conflClsName != null && !conflClsName.isEmpty()) {
+ rejectObserved = true;
+ if (conflClsName.contains("Organization"))
+ bbClsRejected = true;
+ else if (conflClsName.contains("OrganizatioN"))
+ aaClsRejected = true;
+ }
+ }
+
+ delegate.onDiscovery(type, topVer, node, topSnapshot, topHist, spiCustomMsg);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void setListener(@Nullable DiscoverySpiListener lsnr) {
+ super.setListener(new DiscoverySpiListenerWrapper(lsnr));
+ }
+ }
+
+ /**
+ * Class name is chosen to be in conflict with other class name this test put to cache.
+ */
+ private static class Organization {
+ /** */
+ private final int id;
+
+ /** */
+ private final String name;
+
+ /** */
+ private final String addr;
+
+ /**
+ * @param id Id.
+ * @param name Name.
+ * @param addr Address.
+ */
+ Organization(int id, String name, String addr) {
+ this.id = id;
+ this.name = name;
+ this.addr = addr;
+ }
+ }
+
+ /**
+ * Class name is chosen to be in conflict with other class name this test put to cache.
+ */
+ private static class OrganizatioN {
+ /** */
+ private final int id;
+
+ /** */
+ private final String name;
+
+ /** */
+ private final String addr;
+
+ /**
+ * @param id Id.
+ * @param name Name.
+ * @param addr Address.
+ */
+ OrganizatioN(int id, String name, String addr) {
+ this.id = id;
+ this.name = name;
+ this.addr = addr;
+ }
+ }
+ }
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
index 4f02fa2,aeca2fb..c0d7745
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
@@@ -364,14 -363,10 +364,14 @@@ public abstract class GridCacheAbstract
GridCacheAffinityManager aff = cctx.affinity();
+ CachePeekMode[] modes = new CachePeekMode[]{CachePeekMode.ALL};
+
for (int i = 0; i < gridCount(); i++) {
- for (GridCacheEntryEx e : ((IgniteKernal)grid(i)).context().cache().internalCache(cctx.name()).allEntries()) {
- if (aff.primaryByKey(grid(i).localNode(), e.key(), AffinityTopologyVersion.NONE)
- && e.key().value(cctx.cacheObjectContext(), false) instanceof GridCacheQueueHeaderKey)
+ for (Cache.Entry e : grid(i).context().cache().internalCache(cctx.name()).localEntries(modes)) {
+ Object key = e.getKey();
+
- if (aff.primary(grid(i).localNode(), key, AffinityTopologyVersion.NONE)
++ if (aff.primaryByKey(grid(i).localNode(), key, AffinityTopologyVersion.NONE)
+ && key instanceof GridCacheQueueHeaderKey)
return i;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionNotLoadedEventSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index 177c878,3fd4dd8..04f00c2
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@@ -384,13 -384,17 +384,14 @@@ public class GridCacheAtomicInvalidPart
GridCacheEntryEx entry = null;
- if (memMode == TestMemoryMode.HEAP)
- entry = c.peekEx(k);
- else {
- try {
- entry = c.entryEx(k);
+ try {
+ entry = c.entryEx(k);
- entry.unswap();
- }
- catch (GridDhtInvalidPartitionException e) {
- // Skip key.
+ entry.unswap();
+ }
+ catch (GridDhtInvalidPartitionException ignored) {
+ // Skip key.
+ }
}
for (int r = 0; r < 10; r++) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
index fe53fc7,1f6ec2d..b5ca2de
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
@@@ -36,9 -40,11 +40,12 @@@ import org.apache.ignite.internal.Ignit
import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.IgniteCacheAbstractTest;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
+ import org.apache.ignite.transactions.Transaction;
+ import org.apache.ignite.transactions.TransactionConcurrency;
+ import org.apache.ignite.transactions.TransactionIsolation;
/**
*
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticDeadlockDetectionTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index b032717,e37a8a1..12b7523
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@@ -270,6 -272,11 +273,10 @@@ public class IgniteCacheTestSuite2 exte
suite.addTest(new TestSuite(IgniteNoCustomEventsOnNodeStart.class));
suite.addTest(new TestSuite(CacheExchangeMessageDuplicatedStateTest.class));
- suite.addTest(new TestSuite(OffheapCacheOnClientsTest.class));
+ suite.addTest(new TestSuite(CacheConcurrentReadThroughTest.class));
+
+ suite.addTest(new TestSuite(GridNearCacheStoreUpdateTest.class));
+ suite.addTest(new TestSuite(GridNearOffheapCacheStoreUpdateTest.class));
return suite;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
index ea7173c,bab219c..65c4d62
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
@@@ -17,8 -17,18 +17,18 @@@
package org.apache.ignite.internal.processors.query.h2.opt;
- import java.util.*;
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Comparator;
+ import java.util.HashMap;
+ import java.util.Iterator;
+ import java.util.List;
+ import java.util.Map;
++import java.util.NoSuchElementException;
+ import java.util.UUID;
import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
@@@ -42,8 -52,8 +52,9 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2RowRangeBounds;
import org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2ValueMessage;
import org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2ValueMessageFactory;
- import org.apache.ignite.internal.util.*;
- import org.apache.ignite.internal.util.lang.*;
+ import org.apache.ignite.internal.util.GridSpinBusyLock;
-import org.apache.ignite.internal.util.lang.GridFilteredIterator;
++import org.apache.ignite.internal.util.IgniteTree;
++import org.apache.ignite.internal.util.lang.GridCursor;
import org.apache.ignite.internal.util.typedef.CIX2;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.CU;
@@@ -1555,97 -1534,5 +1566,97 @@@ public abstract class GridH2IndexBase e
return fltr.apply(key, val);
}
+
+ /** {@inheritDoc} */
+ @Override public boolean next() throws IgniteCheckedException {
+ next = null;
+
+ while (cursor.next()) {
+ GridH2Row t = cursor.get();
+
+ if (accept(t)) {
+ next = t;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public GridH2Row get() throws IgniteCheckedException {
+ if (next == null)
+ throw new NoSuchElementException();
+
+ return next;
+ }
}
+
+ /**
+ *
+ */
+ private static final class CursorIteratorWrapper implements Iterator<GridH2Row> {
+ /** */
+ private final GridCursor<GridH2Row> cursor;
+
+ /** Next element. */
+ private GridH2Row next;
+
+ /**
+ * @param cursor Cursor.
+ */
+ private CursorIteratorWrapper(GridCursor<GridH2Row> cursor) {
+ assert cursor != null;
+
+ this.cursor = cursor;
+
+ try {
+ if (cursor.next())
+ next = cursor.get();
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean hasNext() {
+ return next != null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public GridH2Row next() {
+ try {
+ GridH2Row res = next;
+
+ if (cursor.next())
+ next = cursor.get();
+ else
+ next = null;
+
+ return res;
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void remove() {
+ throw new UnsupportedOperationException("operation is not supported");
+ }
+ }
+
+ /** Empty cursor. */
+ protected static final GridCursor<GridH2Row> EMPTY_CURSOR = new GridCursor<GridH2Row>() {
+ /** {@inheritDoc} */
+ @Override public boolean next() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public GridH2Row get() {
+ return null;
+ }
+ };
- }
+ }
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 4576cec,0e19a75..5a71bc8
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@@ -105,10 -104,10 +105,7 @@@ import static org.apache.ignite.interna
* Reduce query executor.
*/
public class GridReduceQueryExecutor {
- /** Thread pool to process query messages. */
- public static final byte QUERY_POOL = GridIoPolicy.SYSTEM_POOL;
-
/** */
- private static final IgniteProductVersion DISTRIBUTED_JOIN_SINCE = IgniteProductVersion.fromString("1.7.0");
-
- /** */
private GridKernalContext ctx;
/** */
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexDisabledSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
index 15f110f,81c28a3..da2fe2e
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
@@@ -549,8 -614,115 +589,115 @@@ public abstract class IgniteCacheAbstra
*
* @throws Exception In case of error.
*/
+ public void testSimpleCustomTableName() throws Exception {
+ final IgniteCache<Integer, Object> cache = ignite().cache(null);
+
+ cache.put(10, new Type1(1, "Type1 record #1"));
+ cache.put(20, new Type1(2, "Type1 record #2"));
+
+ QueryCursor<Cache.Entry<Integer, Type1>> qry1 =
+ cache.query(new SqlQuery<Integer, Type1>(Type1.class, "FROM Type2"));
+
+ List<Cache.Entry<Integer, Type1>> all = qry1.getAll();
+
+ assertEquals(2, all.size());
+
+ QueryCursor<List<?>> qry = cache.query(new SqlFieldsQuery("SELECT name FROM Type2"));
+
+ assertEquals(2, qry.getAll().size());
+
+ GridTestUtils.assertThrows(log, new GridPlainCallable<Void>() {
+ @Override public Void call() throws Exception {
+ QueryCursor<Cache.Entry<Integer, Type1>> qry =
+ cache.query(new SqlQuery<Integer, Type1>(Type1.class, "FROM Type1"));
+
+ qry.getAll();
+
+ return null;
+ }
+ }, CacheException.class, null);
+ }
+
+ /**
+ * JUnit.
+ *
+ * @throws Exception In case of error.
+ */
+ public void testMixedCustomTableName() throws Exception {
+ final IgniteCache<Integer, Object> cache = ignite().cache(null);
+
+ cache.put(10, new Type1(1, "Type1 record #1"));
+ cache.put(20, new Type1(2, "Type1 record #2"));
+ cache.put(30, new Type2(1, "Type2 record #1"));
+ cache.put(40, new Type2(2, "Type2 record #2"));
+ cache.put(50, new Type2(3, "Type2 record #3"));
+
+ QueryCursor<Cache.Entry<Integer, Type1>> qry1 =
+ cache.query(new SqlQuery<Integer, Type1>(Type1.class, "FROM Type2"));
+
+ List<Cache.Entry<Integer, Type1>> all = qry1.getAll();
+
+ assertEquals(2, all.size());
+
+ QueryCursor<Cache.Entry<Integer, Type2>> qry2 =
+ cache.query(new SqlQuery<Integer, Type2>(Type2.class, "FROM Type1"));
+
+ assertEquals(3, qry2.getAll().size());
+
+ QueryCursor<List<?>> qry = cache.query(new SqlFieldsQuery("SELECT name FROM Type1"));
+
+ assertEquals(3, qry.getAll().size());
+
+ qry = cache.query(new SqlFieldsQuery("SELECT name FROM Type2"));
+
+ assertEquals(2, qry.getAll().size());
+
+ GridTestUtils.assertThrows(log, new GridPlainCallable<Void>() {
+ @Override public Void call() throws Exception {
+ QueryCursor<Cache.Entry<Integer, Type1>> qry1 =
+ cache.query(new SqlQuery<Integer, Type1>(Type1.class, "FROM Type1"));
+
+ qry1.getAll().size();
+
+ return null;
+ }
+ }, CacheException.class, null);
+ }
+
+ /**
+ * JUnit.
+ *
+ * @throws Exception In case of error.
+ */
+ public void testDistributedJoinCustomTableName() throws Exception {
+ IgniteCache<Integer, Object> cache = ignite().cache(null);
+
+ cache.put(10, new Type1(1, "Type1 record #1"));
+ cache.put(20, new Type1(2, "Type1 record #2"));
+ cache.put(30, new Type2(1, "Type2 record #1"));
+ cache.put(40, new Type2(2, "Type2 record #2"));
+ cache.put(50, new Type2(3, "Type2 record #3"));
+
+ QueryCursor<List<?>> query = cache.query(
+ new SqlFieldsQuery("SELECT t2.name, t1.name FROM Type2 as t2 LEFT JOIN Type1 as t1 ON t1.id = t2.id")
+ .setDistributedJoins(cacheMode() == PARTITIONED));
+
+ assertEquals(2, query.getAll().size());
+
+ query = cache.query(
+ new SqlFieldsQuery("SELECT t2.name, t1.name FROM Type2 as t2 RIGHT JOIN Type1 as t1 ON t1.id = t2.id")
+ .setDistributedJoins(cacheMode() == PARTITIONED));
+
+ assertEquals(3, query.getAll().size());
+ }
+
+ /**
+ * JUnit.
+ *
+ * @throws Exception In case of error.
+ */
public void testObjectQuery() throws Exception {
- IgniteCache<Integer, ObjectValue> cache = ignite().cache(null);
+ IgniteCache<Integer, ObjectValue> cache = jcache(Integer.class, ObjectValue.class);
ObjectValue val = new ObjectValue("test", 0);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheLockPartitionOnAffinityRunTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
index b9152fa,f1d72bf..13cf1cb
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
@@@ -758,10 -722,5 +768,10 @@@ public abstract class GridIndexingSpiAb
@Override public byte fieldsCount() {
throw new UnsupportedOperationException();
}
+
+ /** {@inheritDoc} */
+ @Override public boolean internal() {
+ return false;
+ }
}
- }
+ }
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
index 4eaaab8,07125a6..045d772
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
@@@ -33,7 -33,9 +33,8 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationNearEnabledTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationStoreEnabledTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationSwapEnabledTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.ClientReconnectContinuousQueryTest;
import org.apache.ignite.internal.processors.cache.query.continuous.ContinuousQueryRemoteFilterMissingInClassPathSelfTest;
++import org.apache.ignite.internal.processors.cache.query.continuous.ClientReconnectContinuousQueryTest;
import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapTieredTest;
import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapValuesTest;
@@@ -121,9 -123,9 +122,10 @@@ public class IgniteCacheQuerySelfTestSu
suite.addTestSuite(CacheKeepBinaryIterationNearEnabledTest.class);
suite.addTestSuite(IgniteCacheContinuousQueryBackupQueueTest.class);
suite.addTestSuite(IgniteCacheContinuousQueryNoUnsubscribeTest.class);
+ suite.addTestSuite(ClientReconnectContinuousQueryTest.class);
+ suite.addTest(IgniteDistributedJoinTestSuite.suite());
+
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/TestKafkaBroker.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1748e226/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --cc modules/yardstick/pom.xml
index b24f67c,d96fcc6..3eed80e
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@@ -35,9 -35,8 +35,10 @@@
<url>http://ignite.apache.org</url>
<properties>
- <yardstick.version>0.8.0</yardstick.version>
+ <yardstick.version>0.8.2</yardstick.version>
+ <spring.version>4.1.0.RELEASE</spring.version>
+ <mysql.connector.version>5.1.39</mysql.connector.version>
+ <postgres.connector.version>9.4.1208.jre7</postgres.connector.version>
</properties>
<dependencies>