You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vk...@apache.org on 2015/08/11 09:27:10 UTC
[01/50] incubator-ignite git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-426 9fe0a8d56 -> fa494ff1c
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e6f0ac3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e6f0ac3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e6f0ac3c
Branch: refs/heads/ignite-426
Commit: e6f0ac3c40be817c08b192b753791979bed7aff4
Parents: a99ef8b a127756
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Jul 27 13:10:06 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Jul 27 13:10:06 2015 -0700
----------------------------------------------------------------------
RELEASE_NOTES.txt | 5 +
assembly/release-base.xml | 5 +
config/ignite-log4j2.xml | 81 +++
config/ignite-log4j2.xml~ | 65 ++
examples/config/example-ignite.xml | 2 +-
modules/clients/README.txt | 16 +
modules/clients/readme.md | 32 -
modules/clients/readme.pdf | Bin 47887 -> 0 bytes
.../rest/AbstractRestProcessorSelfTest.java | 1 +
.../JettyRestProcessorAbstractSelfTest.java | 657 ++++++++++++++++++-
.../src/main/java/org/apache/ignite/Ignite.java | 2 +-
.../configuration/ConnectorConfiguration.java | 32 +
.../configuration/IgniteConfiguration.java | 63 +-
.../apache/ignite/internal/IgniteKernal.java | 86 ++-
.../GridClientConnectionManagerAdapter.java | 2 +-
.../client/router/impl/GridTcpRouterImpl.java | 2 +-
.../client/ssl/GridSslBasicContextFactory.java | 3 +
.../client/ssl/GridSslContextFactory.java | 5 +-
.../discovery/GridDiscoveryManager.java | 7 +-
.../processors/cache/GridCacheAdapter.java | 2 +-
.../processors/rest/GridRestCommand.java | 53 +-
.../processors/rest/GridRestProcessor.java | 32 +
.../handlers/cache/GridCacheCommandHandler.java | 373 ++++++++++-
.../query/CacheQueryFieldsMetaResult.java | 133 ++++
.../rest/handlers/query/CacheQueryResult.java | 120 ++++
.../handlers/query/QueryCommandHandler.java | 292 +++++++++
.../version/GridVersionCommandHandler.java | 14 +-
.../rest/protocols/tcp/GridTcpRestProtocol.java | 20 +-
.../rest/request/RestSqlQueryRequest.java | 125 ++++
.../processors/task/GridTaskProcessor.java | 3 +-
.../ignite/internal/util/nio/GridNioServer.java | 28 +-
.../util/nio/GridNioSessionMetaKey.java | 5 +-
.../util/nio/ssl/BlockingSslHandler.java | 519 +++++++++++++++
.../internal/util/nio/ssl/GridNioSslFilter.java | 53 +-
.../util/nio/ssl/GridNioSslHandler.java | 79 ++-
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 58 ++
.../spi/IgniteSpiOperationTimeoutException.java | 43 ++
.../spi/IgniteSpiOperationTimeoutHelper.java | 102 +++
.../communication/tcp/TcpCommunicationSpi.java | 294 +++++++--
.../ignite/spi/discovery/tcp/ClientImpl.java | 52 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 529 +++++++++------
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 11 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 169 ++++-
.../tcp/internal/TcpDiscoveryNode.java | 21 +
.../TcpDiscoveryConnectionCheckMessage.java | 64 ++
.../apache/ignite/ssl/SslContextFactory.java | 458 +++++++++++++
.../org/apache/ignite/ssl/package-info.java | 22 +
modules/core/src/test/config/log4j2-test.xml | 57 ++
modules/core/src/test/config/log4j2-test.xml~ | 63 ++
.../src/test/config/log4j2-verbose-test.xml | 48 ++
.../IgniteClientReconnectAbstractTest.java | 4 +-
.../IgniteTopologyPrintFormatSelfTest.java | 6 +-
.../CacheGetFutureHangsSelfTest.java | 214 ++++++
.../internal/util/nio/GridNioSslSelfTest.java | 2 +-
.../GridAbstractCommunicationSelfTest.java | 13 +
.../GridTcpCommunicationSpiAbstractTest.java | 2 +-
...dTcpCommunicationSpiRecoveryAckSelfTest.java | 3 +-
...tionSpiRecoveryFailureDetectionSelfTest.java | 54 ++
...GridTcpCommunicationSpiRecoverySelfTest.java | 23 +-
.../tcp/GridTcpCommunicationSpiSslSelfTest.java | 38 ++
...unicationSpiTcpFailureDetectionSelfTest.java | 75 +++
.../tcp/IgniteCacheSslStartStopSelfTest.java | 46 ++
.../discovery/AbstractDiscoverySelfTest.java | 36 +-
...lientDiscoverySpiFailureTimeoutSelfTest.java | 205 ++++++
.../tcp/TcpClientDiscoverySpiSelfTest.java | 116 +++-
.../tcp/TcpDiscoverySpiConfigSelfTest.java | 1 +
.../TcpDiscoverySpiFailureTimeoutSelfTest.java | 402 ++++++++++++
.../tcp/TcpDiscoverySpiSslSelfTest.java | 28 +
.../discovery/tcp/TcpDiscoverySslSelfTest.java | 42 ++
.../TcpDiscoveryIpFinderAbstractSelfTest.java | 2 +-
.../ignite/testframework/GridTestUtils.java | 20 +
.../ignite/testframework/junits/IgniteMock.java | 13 +
.../IgniteCacheFailoverTestSuite.java | 4 +-
.../IgniteSpiCommunicationSelfTestSuite.java | 3 +
.../IgniteSpiDiscoverySelfTestSuite.java | 5 +
.../gce/TcpDiscoveryGoogleStorageIpFinder.java | 18 +
...pDiscoveryGoogleStorageIpFinderSelfTest.java | 29 +-
modules/hadoop/docs/HADOOP_README.txt | 122 ++++
modules/hadoop/docs/hadoop_readme.md | 135 ----
modules/hadoop/docs/hadoop_readme.pdf | Bin 82219 -> 0 bytes
modules/log4j/README.txt | 2 +-
.../apache/ignite/logger/log4j/Log4JLogger.java | 2 +-
modules/log4j2/README.txt | 32 +
modules/log4j2/licenses/apache-2.0.txt | 202 ++++++
modules/log4j2/pom.xml | 63 ++
modules/log4j2/pom.xml~ | 45 ++
.../ignite/logger/log4j2/Log4J2Logger.java | 486 ++++++++++++++
.../ignite/logger/log4j2/Log4J2Logger.java~ | 542 +++++++++++++++
.../ignite/logger/log4j2/Log4j2FileAware.java | 35 +
.../ignite/logger/log4j2/Log4j2FileAware.java~ | 33 +
.../ignite/logger/log4j2/Log4jFileAware.java~ | 13 +
.../ignite/logger/log4j2/package-info.java | 22 +
.../log4j2/GridLog4j2CorrectFileNameTest.java | 95 +++
.../log4j2/GridLog4j2CorrectFileNameTest.java~ | 95 +++
.../log4j2/GridLog4j2InitializedTest.java | 79 +++
.../log4j2/GridLog4j2InitializedTest.java~ | 79 +++
.../log4j2/GridLog4j2LoggingFileTest.java | 72 ++
.../log4j2/GridLog4j2LoggingFileTest.java~ | 74 +++
.../logger/log4j2/Log4j2LoggerSelfTest.java | 174 +++++
.../log4j2/Log4j2LoggerVerboseModeSelfTest.java | 117 ++++
.../ignite/logger/log4j2/package-info.java | 22 +
.../testsuites/IgniteLog4j2TestSuite.java | 38 ++
.../http/jetty/GridJettyRestHandler.java | 85 ++-
.../visor/commands/open/VisorOpenCommand.scala | 17 +-
.../scala/org/apache/ignite/visor/visor.scala | 3 +
modules/yardstick/README.md | 85 ---
modules/yardstick/README.txt | 93 +++
modules/yardstick/config/benchmark.properties | 6 +-
.../yardstick/IgniteBenchmarkArguments.java | 22 +
.../yardstick/cache/IgnitePutAllBenchmark.java | 67 ++
.../cache/IgnitePutAllTxBenchmark.java | 68 ++
parent/pom.xml | 4 +-
pom.xml | 1 +
113 files changed, 8564 insertions(+), 778 deletions(-)
----------------------------------------------------------------------
[35/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1b09e15f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1b09e15f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1b09e15f
Branch: refs/heads/ignite-426
Commit: 1b09e15f34af5a7c4296eab8c278bac8103af48d
Parents: 0551155
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 22:20:14 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 22:20:14 2015 -0700
----------------------------------------------------------------------
.../near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1b09e15f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
index f30ea71..64bace5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
@@ -412,10 +412,12 @@ public class GridCacheNearOnlyMultiNodeFullApiSelfTest extends GridCachePartitio
GridCacheEntryEx entry = dht.peekEx(key);
- assert entry != null;
-
- assertEquals(0, entry.ttl());
- assertEquals(0, entry.expireTime());
+ if (atomicityMode() == CacheAtomicityMode.ATOMIC)
+ assertNull(entry);
+ else {
+ assertEquals(0, entry.ttl());
+ assertEquals(0, entry.expireTime());
+ }
}
// Ensure that next update will not pick old expire time.
[13/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1e98372e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1e98372e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1e98372e
Branch: refs/heads/ignite-426
Commit: 1e98372edca990804d1686521fd152c0549baa2c
Parents: f187add
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Jul 30 17:24:48 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Jul 30 17:24:48 2015 -0700
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheMapEntry.java | 5 -----
.../distributed/dht/atomic/GridDhtAtomicCache.java | 9 +++------
.../cache/distributed/near/GridNearAtomicCache.java | 14 ++++----------
3 files changed, 7 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e98372e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 79d7989..5d2af9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -2161,9 +2161,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
}
}
- if (!cctx.deferredDelete())
- markObsolete0(rmvVer, true);
-
res = hadVal;
}
@@ -2458,8 +2455,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
/** {@inheritDoc} */
@Override public boolean markObsoleteVersion(GridCacheVersion ver) {
- assert cctx.deferredDelete();
-
boolean marked;
synchronized (this) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e98372e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 19c89e7..3802b29 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1177,7 +1177,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
}
catch (GridCacheEntryRemovedException e) {
- assert !ctx.deferredDelete() : "Entry should not become obsolete while holding lock.";
+ assert false : "Entry should not become obsolete while holding lock.";
e.printStackTrace();
}
@@ -1196,11 +1196,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
else {
GridDhtCacheEntry entry = e.get1();
- assert entry.obsolete();
-
- entry.onMarkedObsolete();
-
- removeEntry(entry);
+ if (entry.markObsoleteVersion(e.get2()))
+ removeEntry(entry);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e98372e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 707facc..b3f4a1d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -245,11 +245,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
if (ctx.deferredDelete())
ctx.onDeferredDelete(entry, updRes.removeVersion());
else {
- assert entry.obsolete();
-
- entry.onMarkedObsolete();
-
- removeEntry(entry);
+ if (entry.markObsoleteVersion(updRes.removeVersion()))
+ removeEntry(entry);
}
}
@@ -352,11 +349,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
if (ctx.deferredDelete())
ctx.onDeferredDelete(entry, updRes.removeVersion());
else {
- assert entry.obsolete();
-
- entry.onMarkedObsolete();
-
- removeEntry(entry);
+ if (entry.markObsoleteVersion(updRes.removeVersion()))
+ removeEntry(entry);
}
}
[24/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2421fee9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2421fee9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2421fee9
Branch: refs/heads/ignite-426
Commit: 2421fee936c1cfefa072c00da8ebce6897c2156f
Parents: d26184a
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 10:28:24 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 10:28:24 2015 -0700
----------------------------------------------------------------------
.../managers/communication/GridIoManager.java | 75 +++++++++++---------
1 file changed, 43 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2421fee9/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index a129cbe..b38106e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -980,10 +980,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param msgC Closure to call when message processing finished.
*/
private void processSequentialMessage(
- final UUID nodeId,
- final GridIoMessage msg,
+ UUID nodeId,
+ GridIoMessage msg,
byte plc,
- final IgniteRunnable msgC
+ IgniteRunnable msgC
) throws IgniteCheckedException {
final GridMessageListener lsnr = lsnrMap.get(msg.topic());
@@ -1018,39 +1018,41 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
msgSet.add(nodeId, msg, msgC);
- if (msgC == null) {
- assert locNodeId.equals(nodeId);
+ if (!msgSet.reserved()) {
+ if (msgC == null) {
+ assert locNodeId.equals(nodeId);
- msgSet.unwind(lsnr);
- }
- else {
- assert !locNodeId.equals(nodeId);
+ msgSet.unwind(lsnr);
+ }
+ else {
+ assert !locNodeId.equals(nodeId);
- final SequentialMessageSet msgSet0 = msgSet;
+ final SequentialMessageSet msgSet0 = msgSet;
- Runnable c = new Runnable() {
- @Override public void run() {
- try {
- threadProcessingMessage(true);
+ Runnable c = new Runnable() {
+ @Override public void run() {
+ try {
+ threadProcessingMessage(true);
- msgSet0.unwind(lsnr);
- }
- finally {
- threadProcessingMessage(false);
+ msgSet0.unwind(lsnr);
+ }
+ finally {
+ threadProcessingMessage(false);
+ }
}
- }
- };
+ };
- try {
- pool(plc).execute(c);
- }
- catch (RejectedExecutionException e) {
- U.error(log, "Failed to process sequential message due to execution rejection. " +
- "Increase the upper bound on executor service provided by corresponding " +
- "configuration property. Will attempt to process message in the listener " +
- "thread instead [msgPlc=" + plc + ']', e);
+ try {
+ pool(plc).execute(c);
+ }
+ catch (RejectedExecutionException e) {
+ U.error(log, "Failed to process sequential message due to execution rejection. " +
+ "Increase the upper bound on executor service provided by corresponding " +
+ "configuration property. Will attempt to process message in the listener " +
+ "thread instead [msgPlc=" + plc + ']', e);
- c.run();
+ c.run();
+ }
}
}
}
@@ -1108,10 +1110,12 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
ioMsg.topicBytes(marsh.marshal(topic));
try {
- if ((CommunicationSpi)getSpi() instanceof TcpCommunicationSpi)
- ((TcpCommunicationSpi)(CommunicationSpi)getSpi()).sendMessage(node, ioMsg, ackClosure);
+ CommunicationSpi spi = getSpi();
+
+ if (spi instanceof TcpCommunicationSpi)
+ ((TcpCommunicationSpi)spi).sendMessage(node, ioMsg, ackClosure);
else
- getSpi().sendMessage(node, ioMsg);
+ spi.sendMessage(node, ioMsg);
}
catch (IgniteSpiException e) {
throw new IgniteCheckedException("Failed to send message (node may have left the grid or " +
@@ -2535,6 +2539,13 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
private final AtomicBoolean reserve = new AtomicBoolean();
/**
+ * @return {@code True} if currently reserved.
+ */
+ boolean reserved() {
+ return reserve.get();
+ }
+
+ /**
* @param nodeId Node ID.
* @param msg Message.
* @param msgC Closure to call when message processing finished.
[14/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6c1655fb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6c1655fb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6c1655fb
Branch: refs/heads/ignite-426
Commit: 6c1655fbe4c344a5f6ceb82abe6b231af57fcbed
Parents: 1e98372
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Jul 30 17:35:15 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Jul 30 17:35:15 2015 -0700
----------------------------------------------------------------------
.../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 7 +------
.../distributed/dht/atomic/GridDhtAtomicUpdateFuture.java | 3 +--
.../distributed/dht/atomic/GridNearAtomicUpdateFuture.java | 3 +--
3 files changed, 3 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c1655fb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 3802b29..9328932 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -2473,13 +2473,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
if (updRes.removeVersion() != null) {
if (ctx.deferredDelete())
ctx.onDeferredDelete(entry, updRes.removeVersion());
- else {
- assert entry.obsolete();
-
- entry.onMarkedObsolete();
-
+ else if (entry.markObsoleteVersion(updRes.removeVersion()))
removeEntry(entry);
- }
}
entry.onUnlock();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c1655fb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index eb1b42c..5c22b3b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -358,8 +358,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
if (part >= 0) {
Object topic = new GridAtomicRequestTopic(cctx.cacheId(), part, false);
- cctx.io().sendOrderedMessage(nodeId, topic, req, cctx.ioPolicy(),
- 2 * cctx.gridConfig().getNetworkTimeout());
+ cctx.io().sendSequentialMessage(nodeId, topic, req, cctx.ioPolicy());
}
else {
assert part == -1;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c1655fb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 4642b1a..ff24964 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -1146,8 +1146,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (mappingKey.partition() >= 0) {
Object topic = new GridAtomicRequestTopic(cctx.cacheId(), mappingKey.partition(), true);
- cctx.io().sendOrderedMessage(mappingKey.nodeId(), topic, req, cctx.ioPolicy(),
- 2 * cctx.gridConfig().getNetworkTimeout());
+ cctx.io().sendSequentialMessage(mappingKey.nodeId(), topic, req, cctx.ioPolicy());
}
else {
assert mappingKey.partition() == -1;
[44/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2a8b5489
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2a8b5489
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2a8b5489
Branch: refs/heads/ignite-426
Commit: 2a8b548955581857b53c312f8ce9d1bfa1c853a7
Parents: 99e998a
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Aug 7 15:14:12 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Aug 7 15:14:12 2015 -0700
----------------------------------------------------------------------
.../ignite/internal/processors/cache/GridCacheIoManager.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a8b5489/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 490a5d8..7e7042c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -292,6 +292,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
if (e instanceof Error)
throw (Error)e;
+ else if (e instanceof RuntimeException)
+ throw (RuntimeException)e;
}
finally {
if (depEnabled)
@@ -541,7 +543,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
catch (Throwable e) {
U.error(log, "Failed processing message [senderId=" + nodeId + ", msg=" + msg + ']', e);
- if (e instanceof Error)
+ if (e instanceof Error || e instanceof RuntimeException)
throw e;
}
finally {
[26/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e3ebcb96
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e3ebcb96
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e3ebcb96
Branch: refs/heads/ignite-426
Commit: e3ebcb96efd469dd162b5b0e8cd3904ab7003a67
Parents: 98ad892
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 11:08:45 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 11:08:45 2015 -0700
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 22 ------------
.../processors/cache/GridCacheContext.java | 8 ++---
.../dht/atomic/GridDhtAtomicCache.java | 35 +++++---------------
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 8 ++---
.../dht/atomic/GridNearAtomicUpdateFuture.java | 30 ++++++-----------
5 files changed, 24 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3ebcb96/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index ff32551..3ad0f01 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -219,10 +219,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/** Write ordering mode. */
private CacheAtomicWriteOrderMode atomicWriteOrderMode;
- /** Ordered updates mode. */
- // TODO: IGNITE-104 - Switch default to false
- private boolean atomicOrderedUpdates = true;
-
/** Number of backups for cache. */
private int backups = DFLT_BACKUPS;
@@ -349,7 +345,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
aff = cc.getAffinity();
affMapper = cc.getAffinityMapper();
atomicityMode = cc.getAtomicityMode();
- atomicOrderedUpdates = cc.isAtomicOrderedUpdates();
atomicWriteOrderMode = cc.getAtomicWriteOrderMode();
backups = cc.getBackups();
cacheLoaderFactory = cc.getCacheLoaderFactory();
@@ -901,23 +896,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
}
/**
- * @return Ordered updates mode.
- */
- public boolean isAtomicOrderedUpdates() {
- return atomicOrderedUpdates;
- }
-
- /**
- * @param atomicOrderedUpdates Ordered updates mode.
- * @return {@code this} for chaining.
- */
- public CacheConfiguration<K, V> setAtomicOrderedUpdates(boolean atomicOrderedUpdates) {
- this.atomicOrderedUpdates = atomicOrderedUpdates;
-
- return this;
- }
-
- /**
* Gets number of nodes used to back up single partition for {@link CacheMode#PARTITIONED} cache.
* <p>
* If not set, default value is {@link #DFLT_BACKUPS}.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3ebcb96/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 05ce183..db62f20 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -537,12 +537,8 @@ public class GridCacheContext<K, V> implements Externalizable {
* @return {@code True} if entries should not be deleted from cache immediately.
*/
public boolean deferredDelete(GridCacheAdapter<?, ?> cache) {
- boolean nearAtomic = cache.isNear() && cache.configuration().getAtomicityMode() == ATOMIC;
- boolean orderedUpdates = cache.configuration().isAtomicOrderedUpdates();
-
- return cache.isDht() || cache.isColocated() ||
- (cache.isDhtAtomic() && !orderedUpdates) ||
- (nearAtomic && !orderedUpdates);
+ // Only TRANSACTIONAL caches.
+ return cache.isDht() || cache.isColocated();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3ebcb96/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index f5119f6..01694d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -187,33 +187,18 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
});
- if (ctx.config().isAtomicOrderedUpdates()) {
- for (int part = 0; part < ctx.affinity().partitions(); part++) {
- Object nearTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, true);
+ for (int part = 0; part < ctx.affinity().partitions(); part++) {
+ Object nearTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, true);
- ctx.io().addPerTopicHandler(nearTopic, new CI2<UUID, GridNearAtomicUpdateRequest>() {
- @Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
- processNearAtomicUpdateRequest(nodeId, req);
- }
- });
-
- Object dhtTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, false);
-
- ctx.io().addPerTopicHandler(dhtTopic, new CI2<UUID, GridDhtAtomicUpdateRequest>() {
- @Override public void apply(UUID nodeId, GridDhtAtomicUpdateRequest req) {
- processDhtAtomicUpdateRequest(nodeId, req);
- }
- });
- }
- }
- else {
- ctx.io().addHandler(ctx.cacheId(), GridNearAtomicUpdateRequest.class, new CI2<UUID, GridNearAtomicUpdateRequest>() {
+ ctx.io().addPerTopicHandler(nearTopic, new CI2<UUID, GridNearAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
processNearAtomicUpdateRequest(nodeId, req);
}
});
- ctx.io().addHandler(ctx.cacheId(), GridDhtAtomicUpdateRequest.class, new CI2<UUID, GridDhtAtomicUpdateRequest>() {
+ Object dhtTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, false);
+
+ ctx.io().addPerTopicHandler(dhtTopic, new CI2<UUID, GridDhtAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridDhtAtomicUpdateRequest req) {
processDhtAtomicUpdateRequest(nodeId, req);
}
@@ -253,11 +238,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
for (DeferredResponseBuffer buf : pendingResponses.values())
buf.finish();
- if (ctx.config().isAtomicOrderedUpdates()) {
- for (int part = 0; part < ctx.affinity().partitions(); part++) {
- ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, true));
- ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, false));
- }
+ for (int part = 0; part < ctx.affinity().partitions(); part++) {
+ ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, true));
+ ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, false));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3ebcb96/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 5c22b3b..52d59ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -123,8 +123,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
waitForExchange = !topLocked;
// We can send entry processor instead of value to backup if updates are ordered.
- forceTransformBackups = updateReq.operation() == GridCacheOperation.TRANSFORM &&
- cctx.config().isAtomicOrderedUpdates();
+ forceTransformBackups = updateReq.operation() == GridCacheOperation.TRANSFORM;
}
/** {@inheritDoc} */
@@ -218,9 +217,6 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
Collection<ClusterNode> dhtNodes = cctx.dht().topology().nodes(part, topVer);
- if (!cctx.config().isAtomicOrderedUpdates())
- part = -1;
-
if (log.isDebugEnabled())
log.debug("Mapping entry to DHT nodes [nodes=" + U.nodeIds(dhtNodes) + ", entry=" + entry + ']');
@@ -281,7 +277,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
AffinityTopologyVersion topVer = updateReq.topologyVersion();
- int part = cctx.config().isAtomicOrderedUpdates() ? entry.partition() : -1;
+ int part = entry.partition();
for (UUID nodeId : readers) {
GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, part);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3ebcb96/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 5150113..c4704cf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -512,7 +512,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
Collection<KeyCacheObject> remapKeys = fastMap ? null : res.remapKeys();
- mapOnTopology(remapKeys, true, nodeId);
+ mapOnTopology(remapKeys, true, new GridAtomicMappingKey(nodeId, res.partition()));
return;
}
@@ -591,9 +591,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
*
* @param keys Keys to map.
* @param remap Boolean flag indicating if this is partial future remap.
- * @param oldNodeId Old node ID if remap.
+ * @param remapKey Mapping key (if remap).
*/
- private void mapOnTopology(final Collection<?> keys, final boolean remap, final UUID oldNodeId) {
+ private void mapOnTopology(final Collection<?> keys, final boolean remap, final GridAtomicMappingKey remapKey) {
cache.topology().readLock();
AffinityTopologyVersion topVer = null;
@@ -624,7 +624,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> t) {
cctx.kernalContext().closure().runLocalSafe(new Runnable() {
@Override public void run() {
- mapOnTopology(keys, remap, oldNodeId);
+ mapOnTopology(keys, remap, remapKey);
}
});
}
@@ -640,7 +640,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
cache.topology().readUnlock();
}
- map0(topVer, keys, remap, oldNodeId);
+ map0(topVer, keys, remap, remapKey);
}
/**
@@ -683,14 +683,14 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* @param topVer Topology version.
* @param remapKeys Keys to remap or {@code null} to map all keys.
* @param remap Flag indicating if this is partial remap for this future.
- * @param oldNodeId Old node ID if was remap.
+ * @param remapKey Mapping key (if remap).
*/
private void map0(
AffinityTopologyVersion topVer,
@Nullable Collection<?> remapKeys,
boolean remap,
- @Nullable UUID oldNodeId) {
- assert oldNodeId == null || remap || fastMapRemap;
+ @Nullable GridAtomicMappingKey remapKey) {
+ assert remapKey == null || remap || fastMapRemap;
Collection<ClusterNode> topNodes = CU.affinityNodes(cctx, topVer);
@@ -783,9 +783,6 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
int part = cctx.affinity().partition(cacheKey);
ClusterNode primary = cctx.affinity().primary(part, topVer);
- if (!ccfg.isAtomicOrderedUpdates())
- part = -1;
-
if (primary == null) {
onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
"left the grid)."));
@@ -852,13 +849,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
// Must do this in synchronized block because we need to atomically remove and add mapping.
// Otherwise checkComplete() may see empty intermediate state.
synchronized (this) {
- if (oldNodeId != null) {
- // TODO: IGNITE-104 - Try to avoid iteration.
- for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
- if (e.getKey().nodeId().equals(oldNodeId))
- mappings.remove(e.getKey());
- }
- }
+ if (remapKey != null)
+ mappings.remove(remapKey);
// For fastMap mode wait for all responses before remapping.
if (remap && fastMap && !mappings.isEmpty()) {
@@ -930,7 +922,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
T2<Integer, Collection<ClusterNode>> t = mapKey(cacheKey, topVer, fastMap);
- int part = ccfg.isAtomicOrderedUpdates() ? t.get1() : -1;
+ int part = t.get1();
Collection<ClusterNode> affNodes = t.get2();
if (affNodes.isEmpty()) {
[21/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6720885f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6720885f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6720885f
Branch: refs/heads/ignite-426
Commit: 6720885ff9f1541b917e0dc3f83e7629d4e2ffc1
Parents: 8e6b90c
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 3 18:15:48 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 3 18:15:48 2015 -0700
----------------------------------------------------------------------
.../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6720885f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index a8dc8ef..f5119f6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -2416,9 +2416,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
* @param req Dht atomic update request.
*/
private void processDhtAtomicUpdateRequest(final UUID nodeId, final GridDhtAtomicUpdateRequest req) {
- IgniteInternalFuture fut = ctx.preloader().request(req.keys(), req.topologyVersion());
+ IgniteInternalFuture fut = !req.keys().isEmpty() ?
+ ctx.preloader().request(req.keys(), req.topologyVersion()) : null;
- if (fut.isDone())
+ if (fut == null || fut.isDone())
processDhtAtomicUpdateRequest0(nodeId, req);
else {
fut.listen(new CI1<IgniteInternalFuture>() {
[48/50] incubator-ignite git commit: Merge branch 'ignite-104' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1191
Posted by vk...@apache.org.
Merge branch 'ignite-104' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1191
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2f101848
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2f101848
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2f101848
Branch: refs/heads/ignite-426
Commit: 2f101848aee3b4f33b66a99d147b9f01331f92bf
Parents: ae11e9b 2a8b548
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 11 00:24:49 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 11 00:24:49 2015 -0700
----------------------------------------------------------------------
.../ignite/codegen/MessageCodeGenerator.java | 8 +
.../org/apache/ignite/internal/GridTopic.java | 2 +-
.../IgniteLocalNodeStoppedException.java | 55 +++++
.../managers/communication/GridIoManager.java | 247 +++++++++++++++++--
.../managers/communication/GridIoMessage.java | 48 +++-
.../cache/GridCacheEvictionManager.java | 11 +-
.../processors/cache/GridCacheIoManager.java | 132 ++++++++--
.../processors/cache/GridCacheMapEntry.java | 12 +-
.../processors/cache/GridCacheMvccManager.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 15 +-
.../dht/atomic/GridAtomicMappingKey.java | 86 +++++++
.../dht/atomic/GridAtomicRequestTopic.java | 124 ++++++++++
.../dht/atomic/GridDhtAtomicCache.java | 128 ++++++----
.../GridDhtAtomicDeferredUpdateResponse.java | 32 ++-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 95 ++++---
.../dht/atomic/GridDhtAtomicUpdateRequest.java | 81 +++---
.../dht/atomic/GridDhtAtomicUpdateResponse.java | 33 ++-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 238 +++++++++---------
.../dht/atomic/GridNearAtomicUpdateRequest.java | 63 +++--
.../atomic/GridNearAtomicUpdateResponse.java | 34 ++-
.../preloader/GridDhtPartitionDemandPool.java | 15 +-
.../distributed/near/GridNearAtomicCache.java | 32 ++-
.../query/GridCacheDistributedQueryManager.java | 8 +-
.../resources/META-INF/classnames.properties | 3 +-
.../GridCacheAbstractRemoveFailureTest.java | 6 +-
.../GridCacheTransformEventSelfTest.java | 14 +-
...niteCacheClientNodeChangingTopologyTest.java | 4 +-
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 2 -
.../IgniteCacheLoaderWriterAbstractTest.java | 2 +-
.../IgniteCacheStoreSessionAbstractTest.java | 2 +-
.../junits/common/GridCommonAbstractTest.java | 22 +-
31 files changed, 1197 insertions(+), 359 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2f101848/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
[37/50] incubator-ignite git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7b161f0f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7b161f0f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7b161f0f
Branch: refs/heads/ignite-426
Commit: 7b161f0f2e107a3adbbfaeddc5b086ab5890ce5f
Parents: 05b27aa 023ffe0
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Aug 5 11:41:55 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Aug 5 11:41:55 2015 -0700
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 10 +++-
.../ignite/internal/util/GridLogThrottle.java | 63 +++++++++++++++-----
.../ignite/spi/discovery/tcp/ClientImpl.java | 5 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 5 +-
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 15 +++++
.../spi/discovery/tcp/TcpDiscoverySpi.java | 5 ++
.../query/h2/twostep/GridMapQueryExecutor.java | 7 ++-
.../h2/twostep/GridReduceQueryExecutor.java | 7 ++-
modules/log4j2/README.txt | 15 ++++-
.../ignite/logger/log4j2/Log4J2Logger.java | 2 +-
.../ignite/logger/log4j2/Log4j2FileAware.java | 35 -----------
11 files changed, 107 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
[39/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3d995af8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3d995af8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3d995af8
Branch: refs/heads/ignite-426
Commit: 3d995af8af09568f900ff0ffed1ccca37543ceab
Parents: c8b67de
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Aug 5 16:19:07 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Aug 5 16:19:07 2015 -0700
----------------------------------------------------------------------
.../ignite/internal/processors/cache/GridCacheContext.java | 4 ++--
.../processors/cache/GridCacheAbstractRemoveFailureTest.java | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d995af8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index db62f20..5f17746 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -537,8 +537,8 @@ public class GridCacheContext<K, V> implements Externalizable {
* @return {@code True} if entries should not be deleted from cache immediately.
*/
public boolean deferredDelete(GridCacheAdapter<?, ?> cache) {
- // Only TRANSACTIONAL caches.
- return cache.isDht() || cache.isColocated();
+ return cache.isDht() || cache.isDhtAtomic() || cache.isColocated() ||
+ (cache.isNear() && cache.configuration().getAtomicityMode() == ATOMIC);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d995af8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
index 2b6a6b0..b71f848 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
@@ -322,11 +322,13 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCacheAbstra
boolean primary = affinity(cache).isPrimary(ignite.cluster().localNode(), expVal.getKey());
boolean backup = affinity(cache).isBackup(ignite.cluster().localNode(), expVal.getKey());
- log.error("Unexpected cache data [exp=" + expVal +
+ log.error("Unexpected cache data [" +
+ "key=" + expVal.getKey() +
+ ", exp=" + expVal.getValue().get() +
", actual=" + val +
", nodePrimary=" + primary +
", nodeBackup=" + backup +
- ", nodeIdx" + i +
+ ", nodeIdx=" + i +
", nodeId=" + ignite.cluster().localNode().id() + ']');
}
}
[23/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d26184ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d26184ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d26184ab
Branch: refs/heads/ignite-426
Commit: d26184ab0cfbf81dc55b502342cd56baa50d1421
Parents: 25a109b
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 3 21:38:56 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 3 21:38:56 2015 -0700
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d26184ab/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index bafdfef..aa84346 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -103,7 +103,7 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(IgniteClientNodeAffinityTest.class);
// Swap tests.
- suite.addTestSuite(GridCacheSwapPreloadSelfTest.class);
+// suite.addTestSuite(GridCacheSwapPreloadSelfTest.class); // TODO: IGNITE-104
suite.addTestSuite(GridCacheSwapReloadSelfTest.class);
// Common tests.
[06/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9781ea43
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9781ea43
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9781ea43
Branch: refs/heads/ignite-426
Commit: 9781ea4384a553e5126b8a7320f7070f6a340809
Parents: 7c73fc5
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 29 17:57:49 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 29 17:57:49 2015 -0700
----------------------------------------------------------------------
.../org/apache/ignite/internal/GridTopic.java | 17 +-
.../processors/cache/GridCacheIoManager.java | 3 +-
.../processors/cache/GridCacheUtils.java | 4 +-
.../dht/atomic/GridDhtAtomicCache.java | 29 ++--
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 2 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 172 ++++++-------------
.../dht/atomic/GridNearAtomicUpdateRequest.java | 27 +--
.../atomic/GridNearAtomicUpdateResponse.java | 28 +--
8 files changed, 87 insertions(+), 195 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
index 3cf92f8..e9da40c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
@@ -185,11 +185,10 @@ public enum GridTopic {
/**
* @param id1 ID1.
* @param id2 ID2.
- * @param id3 ID3.
* @return Grid message topic with specified IDs.
*/
- public Object topic(int id1, int id2, byte id3) {
- return new T9(this, id1, id2, id3);
+ public Object topic(int id1, int id2) {
+ return new T9(this, id1, id2);
}
/**
@@ -782,9 +781,6 @@ public enum GridTopic {
/** */
private int id2;
- /** */
- private int id3;
-
/**
* No-arg constructor needed for {@link Serializable}.
*/
@@ -796,13 +792,11 @@ public enum GridTopic {
* @param topic Topic.
* @param id1 ID1.
* @param id2 ID2.
- * @param id3 ID3.
*/
- private T9(GridTopic topic, int id1, int id2, byte id3) {
+ private T9(GridTopic topic, int id1, int id2) {
this.topic = topic;
this.id1 = id1;
this.id2 = id2;
- this.id3 = id3;
}
/** {@inheritDoc} */
@@ -811,7 +805,6 @@ public enum GridTopic {
res += 31 * res + id1;
res += 31 * res + id2;
- res += 31 * res + id3;
return res;
}
@@ -821,7 +814,7 @@ public enum GridTopic {
if (obj.getClass() == T9.class) {
T9 that = (T9)obj;
- return topic == that.topic && id1 == that.id1 && id2 == that.id2 && id3 == that.id3;
+ return topic == that.topic && id1 == that.id1 && id2 == that.id2;
}
return false;
@@ -832,7 +825,6 @@ public enum GridTopic {
out.writeByte(topic.ordinal());
out.writeInt(id1);
out.writeInt(id2);
- out.writeByte(id3);
}
/** {@inheritDoc} */
@@ -840,7 +832,6 @@ public enum GridTopic {
topic = fromOrdinal(in.readByte());
id1 = in.readInt();
id2 = in.readInt();
- id3 = in.readByte();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index dec6aef..5858424 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -394,8 +394,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(
ctx.cacheId(),
nodeId,
- req.futureVersion(),
- req.partition());
+ req.futureVersion());
res.error(req.classError());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 96df7c5..d82acca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1739,9 +1739,9 @@ public class GridCacheUtils {
* @param part Partition.
* @return Per-partition message topic.
*/
- public static Object partitionMessageTopic(GridCacheContext ctx, int part, boolean nearMsg) {
+ public static Object partitionMessageTopic(GridCacheContext ctx, int part) {
assert part >= 0;
- return TOPIC_CACHE.topic(ctx.cacheId(), part, (byte)(nearMsg ? 1 : 0));
+ return TOPIC_CACHE.topic(ctx.cacheId(), part);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 31606b2..3084e68 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -181,15 +181,15 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
});
+ ctx.io().addHandler(ctx.cacheId(), GridNearAtomicUpdateRequest.class, new CI2<UUID, GridNearAtomicUpdateRequest>() {
+ @Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
+ processNearAtomicUpdateRequest(nodeId, req);
+ }
+ });
+
if (ctx.config().isAtomicOrderedUpdates()) {
for (int part = 0; part < ctx.affinity().partitions(); part++) {
- ctx.io().addOrderedHandler(CU.partitionMessageTopic(ctx, part, true), new CI2<UUID, GridNearAtomicUpdateRequest>() {
- @Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
- processNearAtomicUpdateRequest(nodeId, req);
- }
- });
-
- ctx.io().addOrderedHandler(CU.partitionMessageTopic(ctx, part, false), new CI2<UUID, GridDhtAtomicUpdateRequest>() {
+ ctx.io().addOrderedHandler(CU.partitionMessageTopic(ctx, part), new CI2<UUID, GridDhtAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridDhtAtomicUpdateRequest req) {
processDhtAtomicUpdateRequest(nodeId, req);
}
@@ -197,12 +197,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
}
else {
- ctx.io().addHandler(ctx.cacheId(), GridNearAtomicUpdateRequest.class, new CI2<UUID, GridNearAtomicUpdateRequest>() {
- @Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
- processNearAtomicUpdateRequest(nodeId, req);
- }
- });
-
ctx.io().addHandler(ctx.cacheId(), GridDhtAtomicUpdateRequest.class, new CI2<UUID, GridDhtAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridDhtAtomicUpdateRequest req) {
processDhtAtomicUpdateRequest(nodeId, req);
@@ -244,10 +238,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
buf.finish();
if (ctx.config().isAtomicOrderedUpdates()) {
- for (int part = 0; part < ctx.affinity().partitions(); part++) {
- ctx.io().removeOrderedHandler(CU.partitionMessageTopic(ctx, part, true));
- ctx.io().removeOrderedHandler(CU.partitionMessageTopic(ctx, part, false));
- }
+ for (int part = 0; part < ctx.affinity().partitions(); part++)
+ ctx.io().removeOrderedHandler(CU.partitionMessageTopic(ctx, part));
}
}
@@ -1041,8 +1033,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
) {
GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(ctx.cacheId(),
nodeId,
- req.futureVersion(),
- req.partition());
+ req.futureVersion());
List<KeyCacheObject> keys = req.keys();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index ab0c2e1..8595dc7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -359,7 +359,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
log.debug("Sending DHT atomic update request [nodeId=" + nodeId + ", req=" + req + ']');
if (part >= 0) {
- Object topic = CU.partitionMessageTopic(cctx, part, false);
+ Object topic = CU.partitionMessageTopic(cctx, part);
cctx.io().sendOrderedMessage(nodeId, topic, req, cctx.ioPolicy(),
2 * cctx.gridConfig().getNetworkTimeout());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 9b2a5e2..4c8a161 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -90,7 +90,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** Mappings. */
@GridToStringInclude
- private ConcurrentMap<GridAtomicMappingKey, GridNearAtomicUpdateRequest> mappings;
+ private ConcurrentMap<UUID, GridNearAtomicUpdateRequest> mappings;
/** Error. */
private volatile CachePartialUpdateCheckedException err;
@@ -246,11 +246,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** {@inheritDoc} */
@Override public Collection<? extends ClusterNode> nodes() {
- return F.view(F.viewReadOnly(mappings.keySet(), new C1<GridAtomicMappingKey, ClusterNode>() {
- @Override public ClusterNode apply(GridAtomicMappingKey mappingKey) {
- return cctx.kernalContext().discovery().node(mappingKey.nodeId());
- }
- }), F.notNull());
+ return F.view(F.viewReadOnly(mappings.keySet(), U.id2Node(cctx.kernalContext())), F.notNull());
}
/**
@@ -287,24 +283,13 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return false;
}
- Collection<GridAtomicMappingKey> mappingKeys = new ArrayList<>(mappings.size());
- Collection<KeyCacheObject> failedKeys = new ArrayList<>();
-
- for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
- if (e.getKey().nodeId().equals(nodeId)) {
- mappingKeys.add(e.getKey());
-
- failedKeys.addAll(e.getValue().keys());
- }
- }
+ GridNearAtomicUpdateRequest req = mappings.get(nodeId);
- if (!mappingKeys.isEmpty()) {
- if (!failedKeys.isEmpty())
- addFailedKeys(failedKeys, new ClusterTopologyCheckedException("Primary node left grid before " +
- "response is received: " + nodeId));
+ if (req != null) {
+ addFailedKeys(req.keys(), new ClusterTopologyCheckedException("Primary node left grid before response is " +
+ "received: " + nodeId));
- for (GridAtomicMappingKey key : mappingKeys)
- mappings.remove(key);
+ mappings.remove(nodeId);
checkComplete();
@@ -544,9 +529,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
}
else {
- GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, res.partition());
-
- GridNearAtomicUpdateRequest req = mappings.get(mappingKey);
+ GridNearAtomicUpdateRequest req = mappings.get(nodeId);
if (req != null) { // req can be null if onResult is being processed concurrently with onNodeLeft.
updateNear(req, res);
@@ -564,7 +547,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
opRes = ret;
}
- mappings.remove(mappingKey);
+ mappings.remove(nodeId);
}
checkComplete();
@@ -780,11 +763,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (op != TRANSFORM)
val = cctx.toCacheObject(val);
- int part = cctx.affinity().partition(cacheKey);
- ClusterNode primary = cctx.affinity().primary(part, topVer);
-
- if (!ccfg.isAtomicOrderedUpdates())
- part = -1;
+ ClusterNode primary = cctx.affinity().primary(cacheKey, topVer);
if (primary == null) {
onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
@@ -810,8 +789,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
subjId,
taskNameHash,
skipStore,
- cctx.kernalContext().clientNode(),
- part);
+ cctx.kernalContext().clientNode());
req.addUpdateEntry(cacheKey,
val,
@@ -827,7 +805,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
// Optimize mapping for single key.
- mapSingle(new GridAtomicMappingKey(primary.id(), part), req);
+ mapSingle(primary.id(), req);
return;
}
@@ -847,18 +825,13 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (conflictRmvVals != null)
conflictRmvValsIt = conflictRmvVals.iterator();
- Map<GridAtomicMappingKey, GridNearAtomicUpdateRequest> pendingMappings = new HashMap<>(topNodes.size(), 1.0f);
+ Map<UUID, GridNearAtomicUpdateRequest> pendingMappings = new HashMap<>(topNodes.size(), 1.0f);
// Must do this in synchronized block because we need to atomically remove and add mapping.
// Otherwise checkComplete() may see empty intermediate state.
synchronized (this) {
- if (oldNodeId != null) {
- // TODO: IGNITE-104 - Try to avoid iteration.
- for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
- if (e.getKey().nodeId().equals(oldNodeId))
- mappings.remove(e.getKey());
- }
- }
+ if (oldNodeId != null)
+ removeMapping(oldNodeId);
// For fastMap mode wait for all responses before remapping.
if (remap && fastMap && !mappings.isEmpty()) {
@@ -928,10 +901,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (op != TRANSFORM)
val = cctx.toCacheObject(val);
- T2<Integer, Collection<ClusterNode>> t = mapKey(cacheKey, topVer, fastMap);
-
- int part = ccfg.isAtomicOrderedUpdates() ? t.get1() : -1;
- Collection<ClusterNode> affNodes = t.get2();
+ Collection<ClusterNode> affNodes = mapKey(cacheKey, topVer, fastMap);
if (affNodes.isEmpty()) {
onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
@@ -952,9 +922,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
UUID nodeId = affNode.id();
- GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, part);
-
- GridNearAtomicUpdateRequest mapped = pendingMappings.get(mappingKey);
+ GridNearAtomicUpdateRequest mapped = pendingMappings.get(nodeId);
if (mapped == null) {
mapped = new GridNearAtomicUpdateRequest(
@@ -974,12 +942,11 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
subjId,
taskNameHash,
skipStore,
- cctx.kernalContext().clientNode(),
- part);
+ cctx.kernalContext().clientNode());
- pendingMappings.put(mappingKey, mapped);
+ pendingMappings.put(nodeId, mapped);
- GridNearAtomicUpdateRequest old = mappings.put(mappingKey, mapped);
+ GridNearAtomicUpdateRequest old = mappings.put(nodeId, mapped);
assert old == null || (old != null && remap) :
"Invalid mapping state [old=" + old + ", remap=" + remap + ']';
@@ -997,7 +964,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
if ((single == null || single) && pendingMappings.size() == 1) {
- Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> entry = F.first(pendingMappings.entrySet());
+ Map.Entry<UUID, GridNearAtomicUpdateRequest> entry = F.first(pendingMappings.entrySet());
single = true;
@@ -1020,35 +987,31 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* @param fastMap Flag indicating whether mapping is performed for fast-circuit update.
* @return Collection of nodes to which key is mapped.
*/
- private T2<Integer, Collection<ClusterNode>> mapKey(
+ private Collection<ClusterNode> mapKey(
KeyCacheObject key,
AffinityTopologyVersion topVer,
boolean fastMap
) {
GridCacheAffinityManager affMgr = cctx.affinity();
- int part = affMgr.partition(key);
-
// If we can send updates in parallel - do it.
- Collection<ClusterNode> nodes = fastMap ?
- cctx.topology().nodes(part, topVer) :
- Collections.singletonList(affMgr.primary(part, topVer));
-
- return new T2<>(part, nodes);
+ return fastMap ?
+ cctx.topology().nodes(affMgr.partition(key), topVer) :
+ Collections.singletonList(affMgr.primary(key, topVer));
}
/**
* Maps future to single node.
*
- * @param mappingKey Mapping key.
+ * @param nodeId Node ID.
* @param req Request.
*/
- private void mapSingle(GridAtomicMappingKey mappingKey, GridNearAtomicUpdateRequest req) {
- singleNodeId = mappingKey.nodeId();
+ private void mapSingle(UUID nodeId, GridNearAtomicUpdateRequest req) {
+ singleNodeId = nodeId;
singleReq = req;
- if (cctx.localNodeId().equals(mappingKey.nodeId())) {
- cache.updateAllAsyncInternal(mappingKey.nodeId(), req,
+ if (cctx.localNodeId().equals(nodeId)) {
+ cache.updateAllAsyncInternal(nodeId, req,
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req,
GridNearAtomicUpdateResponse res) {
@@ -1063,7 +1026,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (log.isDebugEnabled())
log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
- sendRequest(mappingKey, req);
+ cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
if (syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY)
onDone(new GridCacheReturn(cctx, true, null, true));
@@ -1079,37 +1042,34 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
*
* @param mappings Mappings to send.
*/
- private void doUpdate(Map<GridAtomicMappingKey, GridNearAtomicUpdateRequest> mappings) {
+ private void doUpdate(Map<UUID, GridNearAtomicUpdateRequest> mappings) {
UUID locNodeId = cctx.localNodeId();
- Collection<GridNearAtomicUpdateRequest> locUpdates = null;
+ GridNearAtomicUpdateRequest locUpdate = null;
// Send messages to remote nodes first, then run local update.
- for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
- GridAtomicMappingKey mappingKey = e.getKey();
- GridNearAtomicUpdateRequest req = e.getValue();
-
+ for (GridNearAtomicUpdateRequest req : mappings.values()) {
if (locNodeId.equals(req.nodeId())) {
- if (locUpdates == null)
- locUpdates = new ArrayList<>(mappings.size());
+ assert locUpdate == null : "Cannot have more than one local mapping [locUpdate=" + locUpdate +
+ ", req=" + req + ']';
- locUpdates.add(req);
+ locUpdate = req;
}
else {
try {
if (log.isDebugEnabled())
log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
- sendRequest(mappingKey, req);
+ cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
}
- catch (IgniteCheckedException ex) {
- addFailedKeys(req.keys(), ex);
+ catch (IgniteCheckedException e) {
+ addFailedKeys(req.keys(), e);
- removeMapping(mappingKey);
+ removeMapping(req.nodeId());
}
if (syncMode == PRIMARY_SYNC && !req.hasPrimary())
- removeMapping(mappingKey);
+ removeMapping(req.nodeId());
}
}
@@ -1117,52 +1077,28 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
// In FULL_ASYNC mode always return (null, true).
opRes = new GridCacheReturn(cctx, true, null, true);
- if (locUpdates != null) {
- for (GridNearAtomicUpdateRequest locUpdate : locUpdates) {
- cache.updateAllAsyncInternal(cctx.localNodeId(), locUpdate,
- new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
- @Override public void apply(GridNearAtomicUpdateRequest req,
- GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer) : futVer;
+ if (locUpdate != null) {
+ cache.updateAllAsyncInternal(cctx.localNodeId(), locUpdate,
+ new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
+ @Override public void apply(GridNearAtomicUpdateRequest req,
+ GridNearAtomicUpdateResponse res) {
+ assert res.futureVersion().equals(futVer) : futVer;
- onResult(res.nodeId(), res);
- }
- });
- }
+ onResult(res.nodeId(), res);
+ }
+ });
}
checkComplete();
}
/**
- * Sends request.
- *
- * @param mappingKey Mapping key.
- * @param req Update request.
- * @throws IgniteCheckedException In case of error.
- */
- private void sendRequest(GridAtomicMappingKey mappingKey, GridNearAtomicUpdateRequest req)
- throws IgniteCheckedException {
- if (mappingKey.partition() >= 0) {
- Object topic = CU.partitionMessageTopic(cctx, mappingKey.partition(), true);
-
- cctx.io().sendOrderedMessage(mappingKey.nodeId(), topic, req, cctx.ioPolicy(),
- 2 * cctx.gridConfig().getNetworkTimeout());
- }
- else {
- assert mappingKey.partition() == -1;
-
- cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
- }
- }
-
- /**
* Removes mapping from future mappings map.
*
- * @param mappingKey Mapping key.
+ * @param nodeId Node ID to remove mapping for.
*/
- private void removeMapping(GridAtomicMappingKey mappingKey) {
- mappings.remove(mappingKey);
+ private void removeMapping(UUID nodeId) {
+ mappings.remove(nodeId);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index b3075c4..734cf6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -135,9 +135,6 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
/** */
private boolean clientReq;
- /** Partition. */
- private int part;
-
/**
* Empty constructor required by {@link Externalizable}.
*/
@@ -165,7 +162,6 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
* @param taskNameHash Task name hash code.
* @param skipStore Skip write-through to a persistent storage.
* @param clientReq Client node request flag.
- * @param part Partition.
*/
public GridNearAtomicUpdateRequest(
int cacheId,
@@ -184,8 +180,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
@Nullable UUID subjId,
int taskNameHash,
boolean skipStore,
- boolean clientReq,
- int part
+ boolean clientReq
) {
this.cacheId = cacheId;
this.nodeId = nodeId;
@@ -205,7 +200,6 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
this.taskNameHash = taskNameHash;
this.skipStore = skipStore;
this.clientReq = clientReq;
- this.part = part;
keys = new ArrayList<>();
}
@@ -321,13 +315,6 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
}
/**
- * @return Partition.
- */
- public int partition() {
- return part;
- }
-
- /**
* @param key Key to add.
* @param val Optional update value.
* @param conflictTtl Conflict TTL (optional).
@@ -679,8 +666,8 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
writer.incrementState();
case 16:
- if (!writer.writeInt("part", part))
- return false;
+// if (!writer.writeInt("part", part))
+// return false;
writer.incrementState();
@@ -863,10 +850,10 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
case 16:
- part = reader.readInt("part");
-
- if (!reader.isLastRead())
- return false;
+// part = reader.readInt("part");
+//
+// if (!reader.isLastRead())
+// return false;
reader.incrementState();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9781ea43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index e2d33d5..2b30536 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -92,9 +92,6 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
/** Near expire times. */
private GridLongList nearExpireTimes;
- /** Partition. */
- private int part;
-
/**
* Empty constructor required by {@link Externalizable}.
*/
@@ -106,13 +103,11 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
* @param cacheId Cache ID.
* @param nodeId Node ID this reply should be sent to.
* @param futVer Future version.
- * @param part Partition.
*/
- public GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, GridCacheVersion futVer, int part) {
+ public GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, GridCacheVersion futVer) {
this.cacheId = cacheId;
this.nodeId = nodeId;
this.futVer = futVer;
- this.part = part;
}
/** {@inheritDoc} */
@@ -143,7 +138,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
/**
* Sets update error.
- * @param err
+ * @param err Exception.
*/
public void error(IgniteCheckedException err){
this.err = err;
@@ -193,13 +188,6 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
}
/**
- * @return Partition.
- */
- public int partition() {
- return part;
- }
-
- /**
* Adds value to be put in near cache on originating node.
*
* @param keyIdx Key index.
@@ -497,8 +485,8 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
writer.incrementState();
case 12:
- if (!writer.writeInt("part", part))
- return false;
+// if (!writer.writeInt("part", part))
+// return false;
writer.incrementState();
@@ -603,10 +591,10 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
reader.incrementState();
case 12:
- part = reader.readInt("part");
-
- if (!reader.isLastRead())
- return false;
+// part = reader.readInt("part");
+//
+// if (!reader.isLastRead())
+// return false;
reader.incrementState();
[10/50] incubator-ignite git commit: Merge branches 'ignite-104' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-104
Posted by vk...@apache.org.
Merge branches 'ignite-104' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dad46913
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dad46913
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dad46913
Branch: refs/heads/ignite-426
Commit: dad46913f38626f1335232549e5236ff21547812
Parents: 5241e27 7ed4d15
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Jul 30 11:53:26 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Jul 30 11:53:26 2015 -0700
----------------------------------------------------------------------
...cheDhtLocalPartitionAfterRemoveSelfTest.java | 107 +++++++++++++++++++
1 file changed, 107 insertions(+)
----------------------------------------------------------------------
[09/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5241e274
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5241e274
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5241e274
Branch: refs/heads/ignite-426
Commit: 5241e2747ad54e901d9e4908caee40a3e38b5ab7
Parents: aa11f64
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 29 23:26:59 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 29 23:26:59 2015 -0700
----------------------------------------------------------------------
.../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5241e274/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 3084e68..be35d00 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1164,7 +1164,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
}
catch (GridCacheEntryRemovedException e) {
- assert false : "Entry should not become obsolete while holding lock.";
+ assert !ctx.deferredDelete() : "Entry should not become obsolete while holding lock.";
e.printStackTrace();
}
[29/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/aeac6aaa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/aeac6aaa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/aeac6aaa
Branch: refs/heads/ignite-426
Commit: aeac6aaa2641a4afaa38ec57c0046649601e1184
Parents: b73fa67
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 17:11:48 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 17:11:48 2015 -0700
----------------------------------------------------------------------
.../IgniteLocalNodeStoppedException.java | 55 ++++++++++++++++++++
.../processors/cache/GridCacheMvccManager.java | 2 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 2 +-
...heExpiredEntriesPreloadAbstractSelfTest.java | 2 +-
.../GridCacheTransformEventSelfTest.java | 14 +----
...niteCacheClientNodeChangingTopologyTest.java | 4 +-
.../dht/GridCacheAtomicNearCacheSelfTest.java | 4 +-
7 files changed, 65 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aeac6aaa/modules/core/src/main/java/org/apache/ignite/internal/IgniteLocalNodeStoppedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteLocalNodeStoppedException.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteLocalNodeStoppedException.java
new file mode 100644
index 0000000..bc8eb5c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteLocalNodeStoppedException.java
@@ -0,0 +1,55 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.jetbrains.annotations.*;
+
+/**
+ * Exception used when local node is stopping.
+ */
+public class IgniteLocalNodeStoppedException extends IgniteCheckedException {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Creates new exception with default error message.
+ */
+ public IgniteLocalNodeStoppedException() {
+ super("Local node is stopping.");
+ }
+
+ /**
+ * Creates new exception with given error message.
+ *
+ * @param msg Error message.
+ */
+ public IgniteLocalNodeStoppedException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Creates a new exception with given error message and optional nested cause exception.
+ *
+ * @param msg Error message.
+ * @param cause Optional nested exception (can be {@code null}).
+ */
+ public IgniteLocalNodeStoppedException(String msg, @Nullable Throwable cause) {
+ super(msg, cause);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aeac6aaa/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index 6a8c6fe..7416672 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -296,7 +296,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
* Cancels all client futures.
*/
public void cancelClientFutures() {
- cancelClientFutures(new IgniteCheckedException("Operation has been cancelled (node is stopping)."));
+ cancelClientFutures(new IgniteLocalNodeStoppedException());
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aeac6aaa/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 52d59ed..7823a52 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -324,7 +324,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
if (super.onDone(res, err)) {
cctx.mvcc().removeAtomicFuture(version());
- if (updateReq.writeSynchronizationMode() == FULL_SYNC)
+ if (updateReq.writeSynchronizationMode() == FULL_SYNC && !(err instanceof IgniteLocalNodeStoppedException))
completionCb.apply(updateReq, updateRes);
return true;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aeac6aaa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
index ccc9b64..8b9373d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
@@ -105,7 +105,7 @@ public abstract class GridCacheExpiredEntriesPreloadAbstractSelfTest extends Gri
Collection<Event> evts = g1.events().localQuery(F.<Event>alwaysTrue(), EVT_CACHE_REBALANCE_OBJECT_LOADED);
- assertEquals("Expected all entries are preloaded.", KEYS_NUM, evts.size());
+ assertEquals("Expected all entries are preloaded.", cache1.isDhtAtomic() ? 0 : KEYS_NUM, evts.size());
boolean rmv = GridTestUtils.waitForCondition(new PAX() {
@Override public boolean applyx() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aeac6aaa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTransformEventSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTransformEventSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTransformEventSelfTest.java
index 459e015..31edb8f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTransformEventSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTransformEventSelfTest.java
@@ -457,13 +457,13 @@ public class GridCacheTransformEventSelfTest extends GridCommonAbstractTest {
caches[0].invoke(key1, new Transformer());
- checkEventNodeIdsStrict(primaryIdsForKeys(key1));
+ checkEventNodeIdsStrict(idsForKeys(key1));
assert evts.isEmpty();
caches[0].invokeAll(keys, new Transformer());
- checkEventNodeIdsStrict(primaryIdsForKeys(key1, key2));
+ checkEventNodeIdsStrict(idsForKeys(key1, key2));
}
/**
@@ -505,16 +505,6 @@ public class GridCacheTransformEventSelfTest extends GridCommonAbstractTest {
}
/**
- * Get primary node IDs where the given keys must reside.
- *
- * @param keys Keys.
- * @return Node IDs.
- */
- private UUID[] primaryIdsForKeys(int... keys) {
- return idsForKeys(true, keys);
- }
-
- /**
* Get node IDs where the given keys must reside.
*
* @param primaryOnly Primary only flag.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aeac6aaa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
index 58c5f95..3c6e5e4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
@@ -295,6 +295,8 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
IgniteEx ignite1 = startGrid(1);
IgniteEx ignite2 = startGrid(2);
+ awaitPartitionMapExchange();
+
client = true;
Ignite ignite3 = startGrid(3);
@@ -348,7 +350,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
List<Object> msgs = spi.recordedMessages();
- assertEquals(3, msgs.size());
+ assertEquals(6, msgs.size());
for (Object msg : msgs)
assertTrue(((GridNearAtomicUpdateRequest)msg).clientRequest());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aeac6aaa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
index 2d28328..6d12f5e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
@@ -668,7 +668,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
cache0.remove(nearKey); // Remove from grid0, this should remove readers on primary node.
for (int i = 0; i < GRID_CNT; i++)
- checkEntry(grid(i), nearKey, null, i == 0);
+ checkEntry(grid(i), nearKey, null, false);
Ignite primaryNode = G.ignite((String) aff.mapKeyToNode(nearKey).attribute(ATTR_GRID_NAME));
@@ -698,7 +698,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
GridCacheEntryEx nearEntry = near.peekEx(key);
- boolean expectDht = near.affinity().isPrimaryOrBackup(ignite.cluster().localNode(), key);
+ boolean expectDht = val != null && near.affinity().isPrimaryOrBackup(ignite.cluster().localNode(), key);
if (expectNear) {
assertNotNull("No near entry for: " + key + ", grid: " + ignite.name(), nearEntry);
[05/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7c73fc5d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7c73fc5d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7c73fc5d
Branch: refs/heads/ignite-426
Commit: 7c73fc5d8d81f3cded6bffd4dcf3d1e48ad84d64
Parents: e5c69b8
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 29 17:26:44 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 29 17:26:44 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 9 ++-------
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 3 ---
.../dht/atomic/GridDhtAtomicUpdateRequest.java | 19 ++-----------------
.../distributed/near/GridNearAtomicCache.java | 4 ++--
4 files changed, 6 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7c73fc5d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 02e48df..31606b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1767,7 +1767,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
dhtFut.addNearWriteEntries(filteredReaders,
entry,
updRes.newValue(),
- op == TRANSFORM ? req.entryProcessor(i) : null,
updRes.newTtl(),
updRes.conflictExpireTime());
}
@@ -2034,13 +2033,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
if (dhtFut != null) {
- EntryProcessor<Object, Object, Object> entryProcessor =
- entryProcessorMap == null ? null : entryProcessorMap.get(entry.key());
-
if (!batchRes.readersOnly())
dhtFut.addWriteEntry(entry,
writeVal,
- entryProcessor,
+ entryProcessorMap == null ? null : entryProcessorMap.get(entry.key()),
updRes.newTtl(),
CU.EXPIRE_TIME_CALCULATE,
null);
@@ -2049,7 +2045,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
dhtFut.addNearWriteEntries(filteredReaders,
entry,
writeVal,
- entryProcessor,
updRes.newTtl(),
CU.EXPIRE_TIME_CALCULATE);
}
@@ -2465,7 +2460,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
/*event*/true,
/*metrics*/true,
/*primary*/false,
- /*check version*/!req.forceTransformBackups(),
+ /*check version*/op != TRANSFORM || !req.forceTransformBackups(),
req.topologyVersion(),
CU.empty0(),
replicate ? DR_BACKUP : DR_NONE,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7c73fc5d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 15ec121..ab0c2e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -270,14 +270,12 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
* @param readers Entry readers.
* @param entry Entry.
* @param val Value.
- * @param entryProcessor Entry processor..
* @param ttl TTL for near cache update (optional).
* @param expireTime Expire time for near cache update (optional).
*/
public void addNearWriteEntries(Iterable<UUID> readers,
GridDhtCacheEntry entry,
@Nullable CacheObject val,
- EntryProcessor<Object, Object, Object> entryProcessor,
long ttl,
long expireTime) {
CacheWriteSynchronizationMode syncMode = updateReq.writeSynchronizationMode();
@@ -323,7 +321,6 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
updateReq.addNearWriteValue(entry.key(),
val,
- entryProcessor,
ttl,
expireTime);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7c73fc5d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 7149dec..6340c93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -267,36 +267,21 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
/**
* @param key Key to add.
* @param val Value, {@code null} if should be removed.
- * @param entryProcessor Entry processor.
* @param ttl TTL.
* @param expireTime Expire time.
*/
public void addNearWriteValue(KeyCacheObject key,
@Nullable CacheObject val,
- EntryProcessor<Object, Object, Object> entryProcessor,
long ttl,
long expireTime)
{
if (nearKeys == null) {
nearKeys = new ArrayList<>();
-
- if (forceTransformBackups) {
- nearEntryProcessors = new ArrayList<>();
- nearEntryProcessorsBytes = new ArrayList<>();
- }
- else
- nearVals = new ArrayList<>();
+ nearVals = new ArrayList<>();
}
nearKeys.add(key);
-
- if (forceTransformBackups) {
- assert entryProcessor != null;
-
- nearEntryProcessors.add(entryProcessor);
- }
- else
- nearVals.add(val);
+ nearVals.add(val);
if (ttl >= 0) {
if (nearTtls == null) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7c73fc5d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 0aa1638..707facc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -225,7 +225,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
/*write-through*/false,
/*read-through*/false,
/*retval*/false,
- /**expiry policy*/null,
+ /*expiry policy*/null,
/*event*/true,
/*metrics*/true,
/*primary*/false,
@@ -336,7 +336,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
/*event*/true,
/*metrics*/true,
/*primary*/false,
- /*check version*/!req.forceTransformBackups(),
+ /*check version*/op != TRANSFORM || !req.forceTransformBackups(),
req.topologyVersion(),
CU.empty0(),
DR_NONE,
[16/50] incubator-ignite git commit: Merge branches 'ignite-104' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-104
Posted by vk...@apache.org.
Merge branches 'ignite-104' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Conflicts:
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6b52a234
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6b52a234
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6b52a234
Branch: refs/heads/ignite-426
Commit: 6b52a234f8c8f845a088df225220d6dde30a5e3f
Parents: 5cdd244
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Jul 31 13:40:21 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Jul 31 13:40:21 2015 -0700
----------------------------------------------------------------------
.../managers/communication/GridIoManager.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6b52a234/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 479d116..d125eef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -1227,7 +1227,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
*/
public void send(ClusterNode node, GridTopic topic, Message msg, byte plc,
IgniteInClosure<IgniteException> ackClosure) throws IgniteCheckedException {
- send(node, topic, topic.ordinal(), msg, plc, false, 0, false, ackClosure);
+ send(node, topic, topic.ordinal(), msg, plc, false, false, 0, false, ackClosure);
}
/**
@@ -1250,7 +1250,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
throws IgniteCheckedException {
assert timeout > 0 || skipOnTimeout;
- send(nodes, topic, -1, msg, plc, true, false, timeout, skipOnTimeout);
+ send(nodes, topic, -1, msg, plc, true, false, timeout, skipOnTimeout, null);
}
/**
@@ -1263,7 +1263,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
*/
public void send(ClusterNode node, Object topic, Message msg, byte plc, IgniteInClosure<IgniteException> ackClosure)
throws IgniteCheckedException {
- send(node, topic, -1, msg, plc, false, 0, false, ackClosure);
+ send(node, topic, -1, msg, plc, false, false, 0, false, ackClosure);
}
/**
@@ -1279,7 +1279,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Message msg,
byte plc
) throws IgniteCheckedException {
- send(nodes, topic, -1, msg, plc, false, false, 0, false);
+ send(nodes, topic, -1, msg, plc, false, false, 0, false, null);
}
/**
@@ -1295,7 +1295,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Message msg,
byte plc
) throws IgniteCheckedException {
- send(nodes, topic, topic.ordinal(), msg, plc, false, false, 0, false);
+ send(nodes, topic, topic.ordinal(), msg, plc, false, false, 0, false, null);
}
/**
@@ -1319,7 +1319,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
) throws IgniteCheckedException {
assert timeout > 0 || skipOnTimeout;
- send(node, topic, (byte)-1, msg, plc, true, timeout, skipOnTimeout, ackClosure);
+ send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout, ackClosure);
}
/**
@@ -1508,7 +1508,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (node == null)
throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId);
- send(node, topic, (byte)-1, msg, plc, true, timeout, skipOnTimeout, ackClosure);
+ send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout, ackClosure);
}
/**
@@ -1532,7 +1532,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
boolean ordered,
boolean seq,
long timeout,
- boolean skipOnTimeout
+ boolean skipOnTimeout,
+ IgniteInClosure<IgniteException> ackClosure
) throws IgniteCheckedException {
assert nodes != null;
assert topic != null;
@@ -1547,7 +1548,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
// messages to one node vs. many.
if (!nodes.isEmpty()) {
for (ClusterNode node : nodes)
- send(node, topic, topicOrd, msg, plc, ordered, seq, timeout, skipOnTimeout, null);
+ send(node, topic, topicOrd, msg, plc, ordered, seq, timeout, skipOnTimeout, ackClosure);
}
else if (log.isDebugEnabled())
log.debug("Failed to send message to empty nodes collection [topic=" + topic + ", msg=" +
[19/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b27af71d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b27af71d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b27af71d
Branch: refs/heads/ignite-426
Commit: b27af71d81274ed351d5c43740f5c904db62adfb
Parents: 55a2fc6
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 3 16:51:53 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 3 16:51:53 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b27af71d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 9328932..4f1b887 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -2409,7 +2409,25 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
* @param nodeId Sender node ID.
* @param req Dht atomic update request.
*/
- private void processDhtAtomicUpdateRequest(UUID nodeId, GridDhtAtomicUpdateRequest req) {
+ private void processDhtAtomicUpdateRequest(final UUID nodeId, final GridDhtAtomicUpdateRequest req) {
+ IgniteInternalFuture fut = ctx.preloader().request(req.keys(), req.topologyVersion());
+
+ if (fut.isDone())
+ processDhtAtomicUpdateRequest0(nodeId, req);
+ else {
+ fut.listen(new CI1<IgniteInternalFuture>() {
+ @Override public void apply(IgniteInternalFuture future) {
+ processDhtAtomicUpdateRequest0(nodeId, req);
+ }
+ });
+ }
+ }
+
+ /**
+ * @param nodeId Sender node ID.
+ * @param req Dht atomic update request.
+ */
+ private void processDhtAtomicUpdateRequest0(UUID nodeId, GridDhtAtomicUpdateRequest req) {
if (log.isDebugEnabled())
log.debug("Processing dht atomic update request [nodeId=" + nodeId + ", req=" + req + ']');
[15/50] incubator-ignite git commit: Merge branches 'ignite-104' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-104
Posted by vk...@apache.org.
Merge branches 'ignite-104' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Conflicts:
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5cdd2440
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5cdd2440
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5cdd2440
Branch: refs/heads/ignite-426
Commit: 5cdd2440a6b9eb3c5fe0a7620202caf5cb2db441
Parents: 6c1655f 1c10ade
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Jul 31 13:38:39 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Jul 31 13:38:39 2015 -0700
----------------------------------------------------------------------
.../JettyRestProcessorAbstractSelfTest.java | 14 +-
.../managers/communication/GridIoManager.java | 110 ++++-
.../GridDhtPartitionsExchangeFuture.java | 20 +-
.../handlers/query/QueryCommandHandler.java | 6 +-
.../util/nio/GridCommunicationClient.java | 5 +-
.../util/nio/GridNioFinishedFuture.java | 12 +
.../ignite/internal/util/nio/GridNioFuture.java | 14 +
.../internal/util/nio/GridNioFutureImpl.java | 15 +
.../util/nio/GridNioRecoveryDescriptor.java | 13 +-
.../ignite/internal/util/nio/GridNioServer.java | 5 +
.../util/nio/GridNioSessionMetaKey.java | 5 +-
.../util/nio/GridShmemCommunicationClient.java | 7 +-
.../util/nio/GridTcpNioCommunicationClient.java | 14 +-
.../communication/tcp/TcpCommunicationSpi.java | 84 +++-
.../ignite/spi/discovery/tcp/ServerImpl.java | 45 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 2 +-
...CommunicationRecoveryAckClosureSelfTest.java | 464 +++++++++++++++++++
.../tcp/TcpDiscoveryMultiThreadedTest.java | 8 +-
.../IgniteSpiCommunicationSelfTestSuite.java | 1 +
.../http/jetty/GridJettyRestHandler.java | 12 +-
20 files changed, 779 insertions(+), 77 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5cdd2440/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 765ba65,7e17efc..479d116
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@@ -1059,9 -982,9 +1061,10 @@@ public class GridIoManager extends Grid
Message msg,
byte plc,
boolean ordered,
+ boolean seq,
long timeout,
- boolean skipOnTimeout
+ boolean skipOnTimeout,
+ IgniteInClosure<IgniteException> ackClosure
) throws IgniteCheckedException {
assert node != null;
assert topic != null;
@@@ -1079,10 -1002,11 +1082,13 @@@
if (ordered)
processOrderedMessage(locNodeId, ioMsg, plc, null);
+ else if (seq)
+ processSequentialMessage(locNodeId, ioMsg, plc, null);
else
processRegularMessage0(ioMsg, locNodeId);
+
+ if (ackClosure != null)
+ ackClosure.apply(null);
}
else {
if (topicOrd < 0)
@@@ -1132,7 -1059,7 +1141,7 @@@
if (node == null)
throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId);
- send(node, topic, topic.ordinal(), msg, plc, false, false, 0, false);
- send(node, topic, topic.ordinal(), msg, plc, false, 0, false, null);
++ send(node, topic, topic.ordinal(), msg, plc, false, false, 0, false, null);
}
/**
@@@ -1144,7 -1071,7 +1153,7 @@@
*/
public void send(ClusterNode node, Object topic, Message msg, byte plc)
throws IgniteCheckedException {
- send(node, topic, -1, msg, plc, false, false, 0, false);
- send(node, topic, -1, msg, plc, false, 0, false, null);
++ send(node, topic, -1, msg, plc, false, false, 0, false, null);
}
/**
@@@ -1156,7 -1083,7 +1165,7 @@@
*/
public void send(ClusterNode node, GridTopic topic, Message msg, byte plc)
throws IgniteCheckedException {
- send(node, topic, topic.ordinal(), msg, plc, false, false, 0, false);
- send(node, topic, topic.ordinal(), msg, plc, false, 0, false, null);
++ send(node, topic, topic.ordinal(), msg, plc, false, false, 0, false, null);
}
/**
@@@ -1178,7 -1105,7 +1187,7 @@@
) throws IgniteCheckedException {
assert timeout > 0 || skipOnTimeout;
- send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout);
- send(node, topic, (byte)-1, msg, plc, true, timeout, skipOnTimeout, null);
++ send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout, null);
}
/**
@@@ -1205,7 -1132,7 +1214,7 @@@
if (node == null)
throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId);
- send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout);
- send(node, topic, (byte)-1, msg, plc, true, timeout, skipOnTimeout, null);
++ send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout, null);
}
/**
@@@ -1264,47 -1217,30 +1299,71 @@@
}
/**
+ * @param node Destination node.
+ * @param topic Topic to send the message to.
+ * @param msg Message to send.
+ * @param plc Type of processing.
+ * @param timeout Timeout to keep a message on receiving queue.
+ * @param skipOnTimeout Whether message can be skipped on timeout.
+ * @param ackClosure Ack closure.
+ * @throws IgniteCheckedException Thrown in case of any errors.
+ */
+ public void sendOrderedMessage(
+ ClusterNode node,
+ Object topic,
+ Message msg,
+ byte plc,
+ long timeout,
+ boolean skipOnTimeout,
+ IgniteInClosure<IgniteException> ackClosure
+ ) throws IgniteCheckedException {
+ assert timeout > 0 || skipOnTimeout;
+
+ send(node, topic, (byte)-1, msg, plc, true, timeout, skipOnTimeout, ackClosure);
+ }
+
+ /**
+ * Sends sequential message.
+ *
+ * @param nodeId Destination node ID.
+ * @param topic Topic.
+ * @param msg Message.
+ * @param plc Policy.
+ * @throws IgniteCheckedException In case of error.
+ */
+ public void sendSequentialMessage(
+ UUID nodeId,
+ Object topic,
+ Message msg,
+ byte plc
+ ) throws IgniteCheckedException {
+ ClusterNode node = ctx.discovery().node(nodeId);
+
+ if (node == null)
+ throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId);
+
+ sendSequentialMessage(node, topic, msg, plc);
+ }
+
+ /**
+ * Sends sequential message.
+ *
+ * @param node Destination node.
+ * @param topic Topic.
+ * @param msg Message.
+ * @param plc Policy.
+ * @throws IgniteCheckedException In case of error.
+ */
+ public void sendSequentialMessage(
+ ClusterNode node,
+ Object topic,
+ Message msg,
+ byte plc
+ ) throws IgniteCheckedException {
- send(node, topic, -1, msg, plc, false, true, 0, false);
++ send(node, topic, -1, msg, plc, false, true, 0, false, null);
+ }
+
+ /**
* Sends a peer deployable user message.
*
* @param nodes Destination nodes.
@@@ -1459,7 -1422,7 +1547,7 @@@
// messages to one node vs. many.
if (!nodes.isEmpty()) {
for (ClusterNode node : nodes)
- send(node, topic, topicOrd, msg, plc, ordered, seq, timeout, skipOnTimeout);
- send(node, topic, topicOrd, msg, plc, ordered, timeout, skipOnTimeout, null);
++ send(node, topic, topicOrd, msg, plc, ordered, seq, timeout, skipOnTimeout, null);
}
else if (log.isDebugEnabled())
log.debug("Failed to send message to empty nodes collection [topic=" + topic + ", msg=" +
[31/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3be215d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3be215d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3be215d9
Branch: refs/heads/ignite-426
Commit: 3be215d941011283868b5d4ccaae2c8c6d1289df
Parents: 7d9ea01
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 18:22:30 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 18:22:30 2015 -0700
----------------------------------------------------------------------
.../IgniteCacheStoreSessionAbstractTest.java | 2 +-
.../junits/common/GridCommonAbstractTest.java | 20 +++++++++++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3be215d9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
index 7784003..c6150f8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
@@ -115,7 +115,7 @@ public abstract class IgniteCacheStoreSessionAbstractTest extends IgniteCacheAbs
* @throws Exception If failed.
*/
private void testStoreSession(IgniteCache<Object, Object> cache) throws Exception {
- Set<Integer> keys = new HashSet<>(primaryKeys(cache, 3, 100_000));
+ Set<Integer> keys = new HashSet<>(primaryKeys(cache, 3, 100_000, true));
Integer key = keys.iterator().next();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3be215d9/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 8698b4a..247a99e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -503,6 +503,17 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
* @return Collection of keys for which given cache is primary.
*/
protected List<Integer> primaryKeys(IgniteCache<?, ?> cache, int cnt, int startFrom) {
+ return primaryKeys(cache, cnt, startFrom, false);
+ }
+
+ /**
+ * @param cache Cache.
+ * @param cnt Keys count.
+ * @param startFrom Start value for keys search.
+ * @param singlePart Single partition.
+ * @return Collection of keys for which given cache is primary.
+ */
+ protected List<Integer> primaryKeys(IgniteCache<?, ?> cache, int cnt, int startFrom, boolean singlePart) {
assert cnt > 0 : cnt;
List<Integer> found = new ArrayList<>(cnt);
@@ -511,10 +522,17 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
Affinity<Integer> aff = (Affinity<Integer>)affinity(cache);
+ int part = -1;
+
for (int i = startFrom; i < startFrom + 100_000; i++) {
Integer key = i;
- if (aff.isPrimary(locNode, key)) {
+ boolean add = part == -1 ? aff.isPrimary(locNode, key) : aff.partition(key) == part;
+
+ if (add) {
+ if (singlePart)
+ part = aff.partition(key);
+
found.add(key);
if (found.size() == cnt)
[02/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/03e48ba8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/03e48ba8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/03e48ba8
Branch: refs/heads/ignite-426
Commit: 03e48ba8ccb417cfd1f512f2bd1efe6ceb6c86fa
Parents: e6f0ac3
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Jul 28 22:19:49 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Jul 28 22:19:49 2015 -0700
----------------------------------------------------------------------
.../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03e48ba8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index bb036da..7a8cc06 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1764,7 +1764,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
dhtFut.addNearWriteEntries(filteredReaders,
entry,
updRes.newValue(),
- null,
+ op == TRANSFORM ? req.entryProcessor(i) : null,
updRes.newTtl(),
updRes.conflictExpireTime());
}
[43/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/99e998a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/99e998a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/99e998a8
Branch: refs/heads/ignite-426
Commit: 99e998a8b46fc9e0ace50ac7c6c567beab69a47d
Parents: de86990e
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Aug 6 18:09:08 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Aug 6 18:09:08 2015 -0700
----------------------------------------------------------------------
.../processors/cache/GridCacheEvictionManager.java | 11 ++++++++++-
.../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 2 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 11 +++--------
.../GridCacheExpiredEntriesPreloadAbstractSelfTest.java | 2 +-
.../dht/GridCacheAtomicNearCacheSelfTest.java | 4 ++--
.../near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java | 8 ++------
6 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 55669a7..fb3639d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -740,11 +740,20 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
* @param topVer Topology version.
*/
public void touch(GridCacheEntryEx e, AffinityTopologyVersion topVer) {
+ touch(e, topVer, null);
+ }
+
+ /**
+ * @param e Entry for eviction policy notification.
+ * @param topVer Topology version.
+ * @param ver Write version.
+ */
+ public void touch(GridCacheEntryEx e, AffinityTopologyVersion topVer, @Nullable GridCacheVersion ver) {
if (e.detached() || e.isInternal())
return;
try {
- if (e.markObsoleteIfEmpty(null) || e.obsolete())
+ if (e.markObsoleteIfEmpty(ver) || e.obsolete())
e.context().cache().removeEntry(e);
}
catch (IgniteCheckedException ex) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 6949ae2..8ea4539 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -2497,7 +2497,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
finally {
if (entry != null)
- ctx.evicts().touch(entry, req.topologyVersion());
+ ctx.evicts().touch(entry, req.topologyVersion(), req.writeVersion());
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index b6348f2..fb004bf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -2317,8 +2317,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
GridCacheEntryEx entry = cctx.isNear() ? cctx.near().dht().peekEx(key) :
cctx.cache().peekEx(key);
- if (atomicityMode() != ATOMIC &&
- grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode())) {
+ if (grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode())) {
assertNotNull(entry);
assertTrue(entry.deleted());
}
@@ -3395,12 +3394,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
// Ensure that old TTL and expire time are not longer "visible".
entry = internalCache.peekEx(key);
- if (atomicityMode() == ATOMIC)
- assertNull(entry);
- else {
- assertEquals(0, entry.ttl());
- assertEquals(0, entry.expireTime());
- }
+ assertEquals(0, entry.ttl());
+ assertEquals(0, entry.expireTime());
// Ensure that next update will not pick old expire time.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
index 8b9373d..ccc9b64 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
@@ -105,7 +105,7 @@ public abstract class GridCacheExpiredEntriesPreloadAbstractSelfTest extends Gri
Collection<Event> evts = g1.events().localQuery(F.<Event>alwaysTrue(), EVT_CACHE_REBALANCE_OBJECT_LOADED);
- assertEquals("Expected all entries are preloaded.", cache1.isDhtAtomic() ? 0 : KEYS_NUM, evts.size());
+ assertEquals("Expected all entries are preloaded.", KEYS_NUM, evts.size());
boolean rmv = GridTestUtils.waitForCondition(new PAX() {
@Override public boolean applyx() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
index 6d12f5e..2d28328 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
@@ -668,7 +668,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
cache0.remove(nearKey); // Remove from grid0, this should remove readers on primary node.
for (int i = 0; i < GRID_CNT; i++)
- checkEntry(grid(i), nearKey, null, false);
+ checkEntry(grid(i), nearKey, null, i == 0);
Ignite primaryNode = G.ignite((String) aff.mapKeyToNode(nearKey).attribute(ATTR_GRID_NAME));
@@ -698,7 +698,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest {
GridCacheEntryEx nearEntry = near.peekEx(key);
- boolean expectDht = val != null && near.affinity().isPrimaryOrBackup(ignite.cluster().localNode(), key);
+ boolean expectDht = near.affinity().isPrimaryOrBackup(ignite.cluster().localNode(), key);
if (expectNear) {
assertNotNull("No near entry for: " + key + ", grid: " + ignite.name(), nearEntry);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
index 64bace5..6f8644f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
@@ -412,12 +412,8 @@ public class GridCacheNearOnlyMultiNodeFullApiSelfTest extends GridCachePartitio
GridCacheEntryEx entry = dht.peekEx(key);
- if (atomicityMode() == CacheAtomicityMode.ATOMIC)
- assertNull(entry);
- else {
- assertEquals(0, entry.ttl());
- assertEquals(0, entry.expireTime());
- }
+ assertEquals(0, entry.ttl());
+ assertEquals(0, entry.expireTime());
}
// Ensure that next update will not pick old expire time.
[32/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/19ff9a56
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/19ff9a56
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/19ff9a56
Branch: refs/heads/ignite-426
Commit: 19ff9a5688ac198f380e0373e9ff961717d13072
Parents: 3be215d
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 18:24:23 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 18:24:23 2015 -0700
----------------------------------------------------------------------
.../cache/integration/IgniteCacheLoaderWriterAbstractTest.java | 2 +-
.../ignite/testframework/junits/common/GridCommonAbstractTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/19ff9a56/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
index 4812b3b..3291bdd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoaderWriterAbstractTest.java
@@ -184,7 +184,7 @@ public abstract class IgniteCacheLoaderWriterAbstractTest extends IgniteCacheAbs
IgniteCache<Object, Object> cache = jcache(0);
- for (Object key : primaryKeys(cache, 100, 0))
+ for (Object key : primaryKeys(cache, 100, 0, true))
vals.put(key, key);
assertTrue(cache.getAll(vals.keySet()).isEmpty());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/19ff9a56/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 247a99e..f05af4b 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -524,7 +524,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
int part = -1;
- for (int i = startFrom; i < startFrom + 100_000; i++) {
+ for (int i = startFrom; i < startFrom + 1_000_000; i++) {
Integer key = i;
boolean add = part == -1 ? aff.isPrimary(locNode, key) : aff.partition(key) == part;
[34/50] incubator-ignite git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0551155b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0551155b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0551155b
Branch: refs/heads/ignite-426
Commit: 0551155bcdab86ed3409f945db15ade564a167e0
Parents: 2918882 c087be2
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 18:45:49 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 18:45:49 2015 -0700
----------------------------------------------------------------------
.../query/h2/twostep/GridMergeIndexUnsorted.java | 8 +-------
.../processors/query/h2/twostep/GridMergeTable.java | 13 +++++++------
2 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[18/50] incubator-ignite git commit: IGNITE-104 - Fixed compilation
Posted by vk...@apache.org.
IGNITE-104 - Fixed compilation
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/55a2fc6b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/55a2fc6b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/55a2fc6b
Branch: refs/heads/ignite-426
Commit: 55a2fc6b1d0e25120f8bba9827d574f5c16af221
Parents: 4150843
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 3 13:48:49 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 3 13:48:49 2015 -0700
----------------------------------------------------------------------
.../ignite/internal/managers/communication/GridIoManager.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55a2fc6b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 707e5d4..1e609e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -1121,7 +1121,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* <p>
* How to use it:
* <ol>
- * <li>Replace {@link #send(ClusterNode, Object, int, Message, byte, boolean, long, boolean, IgniteInClosure)}
+ * <li>Replace {@link #send(ClusterNode, Object, int, Message, byte, boolean, boolean, long, boolean, IgniteInClosure)}
* with this method.</li>
* <li>Start all grids for your test, then set {@link #TURBO_DEBUG_MODE} to {@code true}.</li>
* <li>Perform test operations on the topology. No network will be there.</li>
@@ -1145,6 +1145,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Message msg,
byte plc,
boolean ordered,
+ boolean seq,
long timeout,
boolean skipOnTimeout
) throws IgniteCheckedException {
@@ -1152,7 +1153,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
assert topic != null;
assert msg != null;
- GridIoMessage ioMsg = new GridIoMessage(plc, topic, topicOrd, msg, ordered, timeout, skipOnTimeout);
+ GridIoMessage ioMsg = new GridIoMessage(plc, topic, topicOrd, msg, ordered, seq, timeout, skipOnTimeout);
IgniteKernal rmt;
[27/50] incubator-ignite git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6f042aee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6f042aee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6f042aee
Branch: refs/heads/ignite-426
Commit: 6f042aeef97b1624394bca06b7659c4c835b4a89
Parents: e3ebcb9 01c3e09
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 11:26:13 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 11:26:13 2015 -0700
----------------------------------------------------------------------
.../cache/GridCacheSwapPreloadSelfTest.java | 2 +
.../query/h2/twostep/GridMergeIndex.java | 7 +++
.../h2/twostep/GridMergeIndexUnsorted.java | 23 +++++++--
.../query/h2/twostep/GridMergeTable.java | 51 ++++++++------------
.../h2/twostep/GridReduceQueryExecutor.java | 28 +----------
5 files changed, 47 insertions(+), 64 deletions(-)
----------------------------------------------------------------------
[28/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b73fa67f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b73fa67f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b73fa67f
Branch: refs/heads/ignite-426
Commit: b73fa67ffb2c86c4a09efe554bfc738a21a52d3b
Parents: 6f042ae
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 11:28:31 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 11:28:31 2015 -0700
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b73fa67f/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index aa84346..bafdfef 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -103,7 +103,7 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(IgniteClientNodeAffinityTest.class);
// Swap tests.
-// suite.addTestSuite(GridCacheSwapPreloadSelfTest.class); // TODO: IGNITE-104
+ suite.addTestSuite(GridCacheSwapPreloadSelfTest.class);
suite.addTestSuite(GridCacheSwapReloadSelfTest.class);
// Common tests.
[30/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7d9ea018
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7d9ea018
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7d9ea018
Branch: refs/heads/ignite-426
Commit: 7d9ea018b28dedaece1f71598921232829fecdb8
Parents: aeac6aa
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 18:02:46 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 18:02:46 2015 -0700
----------------------------------------------------------------------
.../processors/cache/distributed/near/GridNearAtomicCache.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d9ea018/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index b3f4a1d..2255988 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -285,8 +285,6 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
Collection<KeyCacheObject> backupKeys = req.keys();
- boolean intercept = req.forceTransformBackups() && ctx.config().getInterceptor() != null;
-
String taskName = ctx.kernalContext().task().resolveTaskName(req.taskNameHash());
for (int i = 0; i < req.nearSize(); i++) {
@@ -341,7 +339,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
expireTime,
null,
false,
- intercept,
+ /*intercept*/false,
req.subjectId(),
taskName);
[07/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/112c567c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/112c567c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/112c567c
Branch: refs/heads/ignite-426
Commit: 112c567cb780fc04a0d81c9b8b1e1f60cd2fbabf
Parents: 9781ea4
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 29 17:58:33 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 29 17:58:33 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridNearAtomicUpdateRequest.java | 48 +++++++-------------
.../atomic/GridNearAtomicUpdateResponse.java | 20 ++------
2 files changed, 20 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/112c567c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index 734cf6d..86c5ab8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -666,60 +666,54 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
writer.incrementState();
case 16:
-// if (!writer.writeInt("part", part))
-// return false;
-
- writer.incrementState();
-
- case 17:
if (!writer.writeBoolean("retval", retval))
return false;
writer.incrementState();
- case 18:
+ case 17:
if (!writer.writeBoolean("skipStore", skipStore))
return false;
writer.incrementState();
- case 19:
+ case 18:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 20:
+ case 19:
if (!writer.writeByte("syncMode", syncMode != null ? (byte)syncMode.ordinal() : -1))
return false;
writer.incrementState();
- case 21:
+ case 20:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeBoolean("topLocked", topLocked))
return false;
writer.incrementState();
- case 23:
+ case 22:
if (!writer.writeMessage("topVer", topVer))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeMessage("updateVer", updateVer))
return false;
writer.incrementState();
- case 25:
+ case 24:
if (!writer.writeCollection("vals", vals, MessageCollectionItemType.MSG))
return false;
@@ -850,14 +844,6 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
case 16:
-// part = reader.readInt("part");
-//
-// if (!reader.isLastRead())
-// return false;
-
- reader.incrementState();
-
- case 17:
retval = reader.readBoolean("retval");
if (!reader.isLastRead())
@@ -865,7 +851,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 18:
+ case 17:
skipStore = reader.readBoolean("skipStore");
if (!reader.isLastRead())
@@ -873,7 +859,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 19:
+ case 18:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -881,7 +867,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 20:
+ case 19:
byte syncModeOrd;
syncModeOrd = reader.readByte("syncMode");
@@ -893,7 +879,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 21:
+ case 20:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -901,7 +887,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 22:
+ case 21:
topLocked = reader.readBoolean("topLocked");
if (!reader.isLastRead())
@@ -909,7 +895,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 23:
+ case 22:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -917,7 +903,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 24:
+ case 23:
updateVer = reader.readMessage("updateVer");
if (!reader.isLastRead())
@@ -925,7 +911,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 25:
+ case 24:
vals = reader.readCollection("vals", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -945,7 +931,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 26;
+ return 25;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/112c567c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index 2b30536..8e1bee2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -485,18 +485,12 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
writer.incrementState();
case 12:
-// if (!writer.writeInt("part", part))
-// return false;
-
- writer.incrementState();
-
- case 13:
if (!writer.writeCollection("remapKeys", remapKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeMessage("ret", ret))
return false;
@@ -591,14 +585,6 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
reader.incrementState();
case 12:
-// part = reader.readInt("part");
-//
-// if (!reader.isLastRead())
-// return false;
-
- reader.incrementState();
-
- case 13:
remapKeys = reader.readCollection("remapKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -606,7 +592,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
reader.incrementState();
- case 14:
+ case 13:
ret = reader.readMessage("ret");
if (!reader.isLastRead())
@@ -626,7 +612,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 15;
+ return 14;
}
/** {@inheritDoc} */
[42/50] incubator-ignite git commit: Merge branches 'ignite-104' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-104
Posted by vk...@apache.org.
Merge branches 'ignite-104' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/de86990e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/de86990e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/de86990e
Branch: refs/heads/ignite-426
Commit: de86990ee3fcff825da0f156fba1de4de6f8e92a
Parents: bc39443 d9acbd1
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Aug 6 11:36:25 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Aug 6 11:36:25 2015 -0700
----------------------------------------------------------------------
assembly/release-hadoop.xml | 5 +
.../cache/query/GridCacheSqlQuery.java | 33 ++-
.../cache/query/GridCacheTwoStepQuery.java | 34 +--
.../ignite/spi/discovery/tcp/ClientImpl.java | 28 +-
.../TcpDiscoveryMulticastIpFinder.java | 7 +-
.../processors/query/h2/IgniteH2Indexing.java | 27 +-
.../processors/query/h2/sql/GridSqlElement.java | 18 +-
.../query/h2/sql/GridSqlFunction.java | 17 +-
.../processors/query/h2/sql/GridSqlQuery.java | 4 +-
.../query/h2/sql/GridSqlQueryParser.java | 94 ++++---
.../query/h2/sql/GridSqlQuerySplitter.java | 117 +++++----
.../processors/query/h2/sql/GridSqlSelect.java | 76 +++---
.../processors/query/h2/sql/GridSqlType.java | 24 +-
.../processors/query/h2/sql/GridSqlUnion.java | 2 +-
.../h2/twostep/GridReduceQueryExecutor.java | 211 ++++++---------
.../query/h2/twostep/GridThreadLocalTable.java | 262 +++++++++++++++++++
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 2 +-
.../config/benchmark-multicast.properties | 1 +
parent/pom.xml | 97 ++++---
scripts/git-apply-patch.sh | 94 -------
scripts/git-patch-functions.sh | 56 +---
21 files changed, 697 insertions(+), 512 deletions(-)
----------------------------------------------------------------------
[46/50] incubator-ignite git commit: Merge branches 'ignite-104' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-104
Posted by vk...@apache.org.
Merge branches 'ignite-104' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/455d4dc2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/455d4dc2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/455d4dc2
Branch: refs/heads/ignite-426
Commit: 455d4dc20325815f4557be12485af871dc7c1feb
Parents: 2a8b548 ae11e9b
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 10 23:59:15 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 10 23:59:15 2015 -0700
----------------------------------------------------------------------
.../configuration/IgniteConfiguration.java | 1 -
.../GridCachePartitionExchangeManager.java | 48 +++++++----
.../dht/atomic/GridDhtAtomicCache.java | 36 +++++---
.../cache/CacheStopAndDestroySelfTest.java | 87 --------------------
4 files changed, 56 insertions(+), 116 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455d4dc2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
[36/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/05b27aaa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/05b27aaa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/05b27aaa
Branch: refs/heads/ignite-426
Commit: 05b27aaae2e744212b864299ada5df2fe093d693
Parents: 1b09e15
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 22:25:46 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 22:25:46 2015 -0700
----------------------------------------------------------------------
.../distributed/IgniteCacheClientNodeChangingTopologyTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/05b27aaa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
index 3c6e5e4..72be216 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
@@ -350,7 +350,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
List<Object> msgs = spi.recordedMessages();
- assertEquals(6, msgs.size());
+ assertEquals(writeOrder == CLOCK ? 6 : 3, msgs.size());
for (Object msg : msgs)
assertTrue(((GridNearAtomicUpdateRequest)msg).clientRequest());
[04/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e5c69b83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e5c69b83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e5c69b83
Branch: refs/heads/ignite-426
Commit: e5c69b831a8f564440bd0960cc2a865cd907525a
Parents: 424ab07
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 29 14:19:24 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 29 14:19:24 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 9 ++++--
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 33 +++++++++++++++-----
.../dht/atomic/GridDhtAtomicUpdateRequest.java | 7 ++++-
3 files changed, 37 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5c69b83/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 7a8cc06..02e48df 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1178,6 +1178,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
e.printStackTrace();
}
finally {
+ if (dhtFut != null && !remap)
+ dhtFut.map();
+
if (locked != null)
unlockEntries(locked, req.topologyVersion());
@@ -1221,8 +1224,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
else {
// If there are backups, map backup update future.
if (dhtFut != null)
- dhtFut.map();
- // Otherwise, complete the call.
+ dhtFut.onMapped();
+ // Otherwise, complete the call.
else
completionCb.apply(req, res);
}
@@ -2523,7 +2526,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
catch (ClusterTopologyCheckedException ignored) {
U.warn(log, "Failed to send DHT atomic update response to node because it left grid: " +
- req.nodeId());
+ nodeId);
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to send DHT atomic update response (did node leave grid?) [nodeId=" + nodeId +
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5c69b83/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 3a68263..15ec121 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -90,6 +90,9 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
/** */
private boolean waitForExchange;
+ /** */
+ private boolean mapped;
+
/**
* @param cctx Cache context.
* @param completionCb Callback to invoke when future is completed.
@@ -349,37 +352,51 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
GridAtomicMappingKey mappingKey = e.getKey();
GridDhtAtomicUpdateRequest req = e.getValue();
+ UUID nodeId = mappingKey.nodeId();
+ int part = mappingKey.partition();
+
+ assert !nodeId.equals(cctx.localNodeId());
+
try {
if (log.isDebugEnabled())
- log.debug("Sending DHT atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
+ log.debug("Sending DHT atomic update request [nodeId=" + nodeId + ", req=" + req + ']');
- if (mappingKey.partition() >= 0) {
- Object topic = CU.partitionMessageTopic(cctx, mappingKey.partition(), false);
+ if (part >= 0) {
+ Object topic = CU.partitionMessageTopic(cctx, part, false);
- cctx.io().sendOrderedMessage(mappingKey.nodeId(), topic, req, cctx.ioPolicy(),
+ cctx.io().sendOrderedMessage(nodeId, topic, req, cctx.ioPolicy(),
2 * cctx.gridConfig().getNetworkTimeout());
}
else {
- assert mappingKey.partition() == -1;
+ assert part == -1;
- cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
+ cctx.io().send(nodeId, req, cctx.ioPolicy());
}
}
catch (ClusterTopologyCheckedException ignored) {
U.warn(log, "Failed to send update request to backup node because it left grid: " +
- req.nodeId());
+ nodeId);
mappings.remove(mappingKey);
}
catch (IgniteCheckedException ex) {
U.error(log, "Failed to send update request to backup node (did node leave the grid?): "
- + req.nodeId(), ex);
+ + nodeId, ex);
mappings.remove(mappingKey);
}
}
}
+ mapped = true;
+ }
+
+ /**
+ * On mapped callback.
+ */
+ public void onMapped() {
+ assert mapped;
+
checkComplete();
// Send response right away if no ACKs from backup is required.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5c69b83/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 35c6910..7149dec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -44,7 +44,12 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
/** Message index. */
public static final int CACHE_MSG_IDX = nextIndexId();
- /** Node ID. */
+ /**
+ * Node ID.
+ *
+ * @deprecated Not used anymore, but removal will break compatibility.
+ */
+ @Deprecated
private UUID nodeId;
/** Future version. */
[20/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8e6b90cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8e6b90cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8e6b90cf
Branch: refs/heads/ignite-426
Commit: 8e6b90cf835fe67778b961dccec0682f448f8e57
Parents: b27af71
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 3 17:57:25 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 3 17:57:25 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 6 ++
.../dht/atomic/GridNearAtomicUpdateFuture.java | 78 +++++---------------
2 files changed, 25 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e6b90cf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 4f1b887..a8dc8ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -134,6 +134,12 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
updateReplyClos = new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@Override public void apply(GridNearAtomicUpdateRequest req, GridNearAtomicUpdateResponse res) {
+ if (res.nodeId().equals(locNodeId)) {
+ processNearAtomicUpdateResponse(res.nodeId(), res);
+
+ return;
+ }
+
if (ctx.config().getAtomicWriteOrderMode() == CLOCK) {
// Always send reply in CLOCK ordering mode.
sendNearUpdateReply(res.nodeId(), res);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e6b90cf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index ff24964..5150113 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -1047,30 +1047,17 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
singleNodeId = mappingKey.nodeId();
singleReq = req;
- if (cctx.localNodeId().equals(mappingKey.nodeId())) {
- cache.updateAllAsyncInternal(mappingKey.nodeId(), req,
- new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
- @Override public void apply(GridNearAtomicUpdateRequest req,
- GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer) : futVer;
-
- onResult(res.nodeId(), res);
- }
- });
- }
- else {
- try {
- if (log.isDebugEnabled())
- log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
+ try {
+ if (log.isDebugEnabled())
+ log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
- sendRequest(mappingKey, req);
+ sendRequest(mappingKey, req);
- if (syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY)
- onDone(new GridCacheReturn(cctx, true, null, true));
- }
- catch (IgniteCheckedException e) {
- onDone(addFailedKeys(req.keys(), e));
- }
+ if (syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY)
+ onDone(new GridCacheReturn(cctx, true, null, true));
+ }
+ catch (IgniteCheckedException e) {
+ onDone(addFailedKeys(req.keys(), e));
}
}
@@ -1080,57 +1067,30 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* @param mappings Mappings to send.
*/
private void doUpdate(Map<GridAtomicMappingKey, GridNearAtomicUpdateRequest> mappings) {
- UUID locNodeId = cctx.localNodeId();
-
- Collection<GridNearAtomicUpdateRequest> locUpdates = null;
-
- // Send messages to remote nodes first, then run local update.
for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
GridAtomicMappingKey mappingKey = e.getKey();
GridNearAtomicUpdateRequest req = e.getValue();
- if (locNodeId.equals(req.nodeId())) {
- if (locUpdates == null)
- locUpdates = new ArrayList<>(mappings.size());
+ try {
+ if (log.isDebugEnabled())
+ log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
- locUpdates.add(req);
+ sendRequest(mappingKey, req);
}
- else {
- try {
- if (log.isDebugEnabled())
- log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
-
- sendRequest(mappingKey, req);
- }
- catch (IgniteCheckedException ex) {
- addFailedKeys(req.keys(), ex);
-
- removeMapping(mappingKey);
- }
+ catch (IgniteCheckedException ex) {
+ addFailedKeys(req.keys(), ex);
- if (syncMode == PRIMARY_SYNC && !req.hasPrimary())
- removeMapping(mappingKey);
+ removeMapping(mappingKey);
}
+
+ if (syncMode == PRIMARY_SYNC && !req.hasPrimary())
+ removeMapping(mappingKey);
}
if (syncMode == FULL_ASYNC)
// In FULL_ASYNC mode always return (null, true).
opRes = new GridCacheReturn(cctx, true, null, true);
- if (locUpdates != null) {
- for (GridNearAtomicUpdateRequest locUpdate : locUpdates) {
- cache.updateAllAsyncInternal(cctx.localNodeId(), locUpdate,
- new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
- @Override public void apply(GridNearAtomicUpdateRequest req,
- GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer) : futVer;
-
- onResult(res.nodeId(), res);
- }
- });
- }
- }
-
checkComplete();
}
[45/50] incubator-ignite git commit: # Fixed potential NPE in
GridCachePartitionExchangeManager.dumpPendingObjects
Posted by vk...@apache.org.
# Fixed potential NPE in GridCachePartitionExchangeManager.dumpPendingObjects
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ae11e9b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ae11e9b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ae11e9b5
Branch: refs/heads/ignite-426
Commit: ae11e9b5aa9af4d0d58e2a16dd3a3331969961df
Parents: 19fb305
Author: sboikov <sb...@gridgain.com>
Authored: Tue Aug 11 09:42:02 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Aug 11 09:42:43 2015 +0300
----------------------------------------------------------------------
.../GridCachePartitionExchangeManager.java | 32 ++++++++++++--------
1 file changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ae11e9b5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index cf49197..e00d3b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -984,25 +984,33 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
*
*/
public void dumpPendingObjects() {
- U.warn(log, "Pending transactions:");
+ IgniteTxManager tm = cctx.tm();
- for (IgniteInternalTx tx : cctx.tm().activeTransactions())
- U.warn(log, ">>> " + tx);
+ if (tm != null) {
+ U.warn(log, "Pending transactions:");
- U.warn(log, "Pending explicit locks:");
+ for (IgniteInternalTx tx : tm.activeTransactions())
+ U.warn(log, ">>> " + tx);
+ }
- for (GridCacheExplicitLockSpan lockSpan : cctx.mvcc().activeExplicitLocks())
- U.warn(log, ">>> " + lockSpan);
+ GridCacheMvccManager mvcc = cctx.mvcc();
- U.warn(log, "Pending cache futures:");
+ if (mvcc != null) {
+ U.warn(log, "Pending explicit locks:");
- for (GridCacheFuture<?> fut : cctx.mvcc().activeFutures())
- U.warn(log, ">>> " + fut);
+ for (GridCacheExplicitLockSpan lockSpan : mvcc.activeExplicitLocks())
+ U.warn(log, ">>> " + lockSpan);
- U.warn(log, "Pending atomic cache futures:");
+ U.warn(log, "Pending cache futures:");
- for (GridCacheFuture<?> fut : cctx.mvcc().atomicFutures())
- U.warn(log, ">>> " + fut);
+ for (GridCacheFuture<?> fut : mvcc.activeFutures())
+ U.warn(log, ">>> " + fut);
+
+ U.warn(log, "Pending atomic cache futures:");
+
+ for (GridCacheFuture<?> fut : mvcc.atomicFutures())
+ U.warn(log, ">>> " + fut);
+ }
}
/**
[41/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bc394436
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bc394436
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bc394436
Branch: refs/heads/ignite-426
Commit: bc394436a89c945cbca1c4f158b00f19951cf47e
Parents: 6c7358d
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Aug 5 17:05:35 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Aug 5 17:05:35 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridAtomicRequestTopic.java | 44 ++++++++++++++++----
.../dht/atomic/GridDhtAtomicCache.java | 8 ++--
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 2 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 2 +-
4 files changed, 42 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc394436/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java
index 9feb409..709f739 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java
@@ -28,13 +28,41 @@ class GridAtomicRequestTopic implements Externalizable {
private static final long serialVersionUID = 0L;
/** */
+ private static final byte NEAR_UPDATE_REQ = 1;
+
+ /** */
+ private static final byte DHT_UPDATE_REQ = 2;
+
+ /** */
private int cacheId;
/** */
private int part;
/** */
- private boolean near;
+ private byte type;
+
+ /**
+ * Near request topic.
+ *
+ * @param cacheId Cache ID.
+ * @param part Partition.
+ * @return Topic.
+ */
+ static GridAtomicRequestTopic nearUpdateRequest(int cacheId, int part) {
+ return new GridAtomicRequestTopic(cacheId, part, NEAR_UPDATE_REQ);
+ }
+
+ /**
+ * DHT request topic.
+ *
+ * @param cacheId Cache ID.
+ * @param part Partition.
+ * @return Topic.
+ */
+ static GridAtomicRequestTopic dhtUpdateRequest(int cacheId, int part) {
+ return new GridAtomicRequestTopic(cacheId, part, DHT_UPDATE_REQ);
+ }
/**
* For {@link Externalizable}.
@@ -46,12 +74,12 @@ class GridAtomicRequestTopic implements Externalizable {
/**
* @param cacheId Cache ID.
* @param part Partition.
- * @param near Near flag.
+ * @param type Type.
*/
- GridAtomicRequestTopic(int cacheId, int part, boolean near) {
+ private GridAtomicRequestTopic(int cacheId, int part, byte type) {
this.cacheId = cacheId;
this.part = part;
- this.near = near;
+ this.type = type;
}
/** {@inheritDoc} */
@@ -62,7 +90,7 @@ class GridAtomicRequestTopic implements Externalizable {
GridAtomicRequestTopic topic = (GridAtomicRequestTopic)o;
- return cacheId == topic.cacheId && part == topic.part && near == topic.near;
+ return cacheId == topic.cacheId && part == topic.part && type == topic.type;
}
/** {@inheritDoc} */
@@ -70,7 +98,7 @@ class GridAtomicRequestTopic implements Externalizable {
int res = cacheId;
res = 31 * res + part;
- res = 31 * res + (near ? 1 : 0);
+ res = 31 * res + type;
return res;
}
@@ -79,14 +107,14 @@ class GridAtomicRequestTopic implements Externalizable {
@Override public void writeExternal(ObjectOutput out) throws IOException {
out.writeInt(cacheId);
out.writeInt(part);
- out.writeBoolean(near);
+ out.writeByte(type);
}
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
cacheId = in.readInt();
part = in.readInt();
- near = in.readBoolean();
+ type = in.readByte();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc394436/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 01694d7..6949ae2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -188,7 +188,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
});
for (int part = 0; part < ctx.affinity().partitions(); part++) {
- Object nearTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, true);
+ Object nearTopic = GridAtomicRequestTopic.nearUpdateRequest(ctx.cacheId(), part);
ctx.io().addPerTopicHandler(nearTopic, new CI2<UUID, GridNearAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
@@ -196,7 +196,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
});
- Object dhtTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, false);
+ Object dhtTopic = GridAtomicRequestTopic.dhtUpdateRequest(ctx.cacheId(), part);
ctx.io().addPerTopicHandler(dhtTopic, new CI2<UUID, GridDhtAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridDhtAtomicUpdateRequest req) {
@@ -239,8 +239,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
buf.finish();
for (int part = 0; part < ctx.affinity().partitions(); part++) {
- ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, true));
- ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, false));
+ ctx.io().removePerTopicHandler(GridAtomicRequestTopic.nearUpdateRequest(ctx.cacheId(), part));
+ ctx.io().removePerTopicHandler(GridAtomicRequestTopic.dhtUpdateRequest(ctx.cacheId(), part));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc394436/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 7823a52..63edcaa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -352,7 +352,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
log.debug("Sending DHT atomic update request [nodeId=" + nodeId + ", req=" + req + ']');
if (part >= 0) {
- Object topic = new GridAtomicRequestTopic(cctx.cacheId(), part, false);
+ Object topic = GridAtomicRequestTopic.dhtUpdateRequest(cctx.cacheId(), part);
cctx.io().sendSequentialMessage(nodeId, topic, req, cctx.ioPolicy());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc394436/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 5b364a5..66f0300 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -1091,7 +1091,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
private void sendRequest(GridAtomicMappingKey mappingKey, GridNearAtomicUpdateRequest req)
throws IgniteCheckedException {
if (mappingKey.partition() >= 0) {
- Object topic = new GridAtomicRequestTopic(cctx.cacheId(), mappingKey.partition(), true);
+ Object topic = GridAtomicRequestTopic.nearUpdateRequest(cctx.cacheId(), mappingKey.partition());
cctx.io().sendSequentialMessage(mappingKey.nodeId(), topic, req, cctx.ioPolicy());
}
[22/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/25a109b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/25a109b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/25a109b3
Branch: refs/heads/ignite-426
Commit: 25a109b31e80807790d1b5e61fb3412f142d84dc
Parents: 6720885
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 3 21:31:35 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 3 21:31:35 2015 -0700
----------------------------------------------------------------------
.../managers/communication/GridIoManager.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/25a109b3/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 1e609e3..a129cbe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -1000,6 +1000,16 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
SequentialMessageSet msgSet = seqMsgs.get(msg.topic());
if (msgSet == null) {
+ if (closedTopics.contains(msg.topic())) {
+ if (log.isDebugEnabled())
+ log.debug("Ignoring message because the topic is already closed: " + msg);
+
+ if (msgC != null)
+ msgC.run();
+
+ return;
+ }
+
SequentialMessageSet old = seqMsgs.putIfAbsent(msg.topic(), msgSet = new SequentialMessageSet());
if (old != null)
@@ -1793,6 +1803,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (map != null)
msgSets = map.values();
+
+ seqMsgs.remove(topic);
}
else {
for (;;) {
@@ -1859,8 +1871,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (rmv && log.isDebugEnabled())
log.debug("Removed message listener [topic=" + topic + ", lsnr=" + lsnr + ']');
- if (lsnr instanceof ArrayListener)
- {
+ if (lsnr instanceof ArrayListener) {
for (GridMessageListener childLsnr : ((ArrayListener)lsnr).arr)
closeListener(childLsnr);
}
[03/50] incubator-ignite git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/424ab07c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/424ab07c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/424ab07c
Branch: refs/heads/ignite-426
Commit: 424ab07cb3dff8f7aeafeb1de5af1af8045145e3
Parents: 03e48ba 5288b2d
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 29 12:39:02 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 29 12:39:02 2015 -0700
----------------------------------------------------------------------
.../datastreamer/DataStreamerImpl.java | 22 ++++++++++++++++++++
.../datastreamer/DataStreamerUpdateJob.java | 20 +++++++++++++++++-
2 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[47/50] incubator-ignite git commit: Merge branches 'ignite-426' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-426
Posted by vk...@apache.org.
Merge branches 'ignite-426' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-426
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/01b5f569
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/01b5f569
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/01b5f569
Branch: refs/heads/ignite-426
Commit: 01b5f56970f2535347fc858299afcd8a566ac5ef
Parents: 9fe0a8d ae11e9b
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 11 00:02:27 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 11 00:02:27 2015 -0700
----------------------------------------------------------------------
.../GridCachePartitionExchangeManager.java | 32 ++++++++++++--------
1 file changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
[33/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/29188822
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/29188822
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/29188822
Branch: refs/heads/ignite-426
Commit: 29188822bc4154b0a6abfc4a215a5aedc5c4206b
Parents: 19ff9a5
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 18:28:58 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 18:28:58 2015 -0700
----------------------------------------------------------------------
.../cache/GridCacheAbstractFullApiSelfTest.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/29188822/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index fb004bf..b6348f2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -2317,7 +2317,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
GridCacheEntryEx entry = cctx.isNear() ? cctx.near().dht().peekEx(key) :
cctx.cache().peekEx(key);
- if (grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode())) {
+ if (atomicityMode() != ATOMIC &&
+ grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode())) {
assertNotNull(entry);
assertTrue(entry.deleted());
}
@@ -3394,8 +3395,12 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
// Ensure that old TTL and expire time are not longer "visible".
entry = internalCache.peekEx(key);
- assertEquals(0, entry.ttl());
- assertEquals(0, entry.expireTime());
+ if (atomicityMode() == ATOMIC)
+ assertNull(entry);
+ else {
+ assertEquals(0, entry.ttl());
+ assertEquals(0, entry.expireTime());
+ }
// Ensure that next update will not pick old expire time.
[12/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f187add2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f187add2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f187add2
Branch: refs/heads/ignite-426
Commit: f187add2d9e96fda1da4ea5a98940cd4663ee355
Parents: 2d16d99
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Jul 30 16:59:48 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Jul 30 16:59:48 2015 -0700
----------------------------------------------------------------------
.../distributed/dht/atomic/GridDhtAtomicCache.java | 5 +----
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 12 ------------
2 files changed, 1 insertion(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f187add2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index a010baa..19c89e7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1182,9 +1182,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
e.printStackTrace();
}
finally {
- if (dhtFut != null && !remap)
- dhtFut.map();
-
if (locked != null)
unlockEntries(locked, req.topologyVersion());
@@ -1228,7 +1225,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
else {
// If there are backups, map backup update future.
if (dhtFut != null)
- dhtFut.onMapped();
+ dhtFut.map();
// Otherwise, complete the call.
else
completionCb.apply(req, res);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f187add2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index c05f4c6..eb1b42c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -90,9 +90,6 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
/** */
private boolean waitForExchange;
- /** */
- private boolean mapped;
-
/**
* @param cctx Cache context.
* @param completionCb Callback to invoke when future is completed.
@@ -385,15 +382,6 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
}
}
- mapped = true;
- }
-
- /**
- * On mapped callback.
- */
- public void onMapped() {
- assert mapped;
-
checkComplete();
// Send response right away if no ACKs from backup is required.
[49/50] incubator-ignite git commit: Merge branch 'ignite-104' into
ignite-1191
Posted by vk...@apache.org.
Merge branch 'ignite-104' into ignite-1191
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b0bdf04a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b0bdf04a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b0bdf04a
Branch: refs/heads/ignite-426
Commit: b0bdf04a6f49c92c2bac8c00290f70535ae410ec
Parents: 2f10184 455d4dc
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 11 00:25:10 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 11 00:25:10 2015 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------
[17/50] incubator-ignite git commit: Merge branches 'ignite-104' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-104
Posted by vk...@apache.org.
Merge branches 'ignite-104' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/41508437
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/41508437
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/41508437
Branch: refs/heads/ignite-426
Commit: 41508437206d74e5cd5c3269883a876ca257300a
Parents: 6b52a23 b056a73
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Aug 3 13:42:41 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Aug 3 13:42:41 2015 -0700
----------------------------------------------------------------------
.../ClientAbstractMultiNodeSelfTest.java | 4 +-
.../apache/ignite/IgniteSystemProperties.java | 2 +-
.../store/jdbc/CacheAbstractJdbcStore.java | 21 ++-
.../apache/ignite/internal/IgniteKernal.java | 2 +-
.../org/apache/ignite/internal/IgnitionEx.java | 43 +++---
.../managers/communication/GridIoManager.java | 84 +++++++++++-
.../processors/cache/GridCacheMvccManager.java | 73 ++---------
.../processors/cache/GridCacheProcessor.java | 2 +-
.../processors/cache/GridCacheProxyImpl.java | 42 +++---
.../processors/cache/GridCacheSwapManager.java | 2 +-
.../distributed/near/GridNearGetFuture.java | 20 +--
.../ignite/internal/util/IgniteUtils.java | 16 +++
.../ignite/spi/discovery/tcp/ClientImpl.java | 2 +-
.../src/test/config/io-manager-benchmark.xml | 3 +-
.../GridJobMasterLeaveAwareSelfTest.java | 10 +-
.../IgniteClientReconnectAbstractTest.java | 5 +-
.../IgniteClientReconnectCacheTest.java | 5 +-
.../GridDeploymentMessageCountSelfTest.java | 5 +-
.../cache/CacheStopAndDestroySelfTest.java | 8 +-
.../GridCacheAtomicMessageCountSelfTest.java | 6 +-
.../processors/cache/GridCacheMvccSelfTest.java | 1 -
...ridCacheReplicatedSynchronousCommitTest.java | 5 +-
.../IgniteCacheAbstractStopBusySelfTest.java | 6 +-
.../cache/IgniteCacheNearLockValueSelfTest.java | 6 +-
...eDynamicCacheStartNoExchangeTimeoutTest.java | 4 +-
.../cache/IgniteTxReentryAbstractSelfTest.java | 5 +-
...niteCacheClientNodeChangingTopologyTest.java | 6 +-
...teCacheClientNodePartitionsExchangeTest.java | 4 +-
.../IgniteCacheNearOffheapGetSelfTest.java | 131 +++++++++++++++++++
...xOriginatingNodeFailureAbstractSelfTest.java | 6 +-
...cOriginatingNodeFailureAbstractSelfTest.java | 6 +-
.../GridCacheDhtPreloadMessageCountTest.java | 5 +-
...ePrimaryNodeFailureRecoveryAbstractTest.java | 6 +-
...eAtomicInvalidPartitionHandlingSelfTest.java | 5 +-
.../near/IgniteCacheNearTxRollbackTest.java | 6 +-
.../GridCacheReplicatedInvalidateSelfTest.java | 6 +-
.../testsuites/IgniteCacheTestSuite2.java | 1 +
.../ignite/util/TestTcpCommunicationSpi.java | 6 +-
...CacheScanPartitionQueryFallbackSelfTest.java | 15 ++-
.../parser/dialect/OracleMetadataDialect.java | 4 +-
.../src/test/java/config/ignite-test-config.xml | 43 ++++++
.../ignite/internal/GridFactorySelfTest.java | 9 ++
.../visor/commands/kill/VisorKillCommand.scala | 2 +-
43 files changed, 465 insertions(+), 178 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/41508437/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
[50/50] incubator-ignite git commit: Merge branch 'ignite-1191' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-426
Posted by vk...@apache.org.
Merge branch 'ignite-1191' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-426
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fa494ff1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fa494ff1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fa494ff1
Branch: refs/heads/ignite-426
Commit: fa494ff1c44616aa20cb75aa5b6704cfbe1efd36
Parents: 01b5f56 b0bdf04
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 11 00:26:25 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 11 00:26:25 2015 -0700
----------------------------------------------------------------------
.../ignite/codegen/MessageCodeGenerator.java | 8 +
.../org/apache/ignite/internal/GridTopic.java | 2 +-
.../IgniteLocalNodeStoppedException.java | 55 +++++
.../managers/communication/GridIoManager.java | 247 +++++++++++++++++--
.../managers/communication/GridIoMessage.java | 48 +++-
.../cache/GridCacheEvictionManager.java | 11 +-
.../processors/cache/GridCacheIoManager.java | 132 ++++++++--
.../processors/cache/GridCacheMapEntry.java | 12 +-
.../processors/cache/GridCacheMvccManager.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 15 +-
.../dht/atomic/GridAtomicMappingKey.java | 86 +++++++
.../dht/atomic/GridAtomicRequestTopic.java | 124 ++++++++++
.../dht/atomic/GridDhtAtomicCache.java | 128 ++++++----
.../GridDhtAtomicDeferredUpdateResponse.java | 32 ++-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 95 ++++---
.../dht/atomic/GridDhtAtomicUpdateRequest.java | 81 +++---
.../dht/atomic/GridDhtAtomicUpdateResponse.java | 33 ++-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 238 +++++++++---------
.../dht/atomic/GridNearAtomicUpdateRequest.java | 63 +++--
.../atomic/GridNearAtomicUpdateResponse.java | 34 ++-
.../preloader/GridDhtPartitionDemandPool.java | 15 +-
.../distributed/near/GridNearAtomicCache.java | 32 ++-
.../query/GridCacheDistributedQueryManager.java | 8 +-
.../resources/META-INF/classnames.properties | 3 +-
.../GridCacheAbstractRemoveFailureTest.java | 6 +-
.../GridCacheTransformEventSelfTest.java | 14 +-
...niteCacheClientNodeChangingTopologyTest.java | 4 +-
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 2 -
.../IgniteCacheLoaderWriterAbstractTest.java | 2 +-
.../IgniteCacheStoreSessionAbstractTest.java | 2 +-
.../junits/common/GridCommonAbstractTest.java | 22 +-
31 files changed, 1197 insertions(+), 359 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fa494ff1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fa494ff1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
[08/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/aa11f644
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/aa11f644
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/aa11f644
Branch: refs/heads/ignite-426
Commit: aa11f6446f14174e0ca4e67b85b1403ec6ed7016
Parents: 112c567
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 29 18:01:36 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 29 18:01:36 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridAtomicMappingKey.java | 86 -------------------
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 87 +++++++++++++++++---
2 files changed, 75 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa11f644/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java
deleted file mode 100644
index 52e3c7f..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java
+++ /dev/null
@@ -1,86 +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.distributed.dht.atomic;
-
-import org.apache.ignite.internal.util.typedef.internal.*;
-
-import java.util.*;
-
-/**
- * Mapping Key.
- */
-class GridAtomicMappingKey {
- /** Node ID. */
- private final UUID nodeId;
-
- /** Partition. */
- private final int part;
-
- /**
- * @param nodeId Node ID.
- * @param part Partition.
- */
- GridAtomicMappingKey(UUID nodeId, int part) {
- assert nodeId != null;
- assert part >= -1 : part;
-
- this.nodeId = nodeId;
- this.part = part;
- }
-
- /**
- * @return Node ID.
- */
- UUID nodeId() {
- return nodeId;
- }
-
- /**
- * @return Partition.
- */
- int partition() {
- return part;
- }
-
- /** {@inheritDoc} */
- @Override public boolean equals(Object o) {
- if (this == o)
- return true;
-
- if (o == null || getClass() != o.getClass())
- return false;
-
- GridAtomicMappingKey key = (GridAtomicMappingKey)o;
-
- return nodeId.equals(key.nodeId) && part == key.part;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- int res = nodeId.hashCode();
-
- res = 31 * res + part;
-
- return res;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridAtomicMappingKey.class, this);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa11f644/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 8595dc7..93c20da 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -73,7 +73,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
/** Mappings. */
@GridToStringInclude
- private ConcurrentMap<GridAtomicMappingKey, GridDhtAtomicUpdateRequest> mappings = new ConcurrentHashMap8<>();
+ private ConcurrentMap<MappingKey, GridDhtAtomicUpdateRequest> mappings = new ConcurrentHashMap8<>();
/** Entries with readers. */
private Map<KeyCacheObject, GridDhtCacheEntry> nearReadersEntries;
@@ -142,8 +142,8 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
/** {@inheritDoc} */
@Override public Collection<? extends ClusterNode> nodes() {
- return F.view(F.viewReadOnly(mappings.keySet(), new C1<GridAtomicMappingKey, ClusterNode>() {
- @Override public ClusterNode apply(GridAtomicMappingKey mappingKey) {
+ return F.view(F.viewReadOnly(mappings.keySet(), new C1<MappingKey, ClusterNode>() {
+ @Override public ClusterNode apply(MappingKey mappingKey) {
return cctx.kernalContext().discovery().node(mappingKey.nodeId());
}
}), F.notNull());
@@ -154,15 +154,15 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
if (log.isDebugEnabled())
log.debug("Processing node leave event [fut=" + this + ", nodeId=" + nodeId + ']');
- Collection<GridAtomicMappingKey> mappingKeys = new ArrayList<>(mappings.size());
+ Collection<MappingKey> mappingKeys = new ArrayList<>(mappings.size());
- for (GridAtomicMappingKey mappingKey : mappings.keySet()) {
+ for (MappingKey mappingKey : mappings.keySet()) {
if (mappingKey.nodeId().equals(nodeId))
mappingKeys.add(mappingKey);
}
if (!mappingKeys.isEmpty()) {
- for (GridAtomicMappingKey mappingKey : mappingKeys)
+ for (MappingKey mappingKey : mappingKeys)
mappings.remove(mappingKey);
checkComplete();
@@ -234,7 +234,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
for (ClusterNode node : dhtNodes) {
UUID nodeId = node.id();
- GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, part);
+ MappingKey mappingKey = new MappingKey(nodeId, part);
if (!nodeId.equals(cctx.localNodeId())) {
GridDhtAtomicUpdateRequest updateReq = mappings.get(mappingKey);
@@ -287,7 +287,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
int part = cctx.config().isAtomicOrderedUpdates() ? entry.partition() : -1;
for (UUID nodeId : readers) {
- GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, part);
+ MappingKey mappingKey = new MappingKey(nodeId, part);
GridDhtAtomicUpdateRequest updateReq = mappings.get(mappingKey);
@@ -345,8 +345,8 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
*/
public void map() {
if (!mappings.isEmpty()) {
- for (Map.Entry<GridAtomicMappingKey, GridDhtAtomicUpdateRequest> e : mappings.entrySet()) {
- GridAtomicMappingKey mappingKey = e.getKey();
+ for (Map.Entry<MappingKey, GridDhtAtomicUpdateRequest> e : mappings.entrySet()) {
+ MappingKey mappingKey = e.getKey();
GridDhtAtomicUpdateRequest req = e.getValue();
UUID nodeId = mappingKey.nodeId();
@@ -429,7 +429,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
}
}
- mappings.remove(new GridAtomicMappingKey(nodeId, updateRes.partition()));
+ mappings.remove(new MappingKey(nodeId, updateRes.partition()));
checkComplete();
}
@@ -445,7 +445,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
log.debug("Received deferred DHT atomic update future result [nodeId=" + nodeId + ']');
for (Integer part : res.partitions())
- mappings.remove(new GridAtomicMappingKey(nodeId, part));
+ mappings.remove(new MappingKey(nodeId, part));
checkComplete();
}
@@ -468,4 +468,67 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
return S.toString(GridDhtAtomicUpdateFuture.class, this);
}
+ /**
+ * Mapping Key.
+ */
+ private static class MappingKey {
+ /** Node ID. */
+ private final UUID nodeId;
+
+ /** Partition. */
+ private final int part;
+
+ /**
+ * @param nodeId Node ID.
+ * @param part Partition.
+ */
+ MappingKey(UUID nodeId, int part) {
+ assert nodeId != null;
+ assert part >= -1 : part;
+
+ this.nodeId = nodeId;
+ this.part = part;
+ }
+
+ /**
+ * @return Node ID.
+ */
+ UUID nodeId() {
+ return nodeId;
+ }
+
+ /**
+ * @return Partition.
+ */
+ int partition() {
+ return part;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ MappingKey key = (MappingKey)o;
+
+ return nodeId.equals(key.nodeId) && part == key.part;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ int res = nodeId.hashCode();
+
+ res = 31 * res + part;
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(MappingKey.class, this);
+ }
+ }
}
[11/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2d16d99f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2d16d99f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2d16d99f
Branch: refs/heads/ignite-426
Commit: 2d16d99f64fdfbff591124abcb4c5d42ac29d8bf
Parents: dad4691
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Jul 30 16:48:30 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Jul 30 16:48:30 2015 -0700
----------------------------------------------------------------------
.../ignite/codegen/MessageCodeGenerator.java | 2 +
.../org/apache/ignite/internal/GridTopic.java | 83 --------
.../managers/communication/GridIoManager.java | 199 ++++++++++++++++++-
.../managers/communication/GridIoMessage.java | 48 +++--
.../processors/cache/GridCacheIoManager.java | 99 +++++++--
.../processors/cache/GridCacheUtils.java | 11 -
.../dht/atomic/GridAtomicMappingKey.java | 86 ++++++++
.../dht/atomic/GridAtomicRequestTopic.java | 96 +++++++++
.../dht/atomic/GridDhtAtomicCache.java | 33 ++-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 89 ++-------
.../dht/atomic/GridNearAtomicUpdateFuture.java | 172 +++++++++++-----
.../dht/atomic/GridNearAtomicUpdateRequest.java | 63 ++++--
.../atomic/GridNearAtomicUpdateResponse.java | 36 +++-
.../preloader/GridDhtPartitionDemandPool.java | 15 +-
.../query/GridCacheDistributedQueryManager.java | 8 +-
.../resources/META-INF/classnames.properties | 2 +-
16 files changed, 730 insertions(+), 312 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
index c560118..2510d65 100644
--- a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
+++ b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
@@ -142,6 +142,8 @@ public class MessageCodeGenerator {
MessageCodeGenerator gen = new MessageCodeGenerator(srcDir);
+// gen.generateAndWrite(GridIoMessage.class);
+
// gen.generateAndWrite(GridNearAtomicUpdateRequest.class);
// gen.generateAndWrite(GridNearAtomicUpdateResponse.class);
// gen.generateAndWrite(GridDhtAtomicUpdateRequest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
index e9da40c..56aea1e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
@@ -183,15 +183,6 @@ public enum GridTopic {
}
/**
- * @param id1 ID1.
- * @param id2 ID2.
- * @return Grid message topic with specified IDs.
- */
- public Object topic(int id1, int id2) {
- return new T9(this, id1, id2);
- }
-
- /**
*
*/
private static class T1 implements Externalizable {
@@ -765,78 +756,4 @@ public enum GridTopic {
return S.toString(T8.class, this);
}
}
-
- /**
- */
- private static class T9 implements Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private GridTopic topic;
-
- /** */
- private int id1;
-
- /** */
- private int id2;
-
- /**
- * No-arg constructor needed for {@link Serializable}.
- */
- public T9() {
- // No-op.
- }
-
- /**
- * @param topic Topic.
- * @param id1 ID1.
- * @param id2 ID2.
- */
- private T9(GridTopic topic, int id1, int id2) {
- this.topic = topic;
- this.id1 = id1;
- this.id2 = id2;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- int res = topic.ordinal();
-
- res += 31 * res + id1;
- res += 31 * res + id2;
-
- return res;
- }
-
- /** {@inheritDoc} */
- @Override public boolean equals(Object obj) {
- if (obj.getClass() == T9.class) {
- T9 that = (T9)obj;
-
- return topic == that.topic && id1 == that.id1 && id2 == that.id2;
- }
-
- return false;
- }
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- out.writeByte(topic.ordinal());
- out.writeInt(id1);
- out.writeInt(id2);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- topic = fromOrdinal(in.readByte());
- id1 = in.readInt();
- id2 = in.readInt();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(T9.class, this);
- }
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index c1fb79a..765ba65 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -100,6 +100,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
private final ConcurrentMap<Object, ConcurrentMap<UUID, GridCommunicationMessageSet>> msgSetMap =
new ConcurrentHashMap8<>();
+ /** */
+ private final ConcurrentMap<Object, SequentialMessageSet> seqMsgs = new ConcurrentHashMap8<>();
+
/** Local node ID. */
private final UUID locNodeId;
@@ -576,6 +579,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
{
if (msg.isOrdered())
processOrderedMessage(nodeId, msg, plc, msgC);
+ else if (msg.isSequential())
+ processSequentialMessage(nodeId, msg, plc, msgC);
else
processRegularMessage(nodeId, msg, plc, msgC);
@@ -591,6 +596,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (msg.isOrdered())
processOrderedMessage(nodeId, msg, plc, msgC);
+ else if (msg.isSequential())
+ processSequentialMessage(nodeId, msg, plc, msgC);
else
processRegularMessage(nodeId, msg, plc, msgC);
}
@@ -963,6 +970,78 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
}
/**
+ * @param nodeId Node ID.
+ * @param msg Message.
+ * @param plc Execution policy.
+ * @param msgC Closure to call when message processing finished.
+ */
+ private void processSequentialMessage(
+ final UUID nodeId,
+ final GridIoMessage msg,
+ byte plc,
+ final IgniteRunnable msgC
+ ) throws IgniteCheckedException {
+ final GridMessageListener lsnr = lsnrMap.get(msg.topic());
+
+ if (lsnr == null) {
+ if (log.isDebugEnabled())
+ log.debug("Ignoring message because listener is not found: " + msg);
+
+ if (msgC != null)
+ msgC.run();
+
+ return;
+ }
+
+ SequentialMessageSet msgSet = seqMsgs.get(msg.topic());
+
+ if (msgSet == null) {
+ SequentialMessageSet old = seqMsgs.putIfAbsent(msg.topic(), msgSet = new SequentialMessageSet());
+
+ if (old != null)
+ msgSet = old;
+ }
+
+ msgSet.add(nodeId, msg, msgC);
+
+ if (msgC == null) {
+ assert locNodeId.equals(nodeId);
+
+ msgSet.unwind(lsnr);
+ }
+ else {
+ assert !locNodeId.equals(nodeId);
+
+ final SequentialMessageSet msgSet0 = msgSet;
+
+ Runnable c = new Runnable() {
+ @Override public void run() {
+ try {
+ threadProcessingMessage(true);
+
+ msgSet0.unwind(lsnr);
+ }
+ finally {
+ threadProcessingMessage(false);
+ }
+ }
+ };
+
+ try {
+ pool(plc).execute(c);
+ }
+ catch (RejectedExecutionException e) {
+ U.error(log, "Failed to process sequential message due to execution rejection. " +
+ "Increase the upper bound on executor service provided by corresponding " +
+ "configuration property. Will attempt to process message in the listener " +
+ "thread instead [msgPlc=" + plc + ']', e);
+
+ c.run();
+ }
+ }
+ }
+
+ /**
* @param node Destination node.
* @param topic Topic to send the message to.
* @param topicOrd GridTopic enumeration ordinal.
@@ -980,6 +1059,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Message msg,
byte plc,
boolean ordered,
+ boolean seq,
long timeout,
boolean skipOnTimeout
) throws IgniteCheckedException {
@@ -987,7 +1067,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
assert topic != null;
assert msg != null;
- GridIoMessage ioMsg = new GridIoMessage(plc, topic, topicOrd, msg, ordered, timeout, skipOnTimeout);
+ GridIoMessage ioMsg = new GridIoMessage(plc, topic, topicOrd, msg, ordered, seq, timeout, skipOnTimeout);
if (locNodeId.equals(node.id())) {
assert plc != P2P_POOL;
@@ -999,6 +1079,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (ordered)
processOrderedMessage(locNodeId, ioMsg, plc, null);
+ else if (seq)
+ processSequentialMessage(locNodeId, ioMsg, plc, null);
else
processRegularMessage0(ioMsg, locNodeId);
}
@@ -1050,7 +1132,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (node == null)
throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId);
- send(node, topic, topic.ordinal(), msg, plc, false, 0, false);
+ send(node, topic, topic.ordinal(), msg, plc, false, false, 0, false);
}
/**
@@ -1062,7 +1144,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
*/
public void send(ClusterNode node, Object topic, Message msg, byte plc)
throws IgniteCheckedException {
- send(node, topic, -1, msg, plc, false, 0, false);
+ send(node, topic, -1, msg, plc, false, false, 0, false);
}
/**
@@ -1074,7 +1156,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
*/
public void send(ClusterNode node, GridTopic topic, Message msg, byte plc)
throws IgniteCheckedException {
- send(node, topic, topic.ordinal(), msg, plc, false, 0, false);
+ send(node, topic, topic.ordinal(), msg, plc, false, false, 0, false);
}
/**
@@ -1096,7 +1178,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
) throws IgniteCheckedException {
assert timeout > 0 || skipOnTimeout;
- send(node, topic, (byte)-1, msg, plc, true, timeout, skipOnTimeout);
+ send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout);
}
/**
@@ -1123,7 +1205,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (node == null)
throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId);
- send(node, topic, (byte)-1, msg, plc, true, timeout, skipOnTimeout);
+ send(node, topic, (byte)-1, msg, plc, true, false, timeout, skipOnTimeout);
}
/**
@@ -1146,7 +1228,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
throws IgniteCheckedException {
assert timeout > 0 || skipOnTimeout;
- send(nodes, topic, -1, msg, plc, true, timeout, skipOnTimeout);
+ send(nodes, topic, -1, msg, plc, true, false, timeout, skipOnTimeout);
}
/**
@@ -1162,7 +1244,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Message msg,
byte plc
) throws IgniteCheckedException {
- send(nodes, topic, -1, msg, plc, false, 0, false);
+ send(nodes, topic, -1, msg, plc, false, false, 0, false);
}
/**
@@ -1178,7 +1260,48 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Message msg,
byte plc
) throws IgniteCheckedException {
- send(nodes, topic, topic.ordinal(), msg, plc, false, 0, false);
+ send(nodes, topic, topic.ordinal(), msg, plc, false, false, 0, false);
+ }
+
+ /**
+ * Sends sequential message.
+ *
+ * @param nodeId Destination node ID.
+ * @param topic Topic.
+ * @param msg Message.
+ * @param plc Policy.
+ * @throws IgniteCheckedException In case of error.
+ */
+ public void sendSequentialMessage(
+ UUID nodeId,
+ Object topic,
+ Message msg,
+ byte plc
+ ) throws IgniteCheckedException {
+ ClusterNode node = ctx.discovery().node(nodeId);
+
+ if (node == null)
+ throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId);
+
+ sendSequentialMessage(node, topic, msg, plc);
+ }
+
+ /**
+ * Sends sequential message.
+ *
+ * @param node Destination node.
+ * @param topic Topic.
+ * @param msg Message.
+ * @param plc Policy.
+ * @throws IgniteCheckedException In case of error.
+ */
+ public void sendSequentialMessage(
+ ClusterNode node,
+ Object topic,
+ Message msg,
+ byte plc
+ ) throws IgniteCheckedException {
+ send(node, topic, -1, msg, plc, false, true, 0, false);
}
/**
@@ -1307,6 +1430,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param msg Message to send.
* @param plc Type of processing.
* @param ordered Ordered flag.
+ * @param seq Sequential message flag.
* @param timeout Message timeout.
* @param skipOnTimeout Whether message can be skipped in timeout.
* @throws IgniteCheckedException Thrown in case of any errors.
@@ -1318,6 +1442,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Message msg,
byte plc,
boolean ordered,
+ boolean seq,
long timeout,
boolean skipOnTimeout
) throws IgniteCheckedException {
@@ -1334,7 +1459,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
// messages to one node vs. many.
if (!nodes.isEmpty()) {
for (ClusterNode node : nodes)
- send(node, topic, topicOrd, msg, plc, ordered, timeout, skipOnTimeout);
+ send(node, topic, topicOrd, msg, plc, ordered, seq, timeout, skipOnTimeout);
}
else if (log.isDebugEnabled())
log.debug("Failed to send message to empty nodes collection [topic=" + topic + ", msg=" +
@@ -2216,4 +2341,58 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
return S.toString(DelayedMessage.class, this, super.toString());
}
}
+
+ /**
+ */
+ private static class SequentialMessageSet {
+ /** */
+ private final Queue<GridTuple3<UUID, GridIoMessage, IgniteRunnable>> queue = new ConcurrentLinkedDeque8<>();
+
+ /** */
+ private final AtomicBoolean reserve = new AtomicBoolean();
+
+ /**
+ * @param nodeId Node ID.
+ * @param msg Message.
+ * @param msgC Closure to call when message processing finished.
+ */
+ void add(UUID nodeId, GridIoMessage msg, IgniteRunnable msgC) {
+ queue.add(F.t(nodeId, msg, msgC));
+ }
+
+ /**
+ * @param lsnr Message listener.
+ */
+ void unwind(GridMessageListener lsnr) {
+ assert lsnr != null;
+
+ while (true) {
+ if (reserve.compareAndSet(false, true)) {
+ try {
+ GridTuple3<UUID, GridIoMessage, IgniteRunnable> t;
+
+ while ((t = queue.poll()) != null) {
+ try {
+ lsnr.onMessage(t.get1(), t.get2().message());
+ }
+ finally {
+ IgniteRunnable msgC = t.get3();
+
+ if (msgC != null)
+ msgC.run();
+ }
+ }
+ }
+ finally {
+ reserve.set(false);
+ }
+
+ if (queue.isEmpty())
+ return;
+ }
+ else
+ return;
+ }
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
index 6cf1ae5..d729f75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
@@ -49,6 +49,9 @@ public class GridIoMessage implements Message {
/** Message ordered flag. */
private boolean ordered;
+ /** Sequential message flag. */
+ private boolean seq;
+
/** Message timeout. */
private long timeout;
@@ -72,6 +75,7 @@ public class GridIoMessage implements Message {
* @param topicOrd Topic ordinal value.
* @param msg Message.
* @param ordered Message ordered flag.
+ * @param seq Sequential message flag.
* @param timeout Timeout.
* @param skipOnTimeout Whether message can be skipped on timeout.
*/
@@ -81,18 +85,21 @@ public class GridIoMessage implements Message {
int topicOrd,
Message msg,
boolean ordered,
+ boolean seq,
long timeout,
boolean skipOnTimeout
) {
assert topic != null;
assert topicOrd <= Byte.MAX_VALUE;
assert msg != null;
+ assert !ordered || !seq; // Message can't be ordered and sequential at the same time.
this.plc = plc;
this.msg = msg;
this.topic = topic;
this.topicOrd = topicOrd;
this.ordered = ordered;
+ this.seq = seq;
this.timeout = timeout;
this.skipOnTimeout = skipOnTimeout;
}
@@ -167,6 +174,13 @@ public class GridIoMessage implements Message {
return ordered;
}
+ /**
+ * @return Sequential message flag.
+ */
+ boolean isSequential() {
+ return seq;
+ }
+
/** {@inheritDoc} */
@Override public boolean equals(Object obj) {
throw new AssertionError();
@@ -208,24 +222,30 @@ public class GridIoMessage implements Message {
writer.incrementState();
case 3:
- if (!writer.writeBoolean("skipOnTimeout", skipOnTimeout))
+ if (!writer.writeBoolean("seq", seq))
return false;
writer.incrementState();
case 4:
- if (!writer.writeLong("timeout", timeout))
+ if (!writer.writeBoolean("skipOnTimeout", skipOnTimeout))
return false;
writer.incrementState();
case 5:
- if (!writer.writeByteArray("topicBytes", topicBytes))
+ if (!writer.writeLong("timeout", timeout))
return false;
writer.incrementState();
case 6:
+ if (!writer.writeByteArray("topicBytes", topicBytes))
+ return false;
+
+ writer.incrementState();
+
+ case 7:
if (!writer.writeInt("topicOrd", topicOrd))
return false;
@@ -261,19 +281,15 @@ public class GridIoMessage implements Message {
reader.incrementState();
case 2:
- byte plc0;
-
- plc0 = reader.readByte("plc");
+ plc = reader.readByte("plc");
if (!reader.isLastRead())
return false;
- plc = plc0;
-
reader.incrementState();
case 3:
- skipOnTimeout = reader.readBoolean("skipOnTimeout");
+ seq = reader.readBoolean("seq");
if (!reader.isLastRead())
return false;
@@ -281,7 +297,7 @@ public class GridIoMessage implements Message {
reader.incrementState();
case 4:
- timeout = reader.readLong("timeout");
+ skipOnTimeout = reader.readBoolean("skipOnTimeout");
if (!reader.isLastRead())
return false;
@@ -289,7 +305,7 @@ public class GridIoMessage implements Message {
reader.incrementState();
case 5:
- topicBytes = reader.readByteArray("topicBytes");
+ timeout = reader.readLong("timeout");
if (!reader.isLastRead())
return false;
@@ -297,6 +313,14 @@ public class GridIoMessage implements Message {
reader.incrementState();
case 6:
+ topicBytes = reader.readByteArray("topicBytes");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 7:
topicOrd = reader.readInt("topicOrd");
if (!reader.isLastRead())
@@ -316,7 +340,7 @@ public class GridIoMessage implements Message {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 7;
+ return 8;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 5858424..490a5d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -62,8 +62,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
private ConcurrentMap<ListenerKey, IgniteBiInClosure<UUID, GridCacheMessage>>
clsHandlers = new ConcurrentHashMap8<>();
- /** Ordered handler registry. */
- private ConcurrentMap<Object, IgniteBiInClosure<UUID, ? extends GridCacheMessage>> orderedHandlers =
+ /** Per topic handler registry. */
+ private ConcurrentMap<Object, IgniteBiInClosure<UUID, ? extends GridCacheMessage>> perTopicHandlers =
new ConcurrentHashMap8<>();
/** Stopping flag. */
@@ -173,7 +173,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
@Override protected void onKernalStop0(boolean cancel) {
cctx.gridIO().removeMessageListener(TOPIC_CACHE);
- for (Object ordTopic : orderedHandlers.keySet())
+ for (Object ordTopic : perTopicHandlers.keySet())
cctx.gridIO().removeMessageListener(ordTopic);
boolean interrupted = false;
@@ -394,7 +394,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(
ctx.cacheId(),
nodeId,
- req.futureVersion());
+ req.futureVersion(),
+ req.partition());
res.error(req.classError());
@@ -813,6 +814,64 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
/**
+ * @param nodeId Destination node ID.
+ * @param topic Topic to send the message to.
+ * @param msg Message to send.
+ * @param plc IO policy.
+ * @throws IgniteCheckedException Thrown in case of any errors.
+ */
+ public void sendSequentialMessage(UUID nodeId, Object topic, GridCacheMessage msg, byte plc)
+ throws IgniteCheckedException {
+ ClusterNode n = cctx.discovery().node(nodeId);
+
+ if (n == null)
+ throw new ClusterTopologyCheckedException("Failed to send message because node left grid [nodeId=" +
+ nodeId + ", msg=" + msg + ']');
+
+ sendSequentialMessage(n, topic, msg, plc);
+ }
+
+ /**
+ * @param node Destination node.
+ * @param topic Topic to send the message to.
+ * @param msg Message to send.
+ * @param plc IO policy.
+ * @throws IgniteCheckedException Thrown in case of any errors.
+ */
+ public void sendSequentialMessage(ClusterNode node, Object topic, GridCacheMessage msg, byte plc)
+ throws IgniteCheckedException {
+ onSend(msg, node.id());
+
+ int cnt = 0;
+
+ while (cnt <= retryCnt) {
+ try {
+ cnt++;
+
+ cctx.gridIO().sendSequentialMessage(node, topic, msg, plc);
+
+ if (log.isDebugEnabled())
+ log.debug("Sent sequential cache message [topic=" + topic + ", msg=" + msg +
+ ", nodeId=" + node.id() + ']');
+
+ return;
+ }
+ catch (IgniteCheckedException e) {
+ if (cctx.discovery().node(node.id()) == null)
+ throw new ClusterTopologyCheckedException("Node left grid while sending sequential message [" +
+ "nodeId=" + node.id() + ", msg=" + msg + ']', e);
+
+ if (cnt == retryCnt)
+ throw e;
+ else if (log.isDebugEnabled())
+ log.debug("Failed to send message to node (will retry): " + node.id());
+ }
+
+ U.sleep(retryDelay);
+ }
+ }
+
+ /**
* @return ID that auto-grows based on local counter and counters received
* from other nodes.
*/
@@ -940,39 +999,39 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
/**
- * Adds ordered message handler.
+ * Adds per topic message handler.
*
* @param topic Topic.
* @param c Handler.
*/
@SuppressWarnings({"unchecked"})
- public void addOrderedHandler(Object topic, IgniteBiInClosure<UUID, ? extends GridCacheMessage> c) {
- if (orderedHandlers.putIfAbsent(topic, c) == null) {
- cctx.gridIO().addMessageListener(topic, new OrderedMessageListener(
+ public void addPerTopicHandler(Object topic, IgniteBiInClosure<UUID, ? extends GridCacheMessage> c) {
+ if (perTopicHandlers.putIfAbsent(topic, c) == null) {
+ cctx.gridIO().addMessageListener(topic, new PerTopicMessageListener(
(IgniteBiInClosure<UUID, GridCacheMessage>)c));
if (log != null && log.isDebugEnabled())
- log.debug("Registered ordered cache communication handler [topic=" + topic + ", handler=" + c + ']');
+ log.debug("Registered per topic cache communication handler [topic=" + topic + ", handler=" + c + ']');
}
else if (log != null)
- U.warn(log, "Failed to register ordered cache communication handler because it is already " +
+ U.warn(log, "Failed to register per topic cache communication handler because it is already " +
"registered for this topic [topic=" + topic + ", handler=" + c + ']');
}
/**
- * Removed ordered message handler.
+ * Removed per topic message handler.
*
* @param topic Topic.
*/
- public void removeOrderedHandler(Object topic) {
- if (orderedHandlers.remove(topic) != null) {
+ public void removePerTopicHandler(Object topic) {
+ if (perTopicHandlers.remove(topic) != null) {
cctx.gridIO().removeMessageListener(topic);
if (log != null && log.isDebugEnabled())
- log.debug("Unregistered ordered cache communication handler for topic:" + topic);
+ log.debug("Unregistered per topic cache communication handler for topic:" + topic);
}
else if (log != null)
- U.warn(log, "Failed to unregister ordered cache communication handler because it was not found " +
+ U.warn(log, "Failed to unregister per topic cache communication handler because it was not found " +
"for topic: " + topic);
}
@@ -1019,20 +1078,20 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
X.println(">>> ");
X.println(">>> Cache IO manager memory stats [grid=" + cctx.gridName() + ']');
X.println(">>> clsHandlersSize: " + clsHandlers.size());
- X.println(">>> orderedHandlersSize: " + orderedHandlers.size());
+ X.println(">>> perTopicHandlersSize: " + perTopicHandlers.size());
}
/**
- * Ordered message listener.
+ * Per topic message listener.
*/
- private class OrderedMessageListener implements GridMessageListener {
+ private class PerTopicMessageListener implements GridMessageListener {
/** */
private final IgniteBiInClosure<UUID, GridCacheMessage> c;
/**
* @param c Handler closure.
*/
- OrderedMessageListener(IgniteBiInClosure<UUID, GridCacheMessage> c) {
+ PerTopicMessageListener(IgniteBiInClosure<UUID, GridCacheMessage> c) {
this.c = c;
}
@@ -1040,7 +1099,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
@SuppressWarnings({"CatchGenericClass", "unchecked"})
@Override public void onMessage(final UUID nodeId, Object msg) {
if (log.isDebugEnabled())
- log.debug("Received cache ordered message [nodeId=" + nodeId + ", msg=" + msg + ']');
+ log.debug("Received per topic cache message [nodeId=" + nodeId + ", msg=" + msg + ']');
final GridCacheMessage cacheMsg = (GridCacheMessage)msg;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index d82acca..a313e3d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1733,15 +1733,4 @@ public class GridCacheUtils {
}
};
}
-
- /**
- * @param ctx Cache context.
- * @param part Partition.
- * @return Per-partition message topic.
- */
- public static Object partitionMessageTopic(GridCacheContext ctx, int part) {
- assert part >= 0;
-
- return TOPIC_CACHE.topic(ctx.cacheId(), part);
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java
new file mode 100644
index 0000000..52e3c7f
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicMappingKey.java
@@ -0,0 +1,86 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.util.*;
+
+/**
+ * Mapping Key.
+ */
+class GridAtomicMappingKey {
+ /** Node ID. */
+ private final UUID nodeId;
+
+ /** Partition. */
+ private final int part;
+
+ /**
+ * @param nodeId Node ID.
+ * @param part Partition.
+ */
+ GridAtomicMappingKey(UUID nodeId, int part) {
+ assert nodeId != null;
+ assert part >= -1 : part;
+
+ this.nodeId = nodeId;
+ this.part = part;
+ }
+
+ /**
+ * @return Node ID.
+ */
+ UUID nodeId() {
+ return nodeId;
+ }
+
+ /**
+ * @return Partition.
+ */
+ int partition() {
+ return part;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ GridAtomicMappingKey key = (GridAtomicMappingKey)o;
+
+ return nodeId.equals(key.nodeId) && part == key.part;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ int res = nodeId.hashCode();
+
+ res = 31 * res + part;
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridAtomicMappingKey.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java
new file mode 100644
index 0000000..9feb409
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAtomicRequestTopic.java
@@ -0,0 +1,96 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.io.*;
+
+/**
+ */
+class GridAtomicRequestTopic implements Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private int cacheId;
+
+ /** */
+ private int part;
+
+ /** */
+ private boolean near;
+
+ /**
+ * For {@link Externalizable}.
+ */
+ public GridAtomicRequestTopic() {
+ // No-op.
+ }
+
+ /**
+ * @param cacheId Cache ID.
+ * @param part Partition.
+ * @param near Near flag.
+ */
+ GridAtomicRequestTopic(int cacheId, int part, boolean near) {
+ this.cacheId = cacheId;
+ this.part = part;
+ this.near = near;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ GridAtomicRequestTopic topic = (GridAtomicRequestTopic)o;
+
+ return cacheId == topic.cacheId && part == topic.part && near == topic.near;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ int res = cacheId;
+
+ res = 31 * res + part;
+ res = 31 * res + (near ? 1 : 0);
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeInt(cacheId);
+ out.writeInt(part);
+ out.writeBoolean(near);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ cacheId = in.readInt();
+ part = in.readInt();
+ near = in.readBoolean();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridAtomicRequestTopic.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index be35d00..a010baa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -181,15 +181,19 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
});
- ctx.io().addHandler(ctx.cacheId(), GridNearAtomicUpdateRequest.class, new CI2<UUID, GridNearAtomicUpdateRequest>() {
- @Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
- processNearAtomicUpdateRequest(nodeId, req);
- }
- });
-
if (ctx.config().isAtomicOrderedUpdates()) {
for (int part = 0; part < ctx.affinity().partitions(); part++) {
- ctx.io().addOrderedHandler(CU.partitionMessageTopic(ctx, part), new CI2<UUID, GridDhtAtomicUpdateRequest>() {
+ Object nearTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, true);
+
+ ctx.io().addPerTopicHandler(nearTopic, new CI2<UUID, GridNearAtomicUpdateRequest>() {
+ @Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
+ processNearAtomicUpdateRequest(nodeId, req);
+ }
+ });
+
+ Object dhtTopic = new GridAtomicRequestTopic(ctx.cacheId(), part, false);
+
+ ctx.io().addPerTopicHandler(dhtTopic, new CI2<UUID, GridDhtAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridDhtAtomicUpdateRequest req) {
processDhtAtomicUpdateRequest(nodeId, req);
}
@@ -197,6 +201,12 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
}
else {
+ ctx.io().addHandler(ctx.cacheId(), GridNearAtomicUpdateRequest.class, new CI2<UUID, GridNearAtomicUpdateRequest>() {
+ @Override public void apply(UUID nodeId, GridNearAtomicUpdateRequest req) {
+ processNearAtomicUpdateRequest(nodeId, req);
+ }
+ });
+
ctx.io().addHandler(ctx.cacheId(), GridDhtAtomicUpdateRequest.class, new CI2<UUID, GridDhtAtomicUpdateRequest>() {
@Override public void apply(UUID nodeId, GridDhtAtomicUpdateRequest req) {
processDhtAtomicUpdateRequest(nodeId, req);
@@ -238,8 +248,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
buf.finish();
if (ctx.config().isAtomicOrderedUpdates()) {
- for (int part = 0; part < ctx.affinity().partitions(); part++)
- ctx.io().removeOrderedHandler(CU.partitionMessageTopic(ctx, part));
+ for (int part = 0; part < ctx.affinity().partitions(); part++) {
+ ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, true));
+ ctx.io().removePerTopicHandler(new GridAtomicRequestTopic(ctx.cacheId(), part, false));
+ }
}
}
@@ -1033,7 +1045,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
) {
GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(ctx.cacheId(),
nodeId,
- req.futureVersion());
+ req.futureVersion(),
+ req.partition());
List<KeyCacheObject> keys = req.keys();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 93c20da..c05f4c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -73,7 +73,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
/** Mappings. */
@GridToStringInclude
- private ConcurrentMap<MappingKey, GridDhtAtomicUpdateRequest> mappings = new ConcurrentHashMap8<>();
+ private ConcurrentMap<GridAtomicMappingKey, GridDhtAtomicUpdateRequest> mappings = new ConcurrentHashMap8<>();
/** Entries with readers. */
private Map<KeyCacheObject, GridDhtCacheEntry> nearReadersEntries;
@@ -142,8 +142,8 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
/** {@inheritDoc} */
@Override public Collection<? extends ClusterNode> nodes() {
- return F.view(F.viewReadOnly(mappings.keySet(), new C1<MappingKey, ClusterNode>() {
- @Override public ClusterNode apply(MappingKey mappingKey) {
+ return F.view(F.viewReadOnly(mappings.keySet(), new C1<GridAtomicMappingKey, ClusterNode>() {
+ @Override public ClusterNode apply(GridAtomicMappingKey mappingKey) {
return cctx.kernalContext().discovery().node(mappingKey.nodeId());
}
}), F.notNull());
@@ -154,15 +154,15 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
if (log.isDebugEnabled())
log.debug("Processing node leave event [fut=" + this + ", nodeId=" + nodeId + ']');
- Collection<MappingKey> mappingKeys = new ArrayList<>(mappings.size());
+ Collection<GridAtomicMappingKey> mappingKeys = new ArrayList<>(mappings.size());
- for (MappingKey mappingKey : mappings.keySet()) {
+ for (GridAtomicMappingKey mappingKey : mappings.keySet()) {
if (mappingKey.nodeId().equals(nodeId))
mappingKeys.add(mappingKey);
}
if (!mappingKeys.isEmpty()) {
- for (MappingKey mappingKey : mappingKeys)
+ for (GridAtomicMappingKey mappingKey : mappingKeys)
mappings.remove(mappingKey);
checkComplete();
@@ -234,7 +234,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
for (ClusterNode node : dhtNodes) {
UUID nodeId = node.id();
- MappingKey mappingKey = new MappingKey(nodeId, part);
+ GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, part);
if (!nodeId.equals(cctx.localNodeId())) {
GridDhtAtomicUpdateRequest updateReq = mappings.get(mappingKey);
@@ -287,7 +287,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
int part = cctx.config().isAtomicOrderedUpdates() ? entry.partition() : -1;
for (UUID nodeId : readers) {
- MappingKey mappingKey = new MappingKey(nodeId, part);
+ GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, part);
GridDhtAtomicUpdateRequest updateReq = mappings.get(mappingKey);
@@ -345,8 +345,8 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
*/
public void map() {
if (!mappings.isEmpty()) {
- for (Map.Entry<MappingKey, GridDhtAtomicUpdateRequest> e : mappings.entrySet()) {
- MappingKey mappingKey = e.getKey();
+ for (Map.Entry<GridAtomicMappingKey, GridDhtAtomicUpdateRequest> e : mappings.entrySet()) {
+ GridAtomicMappingKey mappingKey = e.getKey();
GridDhtAtomicUpdateRequest req = e.getValue();
UUID nodeId = mappingKey.nodeId();
@@ -359,7 +359,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
log.debug("Sending DHT atomic update request [nodeId=" + nodeId + ", req=" + req + ']');
if (part >= 0) {
- Object topic = CU.partitionMessageTopic(cctx, part);
+ Object topic = new GridAtomicRequestTopic(cctx.cacheId(), part, false);
cctx.io().sendOrderedMessage(nodeId, topic, req, cctx.ioPolicy(),
2 * cctx.gridConfig().getNetworkTimeout());
@@ -429,7 +429,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
}
}
- mappings.remove(new MappingKey(nodeId, updateRes.partition()));
+ mappings.remove(new GridAtomicMappingKey(nodeId, updateRes.partition()));
checkComplete();
}
@@ -445,7 +445,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
log.debug("Received deferred DHT atomic update future result [nodeId=" + nodeId + ']');
for (Integer part : res.partitions())
- mappings.remove(new MappingKey(nodeId, part));
+ mappings.remove(new GridAtomicMappingKey(nodeId, part));
checkComplete();
}
@@ -468,67 +468,4 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
return S.toString(GridDhtAtomicUpdateFuture.class, this);
}
- /**
- * Mapping Key.
- */
- private static class MappingKey {
- /** Node ID. */
- private final UUID nodeId;
-
- /** Partition. */
- private final int part;
-
- /**
- * @param nodeId Node ID.
- * @param part Partition.
- */
- MappingKey(UUID nodeId, int part) {
- assert nodeId != null;
- assert part >= -1 : part;
-
- this.nodeId = nodeId;
- this.part = part;
- }
-
- /**
- * @return Node ID.
- */
- UUID nodeId() {
- return nodeId;
- }
-
- /**
- * @return Partition.
- */
- int partition() {
- return part;
- }
-
- /** {@inheritDoc} */
- @Override public boolean equals(Object o) {
- if (this == o)
- return true;
-
- if (o == null || getClass() != o.getClass())
- return false;
-
- MappingKey key = (MappingKey)o;
-
- return nodeId.equals(key.nodeId) && part == key.part;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- int res = nodeId.hashCode();
-
- res = 31 * res + part;
-
- return res;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(MappingKey.class, this);
- }
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 4c8a161..4642b1a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -90,7 +90,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** Mappings. */
@GridToStringInclude
- private ConcurrentMap<UUID, GridNearAtomicUpdateRequest> mappings;
+ private ConcurrentMap<GridAtomicMappingKey, GridNearAtomicUpdateRequest> mappings;
/** Error. */
private volatile CachePartialUpdateCheckedException err;
@@ -246,7 +246,11 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** {@inheritDoc} */
@Override public Collection<? extends ClusterNode> nodes() {
- return F.view(F.viewReadOnly(mappings.keySet(), U.id2Node(cctx.kernalContext())), F.notNull());
+ return F.view(F.viewReadOnly(mappings.keySet(), new C1<GridAtomicMappingKey, ClusterNode>() {
+ @Override public ClusterNode apply(GridAtomicMappingKey mappingKey) {
+ return cctx.kernalContext().discovery().node(mappingKey.nodeId());
+ }
+ }), F.notNull());
}
/**
@@ -283,13 +287,24 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return false;
}
- GridNearAtomicUpdateRequest req = mappings.get(nodeId);
+ Collection<GridAtomicMappingKey> mappingKeys = new ArrayList<>(mappings.size());
+ Collection<KeyCacheObject> failedKeys = new ArrayList<>();
+
+ for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
+ if (e.getKey().nodeId().equals(nodeId)) {
+ mappingKeys.add(e.getKey());
+
+ failedKeys.addAll(e.getValue().keys());
+ }
+ }
- if (req != null) {
- addFailedKeys(req.keys(), new ClusterTopologyCheckedException("Primary node left grid before response is " +
- "received: " + nodeId));
+ if (!mappingKeys.isEmpty()) {
+ if (!failedKeys.isEmpty())
+ addFailedKeys(failedKeys, new ClusterTopologyCheckedException("Primary node left grid before " +
+ "response is received: " + nodeId));
- mappings.remove(nodeId);
+ for (GridAtomicMappingKey key : mappingKeys)
+ mappings.remove(key);
checkComplete();
@@ -529,7 +544,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
}
else {
- GridNearAtomicUpdateRequest req = mappings.get(nodeId);
+ GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, res.partition());
+
+ GridNearAtomicUpdateRequest req = mappings.get(mappingKey);
if (req != null) { // req can be null if onResult is being processed concurrently with onNodeLeft.
updateNear(req, res);
@@ -547,7 +564,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
opRes = ret;
}
- mappings.remove(nodeId);
+ mappings.remove(mappingKey);
}
checkComplete();
@@ -763,7 +780,11 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (op != TRANSFORM)
val = cctx.toCacheObject(val);
- ClusterNode primary = cctx.affinity().primary(cacheKey, topVer);
+ int part = cctx.affinity().partition(cacheKey);
+ ClusterNode primary = cctx.affinity().primary(part, topVer);
+
+ if (!ccfg.isAtomicOrderedUpdates())
+ part = -1;
if (primary == null) {
onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
@@ -789,7 +810,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
subjId,
taskNameHash,
skipStore,
- cctx.kernalContext().clientNode());
+ cctx.kernalContext().clientNode(),
+ part);
req.addUpdateEntry(cacheKey,
val,
@@ -805,7 +827,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
// Optimize mapping for single key.
- mapSingle(primary.id(), req);
+ mapSingle(new GridAtomicMappingKey(primary.id(), part), req);
return;
}
@@ -825,13 +847,18 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (conflictRmvVals != null)
conflictRmvValsIt = conflictRmvVals.iterator();
- Map<UUID, GridNearAtomicUpdateRequest> pendingMappings = new HashMap<>(topNodes.size(), 1.0f);
+ Map<GridAtomicMappingKey, GridNearAtomicUpdateRequest> pendingMappings = new HashMap<>(topNodes.size(), 1.0f);
// Must do this in synchronized block because we need to atomically remove and add mapping.
// Otherwise checkComplete() may see empty intermediate state.
synchronized (this) {
- if (oldNodeId != null)
- removeMapping(oldNodeId);
+ if (oldNodeId != null) {
+ // TODO: IGNITE-104 - Try to avoid iteration.
+ for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
+ if (e.getKey().nodeId().equals(oldNodeId))
+ mappings.remove(e.getKey());
+ }
+ }
// For fastMap mode wait for all responses before remapping.
if (remap && fastMap && !mappings.isEmpty()) {
@@ -901,7 +928,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (op != TRANSFORM)
val = cctx.toCacheObject(val);
- Collection<ClusterNode> affNodes = mapKey(cacheKey, topVer, fastMap);
+ T2<Integer, Collection<ClusterNode>> t = mapKey(cacheKey, topVer, fastMap);
+
+ int part = ccfg.isAtomicOrderedUpdates() ? t.get1() : -1;
+ Collection<ClusterNode> affNodes = t.get2();
if (affNodes.isEmpty()) {
onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
@@ -922,7 +952,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
UUID nodeId = affNode.id();
- GridNearAtomicUpdateRequest mapped = pendingMappings.get(nodeId);
+ GridAtomicMappingKey mappingKey = new GridAtomicMappingKey(nodeId, part);
+
+ GridNearAtomicUpdateRequest mapped = pendingMappings.get(mappingKey);
if (mapped == null) {
mapped = new GridNearAtomicUpdateRequest(
@@ -942,11 +974,12 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
subjId,
taskNameHash,
skipStore,
- cctx.kernalContext().clientNode());
+ cctx.kernalContext().clientNode(),
+ part);
- pendingMappings.put(nodeId, mapped);
+ pendingMappings.put(mappingKey, mapped);
- GridNearAtomicUpdateRequest old = mappings.put(nodeId, mapped);
+ GridNearAtomicUpdateRequest old = mappings.put(mappingKey, mapped);
assert old == null || (old != null && remap) :
"Invalid mapping state [old=" + old + ", remap=" + remap + ']';
@@ -964,7 +997,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
if ((single == null || single) && pendingMappings.size() == 1) {
- Map.Entry<UUID, GridNearAtomicUpdateRequest> entry = F.first(pendingMappings.entrySet());
+ Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> entry = F.first(pendingMappings.entrySet());
single = true;
@@ -987,31 +1020,35 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* @param fastMap Flag indicating whether mapping is performed for fast-circuit update.
* @return Collection of nodes to which key is mapped.
*/
- private Collection<ClusterNode> mapKey(
+ private T2<Integer, Collection<ClusterNode>> mapKey(
KeyCacheObject key,
AffinityTopologyVersion topVer,
boolean fastMap
) {
GridCacheAffinityManager affMgr = cctx.affinity();
+ int part = affMgr.partition(key);
+
// If we can send updates in parallel - do it.
- return fastMap ?
- cctx.topology().nodes(affMgr.partition(key), topVer) :
- Collections.singletonList(affMgr.primary(key, topVer));
+ Collection<ClusterNode> nodes = fastMap ?
+ cctx.topology().nodes(part, topVer) :
+ Collections.singletonList(affMgr.primary(part, topVer));
+
+ return new T2<>(part, nodes);
}
/**
* Maps future to single node.
*
- * @param nodeId Node ID.
+ * @param mappingKey Mapping key.
* @param req Request.
*/
- private void mapSingle(UUID nodeId, GridNearAtomicUpdateRequest req) {
- singleNodeId = nodeId;
+ private void mapSingle(GridAtomicMappingKey mappingKey, GridNearAtomicUpdateRequest req) {
+ singleNodeId = mappingKey.nodeId();
singleReq = req;
- if (cctx.localNodeId().equals(nodeId)) {
- cache.updateAllAsyncInternal(nodeId, req,
+ if (cctx.localNodeId().equals(mappingKey.nodeId())) {
+ cache.updateAllAsyncInternal(mappingKey.nodeId(), req,
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req,
GridNearAtomicUpdateResponse res) {
@@ -1026,7 +1063,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (log.isDebugEnabled())
log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
- cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
+ sendRequest(mappingKey, req);
if (syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY)
onDone(new GridCacheReturn(cctx, true, null, true));
@@ -1042,34 +1079,37 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
*
* @param mappings Mappings to send.
*/
- private void doUpdate(Map<UUID, GridNearAtomicUpdateRequest> mappings) {
+ private void doUpdate(Map<GridAtomicMappingKey, GridNearAtomicUpdateRequest> mappings) {
UUID locNodeId = cctx.localNodeId();
- GridNearAtomicUpdateRequest locUpdate = null;
+ Collection<GridNearAtomicUpdateRequest> locUpdates = null;
// Send messages to remote nodes first, then run local update.
- for (GridNearAtomicUpdateRequest req : mappings.values()) {
+ for (Map.Entry<GridAtomicMappingKey, GridNearAtomicUpdateRequest> e : mappings.entrySet()) {
+ GridAtomicMappingKey mappingKey = e.getKey();
+ GridNearAtomicUpdateRequest req = e.getValue();
+
if (locNodeId.equals(req.nodeId())) {
- assert locUpdate == null : "Cannot have more than one local mapping [locUpdate=" + locUpdate +
- ", req=" + req + ']';
+ if (locUpdates == null)
+ locUpdates = new ArrayList<>(mappings.size());
- locUpdate = req;
+ locUpdates.add(req);
}
else {
try {
if (log.isDebugEnabled())
log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
- cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
+ sendRequest(mappingKey, req);
}
- catch (IgniteCheckedException e) {
- addFailedKeys(req.keys(), e);
+ catch (IgniteCheckedException ex) {
+ addFailedKeys(req.keys(), ex);
- removeMapping(req.nodeId());
+ removeMapping(mappingKey);
}
if (syncMode == PRIMARY_SYNC && !req.hasPrimary())
- removeMapping(req.nodeId());
+ removeMapping(mappingKey);
}
}
@@ -1077,28 +1117,52 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
// In FULL_ASYNC mode always return (null, true).
opRes = new GridCacheReturn(cctx, true, null, true);
- if (locUpdate != null) {
- cache.updateAllAsyncInternal(cctx.localNodeId(), locUpdate,
- new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
- @Override public void apply(GridNearAtomicUpdateRequest req,
- GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer) : futVer;
+ if (locUpdates != null) {
+ for (GridNearAtomicUpdateRequest locUpdate : locUpdates) {
+ cache.updateAllAsyncInternal(cctx.localNodeId(), locUpdate,
+ new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
+ @Override public void apply(GridNearAtomicUpdateRequest req,
+ GridNearAtomicUpdateResponse res) {
+ assert res.futureVersion().equals(futVer) : futVer;
- onResult(res.nodeId(), res);
- }
- });
+ onResult(res.nodeId(), res);
+ }
+ });
+ }
}
checkComplete();
}
/**
+ * Sends request.
+ *
+ * @param mappingKey Mapping key.
+ * @param req Update request.
+ * @throws IgniteCheckedException In case of error.
+ */
+ private void sendRequest(GridAtomicMappingKey mappingKey, GridNearAtomicUpdateRequest req)
+ throws IgniteCheckedException {
+ if (mappingKey.partition() >= 0) {
+ Object topic = new GridAtomicRequestTopic(cctx.cacheId(), mappingKey.partition(), true);
+
+ cctx.io().sendOrderedMessage(mappingKey.nodeId(), topic, req, cctx.ioPolicy(),
+ 2 * cctx.gridConfig().getNetworkTimeout());
+ }
+ else {
+ assert mappingKey.partition() == -1;
+
+ cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
+ }
+ }
+
+ /**
* Removes mapping from future mappings map.
*
- * @param nodeId Node ID to remove mapping for.
+ * @param mappingKey Mapping key.
*/
- private void removeMapping(UUID nodeId) {
- mappings.remove(nodeId);
+ private void removeMapping(GridAtomicMappingKey mappingKey) {
+ mappings.remove(mappingKey);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index 86c5ab8..b3075c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -135,6 +135,9 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
/** */
private boolean clientReq;
+ /** Partition. */
+ private int part;
+
/**
* Empty constructor required by {@link Externalizable}.
*/
@@ -162,6 +165,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
* @param taskNameHash Task name hash code.
* @param skipStore Skip write-through to a persistent storage.
* @param clientReq Client node request flag.
+ * @param part Partition.
*/
public GridNearAtomicUpdateRequest(
int cacheId,
@@ -180,7 +184,8 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
@Nullable UUID subjId,
int taskNameHash,
boolean skipStore,
- boolean clientReq
+ boolean clientReq,
+ int part
) {
this.cacheId = cacheId;
this.nodeId = nodeId;
@@ -200,6 +205,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
this.taskNameHash = taskNameHash;
this.skipStore = skipStore;
this.clientReq = clientReq;
+ this.part = part;
keys = new ArrayList<>();
}
@@ -315,6 +321,13 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
}
/**
+ * @return Partition.
+ */
+ public int partition() {
+ return part;
+ }
+
+ /**
* @param key Key to add.
* @param val Optional update value.
* @param conflictTtl Conflict TTL (optional).
@@ -666,54 +679,60 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
writer.incrementState();
case 16:
- if (!writer.writeBoolean("retval", retval))
+ if (!writer.writeInt("part", part))
return false;
writer.incrementState();
case 17:
- if (!writer.writeBoolean("skipStore", skipStore))
+ if (!writer.writeBoolean("retval", retval))
return false;
writer.incrementState();
case 18:
- if (!writer.writeUuid("subjId", subjId))
+ if (!writer.writeBoolean("skipStore", skipStore))
return false;
writer.incrementState();
case 19:
- if (!writer.writeByte("syncMode", syncMode != null ? (byte)syncMode.ordinal() : -1))
+ if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
case 20:
- if (!writer.writeInt("taskNameHash", taskNameHash))
+ if (!writer.writeByte("syncMode", syncMode != null ? (byte)syncMode.ordinal() : -1))
return false;
writer.incrementState();
case 21:
- if (!writer.writeBoolean("topLocked", topLocked))
+ if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
case 22:
- if (!writer.writeMessage("topVer", topVer))
+ if (!writer.writeBoolean("topLocked", topLocked))
return false;
writer.incrementState();
case 23:
- if (!writer.writeMessage("updateVer", updateVer))
+ if (!writer.writeMessage("topVer", topVer))
return false;
writer.incrementState();
case 24:
+ if (!writer.writeMessage("updateVer", updateVer))
+ return false;
+
+ writer.incrementState();
+
+ case 25:
if (!writer.writeCollection("vals", vals, MessageCollectionItemType.MSG))
return false;
@@ -844,7 +863,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
case 16:
- retval = reader.readBoolean("retval");
+ part = reader.readInt("part");
if (!reader.isLastRead())
return false;
@@ -852,7 +871,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
case 17:
- skipStore = reader.readBoolean("skipStore");
+ retval = reader.readBoolean("retval");
if (!reader.isLastRead())
return false;
@@ -860,7 +879,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
case 18:
- subjId = reader.readUuid("subjId");
+ skipStore = reader.readBoolean("skipStore");
if (!reader.isLastRead())
return false;
@@ -868,6 +887,14 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
case 19:
+ subjId = reader.readUuid("subjId");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 20:
byte syncModeOrd;
syncModeOrd = reader.readByte("syncMode");
@@ -879,7 +906,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 20:
+ case 21:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -887,7 +914,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 21:
+ case 22:
topLocked = reader.readBoolean("topLocked");
if (!reader.isLastRead())
@@ -895,7 +922,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 22:
+ case 23:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -903,7 +930,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 23:
+ case 24:
updateVer = reader.readMessage("updateVer");
if (!reader.isLastRead())
@@ -911,7 +938,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
reader.incrementState();
- case 24:
+ case 25:
vals = reader.readCollection("vals", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -931,7 +958,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 25;
+ return 26;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index 8e1bee2..e2d33d5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -92,6 +92,9 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
/** Near expire times. */
private GridLongList nearExpireTimes;
+ /** Partition. */
+ private int part;
+
/**
* Empty constructor required by {@link Externalizable}.
*/
@@ -103,11 +106,13 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
* @param cacheId Cache ID.
* @param nodeId Node ID this reply should be sent to.
* @param futVer Future version.
+ * @param part Partition.
*/
- public GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, GridCacheVersion futVer) {
+ public GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, GridCacheVersion futVer, int part) {
this.cacheId = cacheId;
this.nodeId = nodeId;
this.futVer = futVer;
+ this.part = part;
}
/** {@inheritDoc} */
@@ -138,7 +143,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
/**
* Sets update error.
- * @param err Exception.
+ * @param err
*/
public void error(IgniteCheckedException err){
this.err = err;
@@ -188,6 +193,13 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
}
/**
+ * @return Partition.
+ */
+ public int partition() {
+ return part;
+ }
+
+ /**
* Adds value to be put in near cache on originating node.
*
* @param keyIdx Key index.
@@ -485,12 +497,18 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
writer.incrementState();
case 12:
- if (!writer.writeCollection("remapKeys", remapKeys, MessageCollectionItemType.MSG))
+ if (!writer.writeInt("part", part))
return false;
writer.incrementState();
case 13:
+ if (!writer.writeCollection("remapKeys", remapKeys, MessageCollectionItemType.MSG))
+ return false;
+
+ writer.incrementState();
+
+ case 14:
if (!writer.writeMessage("ret", ret))
return false;
@@ -585,7 +603,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
reader.incrementState();
case 12:
- remapKeys = reader.readCollection("remapKeys", MessageCollectionItemType.MSG);
+ part = reader.readInt("part");
if (!reader.isLastRead())
return false;
@@ -593,6 +611,14 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
reader.incrementState();
case 13:
+ remapKeys = reader.readCollection("remapKeys", MessageCollectionItemType.MSG);
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 14:
ret = reader.readMessage("ret");
if (!reader.isLastRead())
@@ -612,7 +638,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 14;
+ return 15;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
index a6e6c4d..37824eb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
@@ -599,7 +599,7 @@ public class GridDhtPartitionDemandPool {
if (isCancelled() || topologyChanged())
return missed;
- cctx.io().addOrderedHandler(d.topic(), new CI2<UUID, GridDhtPartitionSupplyMessage>() {
+ cctx.io().addPerTopicHandler(d.topic(), new CI2<UUID, GridDhtPartitionSupplyMessage>() {
@Override public void apply(UUID nodeId, GridDhtPartitionSupplyMessage msg) {
addMessage(new SupplyMessage(nodeId, msg));
}
@@ -641,7 +641,7 @@ public class GridDhtPartitionDemandPool {
growTimeout(timeout);
// Ordered listener was removed if timeout expired.
- cctx.io().removeOrderedHandler(d.topic());
+ cctx.io().removePerTopicHandler(d.topic());
// Must create copy to be able to work with IO manager thread local caches.
d = new GridDhtPartitionDemandMessage(d, remaining);
@@ -650,13 +650,12 @@ public class GridDhtPartitionDemandPool {
d.topic(topic(++cntr));
// Create new ordered listener.
- cctx.io().addOrderedHandler(d.topic(),
- new CI2<UUID, GridDhtPartitionSupplyMessage>() {
- @Override public void apply(UUID nodeId,
- GridDhtPartitionSupplyMessage msg) {
+ cctx.io().addPerTopicHandler(d.topic(), new CI2<UUID, GridDhtPartitionSupplyMessage>() {
+ @Override public void apply(UUID nodeId, GridDhtPartitionSupplyMessage msg) {
addMessage(new SupplyMessage(nodeId, msg));
}
- });
+ }
+ );
// Resend message with larger timeout.
retry = true;
@@ -800,7 +799,7 @@ public class GridDhtPartitionDemandPool {
return missed;
}
finally {
- cctx.io().removeOrderedHandler(d.topic());
+ cctx.io().removePerTopicHandler(d.topic());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
index 316713f..a530a5d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
@@ -556,11 +556,11 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
final Object topic = topic(cctx.nodeId(), req.id());
- cctx.io().addOrderedHandler(topic, resHnd);
+ cctx.io().addPerTopicHandler(topic, resHnd);
fut.listen(new CI1<IgniteInternalFuture<?>>() {
@Override public void apply(IgniteInternalFuture<?> fut) {
- cctx.io().removeOrderedHandler(topic);
+ cctx.io().removePerTopicHandler(topic);
}
});
@@ -665,11 +665,11 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
final Object topic = topic(cctx.nodeId(), req.id());
- cctx.io().addOrderedHandler(topic, resHnd);
+ cctx.io().addPerTopicHandler(topic, resHnd);
fut.listen(new CI1<IgniteInternalFuture<?>>() {
@Override public void apply(IgniteInternalFuture<?> fut) {
- cctx.io().removeOrderedHandler(topic);
+ cctx.io().removePerTopicHandler(topic);
}
});
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d16d99f/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index df4873a..3ec1d07 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -529,6 +529,7 @@ org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedGetFu
org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedGetFuture$MiniFuture$1
org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedGetFuture$MiniFuture$2
org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedGetFuture$MiniFuture$2$1
+org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridAtomicRequestTopic
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$10
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$11
@@ -806,7 +807,6 @@ org.apache.ignite.internal.processors.closure.GridClosureProcessor$T5
org.apache.ignite.internal.processors.closure.GridClosureProcessor$T6
org.apache.ignite.internal.processors.closure.GridClosureProcessor$T7
org.apache.ignite.internal.processors.closure.GridClosureProcessor$T8
-org.apache.ignite.internal.processors.closure.GridClosureProcessor$T9
org.apache.ignite.internal.processors.closure.GridClosureProcessor$TaskNoReduceAdapter
org.apache.ignite.internal.processors.closure.GridPeerDeployAwareTaskAdapter
org.apache.ignite.internal.processors.continuous.GridContinuousHandler
[40/50] incubator-ignite git commit: Merge branches 'ignite-104' and
'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-104
Posted by vk...@apache.org.
Merge branches 'ignite-104' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6c7358db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6c7358db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6c7358db
Branch: refs/heads/ignite-426
Commit: 6c7358db22e008f383acb356a3922107531c063b
Parents: 3d995af 2173b0e
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Aug 5 16:54:04 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Aug 5 16:54:04 2015 -0700
----------------------------------------------------------------------
.../org/apache/ignite/spark/IgniteContext.scala | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[38/50] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC
updates
Posted by vk...@apache.org.
IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c8b67de1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c8b67de1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c8b67de1
Branch: refs/heads/ignite-426
Commit: c8b67de10e3a4ccee5c828fb31f542821724ae0b
Parents: 7b161f0
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Aug 5 15:28:30 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Aug 5 15:28:30 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridNearAtomicUpdateFuture.java | 33 +++++++++-----------
1 file changed, 14 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c8b67de1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index c4704cf..5b364a5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -395,27 +395,23 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
Iterator<GridCacheDrInfo> conflictPutValsIt = conflictPutVals != null ? conflictPutVals.iterator() : null;
Iterator<GridCacheVersion> conflictRmvValsIt = conflictRmvVals != null ? conflictRmvVals.iterator() : null;
- for (Object key : failed) {
- while (keyIt.hasNext()) {
- Object nextKey = keyIt.next();
- Object nextVal = valsIt != null ? valsIt.next() : null;
- GridCacheDrInfo nextConflictPutVal = conflictPutValsIt != null ? conflictPutValsIt.next() : null;
- GridCacheVersion nextConflictRmvVal = conflictRmvValsIt != null ? conflictRmvValsIt.next() : null;
+ while (keyIt.hasNext()) {
+ Object nextKey = keyIt.next();
+ Object nextVal = valsIt != null ? valsIt.next() : null;
+ GridCacheDrInfo nextConflictPutVal = conflictPutValsIt != null ? conflictPutValsIt.next() : null;
+ GridCacheVersion nextConflictRmvVal = conflictRmvValsIt != null ? conflictRmvValsIt.next() : null;
- if (F.eq(key, nextKey)) {
- remapKeys.add(nextKey);
+ if (failed.contains(nextKey)) {
+ remapKeys.add(nextKey);
- if (remapVals != null)
- remapVals.add(nextVal);
+ if (remapVals != null)
+ remapVals.add(nextVal);
- if (remapConflictPutVals != null)
- remapConflictPutVals.add(nextConflictPutVal);
+ if (remapConflictPutVals != null)
+ remapConflictPutVals.add(nextConflictPutVal);
- if (remapConflictRmvVals != null)
- remapConflictRmvVals.add(nextConflictRmvVal);
-
- break;
- }
+ if (remapConflictRmvVals != null)
+ remapConflictRmvVals.add(nextConflictRmvVal);
}
}
@@ -473,8 +469,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
- if (F.isEmpty(cause.failedKeys()))
- cause.printStackTrace();
+ assert !F.isEmpty(cause.failedKeys());
remap(cause.failedKeys());
[25/50] incubator-ignite git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-104
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/98ad8925
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/98ad8925
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/98ad8925
Branch: refs/heads/ignite-426
Commit: 98ad89253b8e252d36a2e3c45d44466cb5b97d02
Parents: 2421fee 90adeae
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Aug 4 10:35:34 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Aug 4 10:35:34 2015 -0700
----------------------------------------------------------------------
.../h2/twostep/GridReduceQueryExecutor.java | 34 ++++-
...idCacheReduceQueryMultithreadedSelfTest.java | 21 ++-
.../yardstick/config/benchmark-query.properties | 3 +-
modules/yardstick/config/ignite-base-config.xml | 2 -
.../yardstick/IgniteBenchmarkArguments.java | 11 ++
.../cache/IgniteJdbcSqlQueryBenchmark.java | 134 +++++++++++++++++++
6 files changed, 198 insertions(+), 7 deletions(-)
----------------------------------------------------------------------