You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/21 15:52:50 UTC
[01/50] [abbrv] incubator-ignite git commit: # ignite-669 - streaming
design.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-37 c14eb5637 -> b445ac596 (forced update)
# ignite-669 - streaming design.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/be64e1dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/be64e1dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/be64e1dd
Branch: refs/heads/ignite-37
Commit: be64e1dd1f7aba02b664c4be6f2753cdafbbdba6
Parents: 0cbe3c6
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Thu Apr 2 03:10:54 2015 -0700
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:18 2015 +0300
----------------------------------------------------------------------
.../ignite/stream/adapters/StreamAdapter.java | 29 +++++++++++++++++---
1 file changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/be64e1dd/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
index 02ae795..f2e0da9 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
@@ -29,10 +29,17 @@ import java.util.*;
*/
public abstract class StreamAdapter<T, K, V> {
/** Tuple extractor. */
- private final StreamTupleExtractor<T, K, V> extractor;
+ private StreamTupleExtractor<T, K, V> extractor;
/** Streamer. */
- private final IgniteDataStreamer<K, V> stmr;
+ private IgniteDataStreamer<K, V> stmr;
+
+ /**
+ * Empty constructor.
+ */
+ public StreamAdapter() {
+ // No-op.
+ }
/**
* Stream adapter.
@@ -48,18 +55,32 @@ public abstract class StreamAdapter<T, K, V> {
/**
* @return Provided data streamer.
*/
- public IgniteDataStreamer<K, V> streamer() {
+ public IgniteDataStreamer<K, V> getStreamer() {
return stmr;
}
/**
+ * @param stmr Ignite data streamer.
+ */
+ public void setStreamer(IgniteDataStreamer<K, V> stmr) {
+ this.stmr = stmr;
+ }
+
+ /**
* @return Provided tuple extractor.
*/
- public StreamTupleExtractor<T, K, V> converter() {
+ public StreamTupleExtractor<T, K, V> getConverter() {
return extractor;
}
/**
+ * @param extractor Extractor for key-value tuples from messages.
+ */
+ public void setExtractor(StreamTupleExtractor<T, K, V> extractor) {
+ this.extractor = extractor;
+ }
+
+ /**
* Converts given message to a tuple and adds it to the underlying streamer.
*
* @param msg Message to convert.
[23/50] [abbrv] incubator-ignite git commit: # Minor changes.
Posted by sb...@apache.org.
# Minor changes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ba7fddb0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ba7fddb0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ba7fddb0
Branch: refs/heads/ignite-37
Commit: ba7fddb004a840fdad66bc9fd127eafda27fee2f
Parents: 15d55b1
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon May 18 17:45:38 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon May 18 17:45:38 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/managers/communication/GridIoManager.java | 6 +++---
.../communication/GridLifecycleAwareMessageFilter.java | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba7fddb0/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 16d582b..c877d57 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
@@ -1697,10 +1697,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
this.predLsnr = predLsnr;
if (predLsnr != null) {
- ctx.resource().injectGeneric(predLsnr);
-
if (predLsnr instanceof GridLifecycleAwareMessageFilter)
- ((GridLifecycleAwareMessageFilter)predLsnr).initialize();
+ ((GridLifecycleAwareMessageFilter)predLsnr).initialize(ctx);
+ else
+ ctx.resource().injectGeneric(predLsnr);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba7fddb0/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridLifecycleAwareMessageFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridLifecycleAwareMessageFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridLifecycleAwareMessageFilter.java
index cb99d2e..f8cd78f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridLifecycleAwareMessageFilter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridLifecycleAwareMessageFilter.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.managers.communication;
+import org.apache.ignite.internal.*;
import org.apache.ignite.lang.*;
/**
@@ -25,8 +26,10 @@ import org.apache.ignite.lang.*;
public interface GridLifecycleAwareMessageFilter<K, V> extends IgniteBiPredicate<K, V> {
/**
* Initializes the filter.
+ *
+ * @param ctx Kernal context.
*/
- public void initialize();
+ public void initialize(GridKernalContext ctx);
/**
* Closes the filter.
[37/50] [abbrv] incubator-ignite git commit: revert IGNITE-927
Revisit license packaging
Posted by sb...@apache.org.
revert
IGNITE-927
Revisit license packaging
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7ec8df69
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7ec8df69
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7ec8df69
Branch: refs/heads/ignite-37
Commit: 7ec8df69b8fa385e765dbaf3df481a5fb7a72a97
Parents: 0a4b126
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 20 16:27:15 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 20 16:27:15 2015 +0300
----------------------------------------------------------------------
modules/ssh/licenses/jcraft-revised-bsd.txt | 28 ++++++++++++++++++++
modules/tools/licenses/jodd-revised-bsd.txt | 21 +++++++++++++++
.../licenses/jcraft-revised-bsd.txt | 28 ++++++++++++++++++++
3 files changed, 77 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ec8df69/modules/ssh/licenses/jcraft-revised-bsd.txt
----------------------------------------------------------------------
diff --git a/modules/ssh/licenses/jcraft-revised-bsd.txt b/modules/ssh/licenses/jcraft-revised-bsd.txt
new file mode 100644
index 0000000..3748f98
--- /dev/null
+++ b/modules/ssh/licenses/jcraft-revised-bsd.txt
@@ -0,0 +1,28 @@
+3-clause BSD license
+------------------------------------------------------------------------------
+Copyright (c) 2002-2014 Atsuhiko Yamanaka, JCraft,Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the distribution.
+
+ 3. The names of the authors may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
+INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ec8df69/modules/tools/licenses/jodd-revised-bsd.txt
----------------------------------------------------------------------
diff --git a/modules/tools/licenses/jodd-revised-bsd.txt b/modules/tools/licenses/jodd-revised-bsd.txt
new file mode 100644
index 0000000..129f3f0
--- /dev/null
+++ b/modules/tools/licenses/jodd-revised-bsd.txt
@@ -0,0 +1,21 @@
+Jodd software is released under Revised BSD License.
+
+Copyright (c) 2003-2014, Jodd Team All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+Neither the name of the Jodd nor the names of its contributors may be used to endorse or promote products derived from this software without specific
+prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ec8df69/modules/visor-console/licenses/jcraft-revised-bsd.txt
----------------------------------------------------------------------
diff --git a/modules/visor-console/licenses/jcraft-revised-bsd.txt b/modules/visor-console/licenses/jcraft-revised-bsd.txt
new file mode 100644
index 0000000..3748f98
--- /dev/null
+++ b/modules/visor-console/licenses/jcraft-revised-bsd.txt
@@ -0,0 +1,28 @@
+3-clause BSD license
+------------------------------------------------------------------------------
+Copyright (c) 2002-2014 Atsuhiko Yamanaka, JCraft,Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the distribution.
+
+ 3. The names of the authors may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
+INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
[48/50] [abbrv] incubator-ignite git commit: # ignite-456: fix
patchApply start
Posted by sb...@apache.org.
# ignite-456: fix patchApply start
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/51d32fc3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/51d32fc3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/51d32fc3
Branch: refs/heads/ignite-37
Commit: 51d32fc3c99b2e582feb8ab774aeafef8a345b7f
Parents: 51ae1a3
Author: null <null>
Authored: Thu May 21 14:53:07 2015 +0300
Committer: null <null>
Committed: Thu May 21 14:53:07 2015 +0300
----------------------------------------------------------------------
dev-tools/src/main/groovy/jiraslurp.groovy | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51d32fc3/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index 0b8f090..32a6e43 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -363,8 +363,8 @@ args.each {
runAllTestBuilds(builds, k)
}
}
- else if (parameters.length > 1 && parameters[0] == "patchApply") {
- if (parameters.length < 2 || parameters[1] !=~ /\w+-\d+/) {
+ else if (parameters.length >= 1 && parameters[0] == "patchApply") {
+ if (parameters.length < 2 || parameters[1] == 'null') {
println "There is no jira number to apply. Exit."
return
[02/50] [abbrv] incubator-ignite git commit: # ignite-669 - streaming
design.
Posted by sb...@apache.org.
# ignite-669 - streaming design.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/877eb764
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/877eb764
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/877eb764
Branch: refs/heads/ignite-37
Commit: 877eb7649e61ca53765c42b4244a7d46a39d1179
Parents: be64e1d
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Thu Apr 2 03:11:54 2015 -0700
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:21 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/stream/adapters/StreamAdapter.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/877eb764/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
index f2e0da9..9d4772f 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
@@ -69,14 +69,14 @@ public abstract class StreamAdapter<T, K, V> {
/**
* @return Provided tuple extractor.
*/
- public StreamTupleExtractor<T, K, V> getConverter() {
+ public StreamTupleExtractor<T, K, V> getTupleExtractor() {
return extractor;
}
/**
* @param extractor Extractor for key-value tuples from messages.
*/
- public void setExtractor(StreamTupleExtractor<T, K, V> extractor) {
+ public void setTupleExtractor(StreamTupleExtractor<T, K, V> extractor) {
this.extractor = extractor;
}
[21/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/36805cc1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/36805cc1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/36805cc1
Branch: refs/heads/ignite-37
Commit: 36805cc1dd157b343301ff4661bbdf3db5b596ff
Parents: 489323b c3dde57
Author: avinogradov <av...@gridgain.com>
Authored: Mon May 18 12:55:06 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon May 18 12:55:06 2015 +0300
----------------------------------------------------------------------
.../socket/WordsSocketStreamerServer.java | 2 +-
.../org/apache/ignite/internal/IgnitionEx.java | 136 ++++---------
.../internal/interop/InteropBootstrap.java | 34 ++++
.../interop/InteropBootstrapFactory.java | 39 ++++
.../internal/interop/InteropIgnition.java | 166 ++++++++++++++++
.../internal/interop/InteropProcessor.java | 36 ++++
.../processors/cache/GridCacheAdapter.java | 8 +-
.../processors/cache/GridCacheMapEntry.java | 35 +---
.../distributed/GridDistributedLockRequest.java | 111 ++---------
.../GridDistributedTxFinishRequest.java | 70 ++-----
.../GridDistributedTxPrepareRequest.java | 112 +++--------
.../GridDistributedTxRemoteAdapter.java | 20 +-
.../distributed/dht/GridDhtLockFuture.java | 2 -
.../distributed/dht/GridDhtLockRequest.java | 45 ++---
.../dht/GridDhtTransactionalCacheAdapter.java | 6 -
.../distributed/dht/GridDhtTxFinishFuture.java | 3 -
.../distributed/dht/GridDhtTxFinishRequest.java | 43 ++---
.../cache/distributed/dht/GridDhtTxLocal.java | 6 -
.../distributed/dht/GridDhtTxLocalAdapter.java | 68 +------
.../distributed/dht/GridDhtTxPrepareFuture.java | 18 +-
.../dht/GridDhtTxPrepareRequest.java | 60 +++---
.../cache/distributed/dht/GridDhtTxRemote.java | 8 +-
.../colocated/GridDhtColocatedLockFuture.java | 6 -
.../distributed/near/GridNearLockFuture.java | 6 -
.../distributed/near/GridNearLockRequest.java | 61 +++---
.../near/GridNearOptimisticTxPrepareFuture.java | 15 +-
.../GridNearPessimisticTxPrepareFuture.java | 2 -
.../near/GridNearTransactionalCache.java | 4 -
.../near/GridNearTxFinishRequest.java | 28 +--
.../cache/distributed/near/GridNearTxLocal.java | 20 +-
.../near/GridNearTxPrepareRequest.java | 52 +++--
.../distributed/near/GridNearTxRemote.java | 24 +--
.../cache/transactions/IgniteInternalTx.java | 10 -
.../transactions/IgniteTransactionsImpl.java | 4 +-
.../cache/transactions/IgniteTxAdapter.java | 72 +------
.../cache/transactions/IgniteTxEntry.java | 48 +----
.../cache/transactions/IgniteTxHandler.java | 6 -
.../transactions/IgniteTxLocalAdapter.java | 165 ++--------------
.../cache/transactions/IgniteTxLocalEx.java | 21 +-
.../cache/transactions/IgniteTxManager.java | 62 +-----
.../spi/discovery/tcp/TcpDiscoverySpi.java | 26 ---
.../near/IgniteCacheNearOnlyTxTest.java | 190 +++++++++++++++++++
.../processors/cache/jta/CacheJtaManager.java | 4 +-
43 files changed, 744 insertions(+), 1110 deletions(-)
----------------------------------------------------------------------
[33/50] [abbrv] incubator-ignite git commit: "Version changed
Posted by sb...@apache.org.
"Version changed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c4d81fec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c4d81fec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c4d81fec
Branch: refs/heads/ignite-37
Commit: c4d81fec5546a748b2a67f6ddeffac2fc8b52d3a
Parents: fa07e18
Author: Ignite Teamcity <ig...@apache.org>
Authored: Wed May 20 13:31:58 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Wed May 20 13:31:58 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/resources/ignite.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c4d81fec/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index aec41ea..58aed26 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.0.6-SNAPSHOT1.0.6
+ignite.version=1.0.6
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
[29/50] [abbrv] incubator-ignite git commit: GG-9614 Interop .Net:
Implement GridEvents API. - done
Posted by sb...@apache.org.
GG-9614 Interop .Net: Implement GridEvents API. - done
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/26a713c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/26a713c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/26a713c8
Branch: refs/heads/ignite-37
Commit: 26a713c84b96bb0d89b802bd2ab3cd1319da0e2c
Parents: 3f7a80a
Author: ptupitsyn <pt...@gridgain.com>
Authored: Tue May 19 18:26:20 2015 +0300
Committer: ptupitsyn <pt...@gridgain.com>
Committed: Tue May 19 18:26:20 2015 +0300
----------------------------------------------------------------------
.../internal/GridEventConsumeHandler.java | 26 ++++++++++++++
.../interop/InteropAwareEventFilter.java | 37 ++++++++++++++++++++
.../interop/InteropLocalEventListener.java | 28 +++++++++++++++
.../eventstorage/GridEventStorageManager.java | 24 ++++++++++++-
4 files changed, 114 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26a713c8/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
index c60646e..505204d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.events.*;
+import org.apache.ignite.internal.interop.*;
import org.apache.ignite.internal.managers.deployment.*;
import org.apache.ignite.internal.managers.discovery.*;
import org.apache.ignite.internal.managers.eventstorage.*;
@@ -124,6 +125,9 @@ class GridEventConsumeHandler implements GridContinuousHandler {
if (filter != null)
ctx.resource().injectGeneric(filter);
+ if (filter instanceof InteropAwareEventFilter)
+ ((InteropAwareEventFilter)filter).initialize(ctx);
+
final boolean loc = nodeId.equals(ctx.localNodeId());
lsnr = new GridLocalEventListener() {
@@ -188,6 +192,28 @@ class GridEventConsumeHandler implements GridContinuousHandler {
if (lsnr != null)
ctx.event().removeLocalEventListener(lsnr, types);
+
+ RuntimeException err = null;
+
+ try {
+ if (filter instanceof InteropAwareEventFilter)
+ ((InteropAwareEventFilter)filter).close();
+ }
+ catch(RuntimeException ex) {
+ err = ex;
+ }
+
+ try {
+ if (cb instanceof InteropLocalEventListener)
+ ((InteropLocalEventListener)cb).close();
+ }
+ catch (RuntimeException ex) {
+ if (err == null)
+ err = ex;
+ }
+
+ if (err != null)
+ throw err;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26a713c8/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropAwareEventFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropAwareEventFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropAwareEventFilter.java
new file mode 100644
index 0000000..8dbc73b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropAwareEventFilter.java
@@ -0,0 +1,37 @@
+/*
+ * 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.interop;
+
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.lang.*;
+
+/**
+ * Special version of predicate for events with initialize/close callbacks.
+ */
+public interface InteropAwareEventFilter<E extends Event> extends IgnitePredicate<E> {
+ /**
+ * Initializes the filter.
+ */
+ public void initialize(GridKernalContext ctx);
+
+ /**
+ * Closes the filter.
+ */
+ public void close();
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26a713c8/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropLocalEventListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropLocalEventListener.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropLocalEventListener.java
new file mode 100644
index 0000000..180863b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropLocalEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.interop;
+
+/**
+ * Special version of listener for events with close callbacks.
+ */
+public interface InteropLocalEventListener {
+ /**
+ * Closes the listener.
+ */
+ public void close();
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26a713c8/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index 10cc99a..95c5eb1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cluster.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.events.*;
+import org.apache.ignite.internal.interop.*;
import org.apache.ignite.internal.managers.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.managers.deployment.*;
@@ -650,6 +651,14 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
}
}
+ if (lsnr instanceof UserListenerWrapper)
+ {
+ IgnitePredicate p = ((UserListenerWrapper)lsnr).listener();
+
+ if (p instanceof InteropLocalEventListener)
+ ((InteropLocalEventListener)p).close();
+ }
+
return found;
}
@@ -752,7 +761,20 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
public <T extends Event> Collection<T> localEvents(IgnitePredicate<T> p) {
assert p != null;
- return getSpi().localEvents(p);
+ if (p instanceof InteropAwareEventFilter) {
+ InteropAwareEventFilter p0 = (InteropAwareEventFilter)p;
+
+ p0.initialize(ctx);
+
+ try {
+ return getSpi().localEvents(p0);
+ }
+ finally {
+ p0.close();
+ }
+ }
+ else
+ return getSpi().localEvents(p);
}
/**
[40/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4b4158f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4b4158f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4b4158f7
Branch: refs/heads/ignite-37
Commit: 4b4158f752ee1565539ca4977464f8d7ee6de40b
Parents: c60ed9b 3cc3fbe
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 20 19:23:04 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 20 19:23:04 2015 +0300
----------------------------------------------------------------------
dev-tools/build.gradle | 35 +-
dev-tools/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 51017 bytes
.../gradle/wrapper/gradle-wrapper.properties | 6 +
dev-tools/gradlew | 164 ++++++++++
dev-tools/src/main/groovy/jiraslurp.groovy | 326 ++++++++++++++-----
parent/pom.xml | 4 +
6 files changed, 442 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b4158f7/parent/pom.xml
----------------------------------------------------------------------
[26/50] [abbrv] incubator-ignite git commit: IGNITE-920 - Trigger TC.
Posted by sb...@apache.org.
IGNITE-920 - Trigger TC.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f1b5ecd1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f1b5ecd1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f1b5ecd1
Branch: refs/heads/ignite-37
Commit: f1b5ecd16dd2315bab79944f192dbf9a1113b81b
Parents: a927eb2
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Mon May 18 14:22:54 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Mon May 18 14:22:54 2015 -0700
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/internal/IgniteKernal.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f1b5ecd1/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 2d9828a..ffd264d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -118,7 +118,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
@GridToStringExclude
private GridKernalContextImpl ctx;
- /** */
+ /** Configuration. */
private IgniteConfiguration cfg;
/** */
[05/50] [abbrv] incubator-ignite git commit: ignite-430 Words count
Socket streamer examples
Posted by sb...@apache.org.
ignite-430 Words count Socket streamer examples
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d87efce0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d87efce0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d87efce0
Branch: refs/heads/ignite-37
Commit: d87efce0af1ad269ea1a4182329f441b6ff32122
Parents: 53995dc
Author: agura <ag...@gridgain.com>
Authored: Wed May 13 18:38:48 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:31 2015 +0300
----------------------------------------------------------------------
.../streaming/socket/SocketStreamerExample.java | 112 +++++++------------
.../socket/ZStringsSocketStreamerExample.java | 76 ++++++-------
.../examples/streaming/socket/package-info.java | 1 +
3 files changed, 75 insertions(+), 114 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d87efce0/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
index 73cb970..487572a 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
@@ -18,36 +18,30 @@
package org.apache.ignite.examples.streaming.socket;
import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.numbers.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.stream.*;
import org.apache.ignite.stream.adapters.*;
import org.apache.ignite.stream.socket.*;
-import javax.cache.processor.*;
import java.io.*;
import java.net.*;
import java.util.*;
/**
- * Streams random numbers into the streaming cache using {@link IgniteSocketStreamer}.
+ * Stream words into Ignite cache through socket using {@link IgniteSocketStreamer} and message size based protocol.
+ * <p>
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start streaming using {@link SocketStreamerExample}.</li>
- * <li>Start querying popular numbers using {@link QueryPopularNumbers}.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start streaming using {@link SocketStreamerExample}.</li>
+ * <li>Start querying popular numbers using {@link QueryWords}.</li>
* </ul>
* <p>
* You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class SocketStreamerExample {
- /** Random number generator. */
- private static final Random RAND = new Random();
-
- /** Range within which to generate numbers. */
- private static final int RANGE = 1000;
-
/** Port. */
private static final int PORT = 5555;
@@ -63,27 +57,13 @@ public class SocketStreamerExample {
return;
// The cache is configured with sliding window holding 1 second of the streaming data.
- IgniteCache<Integer, Long> stmCache = ignite.getOrCreateCache(CacheConfig.randomNumbersCache());
-
- try (IgniteDataStreamer<Integer, Long> stmr = ignite.dataStreamer(stmCache.getName())) {
- // Allow data updates.
- stmr.allowOverwrite(true);
-
- // Configure data transformation to count instances of the same word.
- stmr.receiver(new StreamTransformer<Integer, Long>() {
- @Override public Object process(MutableEntry<Integer, Long> e, Object... objects)
- throws EntryProcessorException {
- Long val = e.getValue();
-
- e.setValue(val == null ? 1L : val + 1);
-
- return null;
- }
- });
+ IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+ try (IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName())) {
InetAddress addr = InetAddress.getLocalHost();
- IgniteSocketStreamer<Tuple, Integer, Long> sockStmr = new IgniteSocketStreamer<>();
+ // Configure socket streamer
+ IgniteSocketStreamer<String, AffinityUuid, String> sockStmr = new IgniteSocketStreamer<>();
sockStmr.setAddr(addr);
@@ -93,9 +73,11 @@ public class SocketStreamerExample {
sockStmr.setStreamer(stmr);
- sockStmr.setTupleExtractor(new StreamTupleExtractor<Tuple, Integer, Long>() {
- @Override public Map.Entry<Integer, Long> extract(Tuple tuple) {
- return new IgniteBiTuple<>(tuple.key, tuple.cnt);
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
+ @Override public Map.Entry<AffinityUuid, String> extract(String word) {
+ // By using AffinityUuid we ensure that identical
+ // words are processed on the same cluster node.
+ return new IgniteBiTuple<>(new AffinityUuid(word), word);
}
});
@@ -114,45 +96,33 @@ public class SocketStreamerExample {
try (Socket sock = new Socket(addr, port);
OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
while (true) {
- try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bos)) {
- Tuple tuple = new Tuple(RAND.nextInt(RANGE), 1L);
-
- out.writeObject(tuple);
-
- byte[] arr = bos.toByteArray();
-
- oos.write(arr.length >>> 24);
- oos.write(arr.length >>> 16);
- oos.write(arr.length >>> 8);
- oos.write(arr.length);
-
- oos.write(arr);
+ try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
+ LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
+ for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
+ for (String word : line.split(" ")) {
+ if (!word.isEmpty()) {
+ // Stream words into Ignite through socket.
+ try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bos)) {
+
+ // Write message
+ out.writeObject(word);
+
+ byte[] arr = bos.toByteArray();
+
+ // Write message length
+ oos.write(arr.length >>> 24);
+ oos.write(arr.length >>> 16);
+ oos.write(arr.length >>> 8);
+ oos.write(arr.length);
+
+ oos.write(arr);
+ }
+ }
+ }
+ }
}
}
}
}
-
- /**
- * Tuple.
- */
- private static class Tuple implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0;
-
- /** Key. */
- private final int key;
-
- /** Count. */
- private final long cnt;
-
- /**
- * @param key Key.
- * @param cnt Count.
- */
- public Tuple(int key, long cnt) {
- this.key = key;
- this.cnt = cnt;
- }
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d87efce0/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
index a535c73..fa5aa28 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
@@ -18,40 +18,34 @@
package org.apache.ignite.examples.streaming.socket;
import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.numbers.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.stream.*;
import org.apache.ignite.stream.adapters.*;
import org.apache.ignite.stream.socket.*;
-import javax.cache.processor.*;
import java.io.*;
import java.net.*;
import java.util.*;
/**
- * Stream random numbers into the streaming cache using {@link IgniteSocketStreamer}.
+ * Stream words into Ignite cache through socket using {@link IgniteSocketStreamer} and message delimiter based
+ * protocol.
* <p>
* Example illustrates usage of TCP socket streamer in case of non-Java clients. In this example client streams
* zero-terminated strings.
* <p>
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start streaming using {@link ZStringsSocketStreamerExample}.</li>
- * <li>Start querying popular numbers using {@link QueryPopularNumbers}.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start streaming using {@link ZStringsSocketStreamerExample}.</li>
+ * <li>Start querying popular numbers using {@link QueryWords}.</li>
* </ul>
* <p>
* You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class ZStringsSocketStreamerExample {
- /** Random number generator. */
- private static final Random RAND = new Random();
-
- /** Range within which to generate numbers. */
- private static final int RANGE = 1000;
-
/** Port. */
private static final int PORT = 5555;
@@ -70,27 +64,13 @@ public class ZStringsSocketStreamerExample {
return;
// The cache is configured with sliding window holding 1 second of the streaming data.
- IgniteCache<Integer, Long> stmCache = ignite.getOrCreateCache(CacheConfig.randomNumbersCache());
-
- try (IgniteDataStreamer<Integer, Long> stmr = ignite.dataStreamer(stmCache.getName())) {
- // Allow data updates.
- stmr.allowOverwrite(true);
-
- // Configure data transformation to count instances of the same word.
- stmr.receiver(new StreamTransformer<Integer, Long>() {
- @Override public Object process(MutableEntry<Integer, Long> e, Object... objects)
- throws EntryProcessorException {
- Long val = e.getValue();
-
- e.setValue(val == null ? 1L : val + 1);
-
- return null;
- }
- });
+ IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+ try (IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName())) {
InetAddress addr = InetAddress.getLocalHost();
- IgniteSocketStreamer<String, Integer, Long> sockStmr = new IgniteSocketStreamer<>();
+ // Configure socket streamer
+ IgniteSocketStreamer<String, AffinityUuid, String> sockStmr = new IgniteSocketStreamer<>();
sockStmr.setAddr(addr);
@@ -114,10 +94,11 @@ public class ZStringsSocketStreamerExample {
}
});
- sockStmr.setTupleExtractor(new StreamTupleExtractor<String, Integer, Long>() {
- @Override public Map.Entry<Integer, Long> extract(String input) {
- String[] pair = input.split("=");
- return new IgniteBiTuple<>(Integer.parseInt(pair[0]), Long.parseLong(pair[1]));
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
+ @Override public Map.Entry<AffinityUuid, String> extract(String word) {
+ // By using AffinityUuid we ensure that identical
+ // words are processed on the same cluster node.
+ return new IgniteBiTuple<>(new AffinityUuid(word), word);
}
});
@@ -137,14 +118,23 @@ public class ZStringsSocketStreamerExample {
OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
while (true) {
- int key = RAND.nextInt(RANGE);
-
- String str = key + "=1";
-
- byte[] arr = str.getBytes("ASCII");
-
- oos.write(arr);
- oos.write(DELIM);
+ try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
+ LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
+ for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
+ for (String word : line.split(" ")) {
+ if (!word.isEmpty()) {
+ // Stream words into Ignite through socket.
+ byte[] arr = word.getBytes("ASCII");
+
+ // Write message
+ oos.write(arr);
+
+ // Write message delimiter
+ oos.write(DELIM);
+ }
+ }
+ }
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d87efce0/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
index ae7bdf9..d0a480a 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
@@ -16,6 +16,7 @@
*/
/**
+ * <!-- Package description. -->
* Contains {@link org.apache.ignite.stream.socket.IgniteSocketStreamer} usage examples.
*/
package org.apache.ignite.examples.streaming.socket;
\ No newline at end of file
[18/50] [abbrv] incubator-ignite git commit: # IGNITE-915:
Implemented.
Posted by sb...@apache.org.
# IGNITE-915: Implemented.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c3dde572
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c3dde572
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c3dde572
Branch: refs/heads/ignite-37
Commit: c3dde5726a84645d6d08b69099c644d250d0dbcb
Parents: 2149639
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon May 18 11:27:44 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon May 18 11:27:44 2015 +0300
----------------------------------------------------------------------
.../internal/interop/InteropIgnition.java | 65 +++++++++++++++++++-
.../internal/interop/InteropProcessor.java | 13 +++-
2 files changed, 76 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3dde572/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
index f245122..3ccd361 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
+import java.lang.ref.*;
import java.net.*;
import java.security.*;
import java.util.*;
@@ -52,9 +53,19 @@ public class InteropIgnition {
InteropBootstrap bootstrap = bootstrap(factoryId);
- return bootstrap.start(cfg, envPtr);
+ InteropProcessor proc = bootstrap.start(cfg, envPtr);
+
+ trackFinalization(proc);
+
+ return proc;
}
+ /**
+ * Create configuration.
+ *
+ * @param springCfgPath Path to Spring XML.
+ * @return Configuration.
+ */
private static IgniteConfiguration configuration(@Nullable String springCfgPath) {
try {
URL url = springCfgPath == null ? U.resolveIgniteUrl(IgnitionEx.DFLT_CFG) :
@@ -95,6 +106,58 @@ public class InteropIgnition {
}
/**
+ * Track processor finalization.
+ *
+ * @param proc Processor.
+ */
+ private static void trackFinalization(InteropProcessor proc) {
+ Thread thread = new Thread(new Finalizer(proc));
+
+ thread.setDaemon(true);
+
+ thread.start();
+ }
+
+ /**
+ * Finalizer runnable.
+ */
+ private static class Finalizer implements Runnable {
+ /** Queue where we expect notification to appear. */
+ private final ReferenceQueue<InteropProcessor> queue;
+
+ /** Phantom reference to processor. */
+ private final PhantomReference<InteropProcessor> proc;
+
+ /** Cleanup runnable. */
+ private final Runnable cleanup;
+
+ /**
+ * Constructor.
+ *
+ * @param proc Processor.
+ */
+ public Finalizer(InteropProcessor proc) {
+ queue = new ReferenceQueue<>();
+
+ this.proc = new PhantomReference<>(proc, queue);
+
+ cleanup = proc.cleanupCallback();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ try {
+ queue.remove(0);
+
+ cleanup.run();
+ }
+ catch (InterruptedException ignore) {
+ // No-op.
+ }
+ }
+ }
+
+ /**
* Private constructor.
*/
private InteropIgnition() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3dde572/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
index 6c55296..aa4f877 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
@@ -17,9 +17,20 @@
package org.apache.ignite.internal.interop;
+import org.jetbrains.annotations.*;
+
/**
* Interop processor.
*/
public interface InteropProcessor {
- // No-op.
+ /**
+ * Get stop runnable to perform cleanup when interop is not longer used.
+ * <p/>
+ * <b>NOTE!</b> This runnable is called when current instance of interop processor is eligible for garbage
+ * collection. Therefore you should <b>never</b> store any references to Ignite internal inside it. Otherwise
+ * this runnable will never be called.
+ *
+ * @return Stop runnable. If {@code null} is returned, then no cleanup is expected.
+ */
+ @Nullable public Runnable cleanupCallback();
}
[27/50] [abbrv] incubator-ignite git commit: Filenames fix
Posted by sb...@apache.org.
Filenames fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4423a465
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4423a465
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4423a465
Branch: refs/heads/ignite-37
Commit: 4423a4655c03936bb48fb70b713240aefa3f4219
Parents: 9c30fba
Author: avinogradov <av...@gridgain.com>
Authored: Tue May 19 16:42:08 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue May 19 16:42:08 2015 +0300
----------------------------------------------------------------------
LICENSE | 238 +++++++++++++++++++++++++++++++++++++++++
LICENSE.txt | 238 -----------------------------------------
NOTICE | 12 +++
NOTICE.txt | 12 ---
assembly/release-base.xml | 4 +-
5 files changed, 252 insertions(+), 252 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4423a465/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..7649b39
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,238 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
+
+
+==============================================================================
+Apache Ignite (incubating) Subcomponents:
+
+The Apache Ignite project contains subcomponents with separate copyright
+notices and license terms. Your use of the source code for the these
+subcomponents is subject to the terms and conditions of the following
+licenses.
+
+
+==============================================================================
+For SnapTree:
+==============================================================================
+This product bundles SnapTree, which is available under a
+"3-clause BSD" license. For details, see
+https://github.com/nbronson/snaptree/blob/master/LICENSE.
+
+==============================================================================
+For JSR 166 classes in "org.jsr166" package
+==============================================================================
+This product bundles JSR-166 classes which are donated to public domain.
+For details, see CC0 1.0 Universal (1.0), Public Domain Dedication,
+http://creativecommons.org/publicdomain/zero/1.0/
+
+==============================================================================
+For books used for tests in "org.apache.ignite.internal.processors.hadoop.books"
+==============================================================================
+This code bundles book text files used for testing purposes which contain
+the following header:
+
+This eBook is for the use of anyone anywhere at no cost and with
+almost no restrictions whatsoever. You may copy it, give it away or
+re-use it under the terms of the Project Gutenberg License included
+with this eBook or online at www.gutenberg.org
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4423a465/LICENSE.txt
----------------------------------------------------------------------
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 7649b39..0000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,238 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-
-==============================================================================
-Apache Ignite (incubating) Subcomponents:
-
-The Apache Ignite project contains subcomponents with separate copyright
-notices and license terms. Your use of the source code for the these
-subcomponents is subject to the terms and conditions of the following
-licenses.
-
-
-==============================================================================
-For SnapTree:
-==============================================================================
-This product bundles SnapTree, which is available under a
-"3-clause BSD" license. For details, see
-https://github.com/nbronson/snaptree/blob/master/LICENSE.
-
-==============================================================================
-For JSR 166 classes in "org.jsr166" package
-==============================================================================
-This product bundles JSR-166 classes which are donated to public domain.
-For details, see CC0 1.0 Universal (1.0), Public Domain Dedication,
-http://creativecommons.org/publicdomain/zero/1.0/
-
-==============================================================================
-For books used for tests in "org.apache.ignite.internal.processors.hadoop.books"
-==============================================================================
-This code bundles book text files used for testing purposes which contain
-the following header:
-
-This eBook is for the use of anyone anywhere at no cost and with
-almost no restrictions whatsoever. You may copy it, give it away or
-re-use it under the terms of the Project Gutenberg License included
-with this eBook or online at www.gutenberg.org
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4423a465/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..298d05b
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,12 @@
+Apache Ignite (incubating)
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
+This software includes code from IntelliJ IDEA Community Edition
+Copyright (C) JetBrains s.r.o.
+https://www.jetbrains.com/idea/
+Licensed under Apache License, Version 2.0.
+http://search.maven.org/#artifactdetails%7Corg.jetbrains%7Cannotations%7C13.0%7Cjar
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4423a465/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
deleted file mode 100644
index 298d05b..0000000
--- a/NOTICE.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Apache Ignite (incubating)
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-
-This software includes code from IntelliJ IDEA Community Edition
-Copyright (C) JetBrains s.r.o.
-https://www.jetbrains.com/idea/
-Licensed under Apache License, Version 2.0.
-http://search.maven.org/#artifactdetails%7Corg.jetbrains%7Cannotations%7C13.0%7Cjar
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4423a465/assembly/release-base.xml
----------------------------------------------------------------------
diff --git a/assembly/release-base.xml b/assembly/release-base.xml
index 88f1d10..21c4518 100644
--- a/assembly/release-base.xml
+++ b/assembly/release-base.xml
@@ -23,12 +23,12 @@
http://maven.apache.org/xsd/component-1.1.2.xsd">
<files>
<file>
- <source>LICENSE.txt</source>
+ <source>LICENSE</source>
<outputDirectory>/</outputDirectory>
</file>
<file>
- <source>NOTICE.txt</source>
+ <source>NOTICE</source>
<outputDirectory>/</outputDirectory>
</file>
[31/50] [abbrv] incubator-ignite git commit: Merge branch ignite-920
into ignite-sprint-5
Posted by sb...@apache.org.
Merge branch ignite-920 into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f9a4dd7f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f9a4dd7f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f9a4dd7f
Branch: refs/heads/ignite-37
Commit: f9a4dd7f580abc3d66630531bb66c3bf4d75d1d8
Parents: 02d0acd
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Tue May 19 11:16:27 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Tue May 19 11:16:27 2015 -0700
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheIoManager.java | 1 +
.../distributed/near/GridNearTxPrepareFutureAdapter.java | 9 +++++++--
.../processors/cache/IgniteCacheNearLockValueSelfTest.java | 1 +
3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9a4dd7f/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 d5dd492..02f16c0 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
@@ -487,6 +487,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
req.futureId(),
req.miniId(),
req.version(),
+ req.version(),
null, null, null);
res.error(req.classError());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9a4dd7f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
index 60b918c..b7a2fee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
@@ -214,10 +214,15 @@ public abstract class GridNearTxPrepareFutureAdapter extends GridCompoundIdentit
}
if (!m.empty()) {
+ GridCacheVersion writeVer = res.writeVersion();
+
+ if (writeVer == null)
+ writeVer = res.dhtVersion();
+
// Register DHT version.
- tx.addDhtVersion(m.node().id(), res.dhtVersion());
+ tx.addDhtVersion(m.node().id(), res.dhtVersion(), writeVer);
- m.dhtVersion(res.dhtVersion());
+ m.dhtVersion(res.dhtVersion(), writeVer);
if (m.near())
tx.readyNearLocks(m, res.pending(), res.committedVersions(), res.rolledbackVersions());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9a4dd7f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
index fe60331..5cc9d04 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
[13/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/94e202aa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/94e202aa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/94e202aa
Branch: refs/heads/ignite-37
Commit: 94e202aa7046de67a2c0e0da4230d424e1c95705
Parents: ee40819 15aa1cf
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri May 15 17:53:29 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 15 17:53:29 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/internal/IgnitionEx.java | 136 ++++++-------------
.../internal/interop/InteropBootstrap.java | 34 +++++
.../interop/InteropBootstrapFactory.java | 39 ++++++
.../internal/interop/InteropIgnition.java | 103 ++++++++++++++
.../internal/interop/InteropProcessor.java | 25 ++++
5 files changed, 240 insertions(+), 97 deletions(-)
----------------------------------------------------------------------
[45/50] [abbrv] incubator-ignite git commit: # ignite-456: second part
Posted by sb...@apache.org.
# ignite-456: second part
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4a23c2c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4a23c2c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4a23c2c8
Branch: refs/heads/ignite-37
Commit: 4a23c2c830b5dd5276e5b70a08b170a62060637b
Parents: 3cc3fbe
Author: null <null>
Authored: Thu May 21 13:56:37 2015 +0300
Committer: null <null>
Committed: Thu May 21 13:56:37 2015 +0300
----------------------------------------------------------------------
dev-tools/build.gradle | 2 +-
dev-tools/src/main/groovy/jiraslurp.groovy | 213 ++++++++++++++++++------
2 files changed, 159 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a23c2c8/dev-tools/build.gradle
----------------------------------------------------------------------
diff --git a/dev-tools/build.gradle b/dev-tools/build.gradle
index 164a775..10f9b64 100644
--- a/dev-tools/build.gradle
+++ b/dev-tools/build.gradle
@@ -36,7 +36,7 @@ task help {
}
task slurp(dependsOn: 'classes', type: JavaExec) {
- args(project.buildDir, "slurp,${System.getenv('TEST_BUILDS')}")
+ args(project.buildDir)
main = 'jiraslurp'
classpath = sourceSets.main.runtimeClasspath
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a23c2c8/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index 34ac79c..0b8f090 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -19,7 +19,8 @@
* attachments to process.
*/
final GIT_REPO = "https://git1-us-west.apache.org/repos/asf/incubator-ignite.git"
-final ATTACHMENT_URL = "https://issues.apache.org/jira/secure/attachment"
+final JIRA_URL = "https://issues.apache.org"
+final ATTACHMENT_URL = "$JIRA_URL/jira/secure/attachment"
final validated_filename = "${System.getProperty("user.home")}/validated-jira.txt"
final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_PatchChecker/.lastSuccessful/$validated_filename"
@@ -119,8 +120,6 @@ def checkForAttachments = {
* Monitors given process and show errors if exist.
*/
def checkprocess = { process ->
- println process.text
-
process.waitFor()
if (process.exitValue() != 0) {
@@ -179,65 +178,162 @@ def JIRA_xml = { jiranum ->
}
/**
- * Runs all given test builds to validate last patch from given jira.
+ * Gets all builds from TC project.
*/
-def runAllTestBuilds = { builds, jiraNum ->
- assert jiraNum != 'null', 'Jira number should not be null.'
- assert jiraNum != null, 'Jira number should not be null.'
+def getTestBuilds = { ->
+ def projName = System.getenv('PROJECT_NAME')
- if (jiraNum) {
- def tcURL = System.getenv('TC_URL')
- def user = System.getenv('TASK_RUNNER_USER')
- def pwd = System.getenv('TASK_RUNNER_PWD')
+ if (projName == null || projName == 'null')
+ projName = "Ignite"
- builds.each {
- try {
- println "Triggering $it build for $jiraNum jira..."
+ def tcURL = System.getenv('TC_URL')
+ def excludeListProp = System.getenv('BUILD_ID_EXCLUDES')
+ def excludeList = excludeListProp?.split(' ') as List
- String postData =
- "<build>" +
- " <buildType id='$it'/>" +
- " <properties>" +
- " <property name='JIRA_NUM' value='$jiraNum'/>" +
- " </properties>" +
- "</build>";
+ if (excludeList == null || excludeList == 'null')
+ excludeList = ["Ignite_RunAllTestBuilds"]
+
+ def project = new XmlSlurper().parse("http://$tcURL:80/guestAuth/app/rest/projects/id:$projName")
+
+ def buildIds = []
- URL url = new URL("http://$tcURL:80/httpAuth/app/rest/buildQueue");
+ def count = Integer.valueOf(project.buildTypes.@count as String)
+
+ for (int i = 0; i < count; i++) {
+ def id = project.buildTypes.buildType[i].@id
+
+ if (excludeList == null || !excludeList.contains(id))
+ buildIds.add(id)
+ }
+
+ buildIds
+}
+
+/**
+ * Util method to send post request.
+ */
+def sendPostRequest = { urlString, user, pwd, postData, contentType ->
+ URL url = new URL(urlString as String);
- HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+ HttpURLConnection conn = (HttpURLConnection)url.openConnection();
- String encoded = new sun.misc.BASE64Encoder().encode("$user:$pwd".getBytes());
+ String encoded = new sun.misc.BASE64Encoder().encode("$user:$pwd".getBytes());
+
+ conn.setRequestProperty("Authorization", "Basic " + encoded);
+
+ conn.setDoOutput(true);
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", contentType);
+ conn.setRequestProperty("Content-Length", String.valueOf(postData.length()));
+
+ OutputStream os = conn.getOutputStream();
+ os.write(postData.getBytes());
+ os.flush();
+ os.close();
+
+ conn.connect();
+
+ // Read response.
+ BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ String response = "";
+ String line;
+
+ while ((line = br.readLine()) != null)
+ response += line
+
+ br.close();
+
+ response
+}
+
+/**
+ * Adds comment to jira ticket.
+ */
+def addJiraComment = { jiraNum, comment ->
+ def user = System.getenv('JIRA_USER')
+ def pwd = System.getenv('JIRA_PWD')
+
+ try {
+ println "Comment: $comment"
- conn.setRequestProperty("Authorization", "Basic " + encoded);
+ def jsonComment = "{\n \"body\": \"${comment}\"\n}";
- conn.setDoOutput(true);
- conn.setRequestMethod("POST");
- conn.setRequestProperty("Content-Type", "application/xml");
- conn.setRequestProperty("Content-Length", String.valueOf(postData.length()));
+ def response = sendPostRequest(
+ "$JIRA_URL/jira/rest/api/2/issue/$jiraNum/comment" as String,
+ user,
+ pwd,
+ jsonComment,
+ "application/json")
- OutputStream os = conn.getOutputStream();
- os.write(postData.getBytes());
- os.flush();
- os.close();
+ println "Response: $response"
+ }
+ catch (Exception e) {
+ e.printStackTrace()
+ }
+}
- conn.connect();
+/**
+ * Runs all given test builds to validate last patch from given jira.
+ */
+def runAllTestBuilds = {builds, jiraNum ->
+ def tcURL = System.getenv('TC_URL')
+ def user = System.getenv('TASK_RUNNER_USER')
+ def pwd = System.getenv('TASK_RUNNER_PWD')
- // Read response.
- print "Response: "
+ def triggeredBuilds = [:]
- BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+ builds.each {
+ try {
+ println "Triggering $it build for $jiraNum jira..."
- String line;
- while ((line = br.readLine()) != null)
- println line
+ String postData
- br.close();
+ if (jiraNum == 'null' || jiraNum == null) {
+ postData = "<build>" +
+ " <buildType id='$it'/>" +
+ "</build>";
}
- catch (Exception e) {
- e.printStackTrace()
+ else {
+ postData = "<build>" +
+ " <buildType id='$it'/>" +
+ " <properties>" +
+ " <property name='env.JIRA_NUM' value='$jiraNum'/>" +
+ " </properties>" +
+ "</build>";
}
+
+ println "Request: $postData"
+
+ def response = sendPostRequest(
+ "http://$tcURL:80/httpAuth/app/rest/buildQueue" as String,
+ user,
+ pwd,
+ postData,
+ "application/xml")
+
+ println "Response: $response"
+
+ def build = new XmlSlurper().parseText(response)
+
+ println "Triggered build: ${build.buildType.@name}"
+ println "Triggered build url: ${build.@webUrl}"
+ println "Triggered build branch: ${build.@branchName}"
+
+ triggeredBuilds.put(build.buildType.@name, build.@webUrl)
+ }
+ catch (Exception e) {
+ e.printStackTrace()
}
}
+
+ def triggeredBuildsComment = "There was triggered next test builds for last attached patch-file:\\n"
+
+ triggeredBuilds.each { name, url ->
+ triggeredBuildsComment += "${name as String} - ${url as String}\\n"
+ }
+
+ addJiraComment(jiraNum, triggeredBuildsComment)
}
/**
@@ -250,22 +346,30 @@ args.each {
println parameters
- if (parameters.length == 2 && parameters[0] == "slurp" && parameters[1] != 'null') {
- def builds = parameters[1].split(' ');
-
- println "Running in 'slurp' mode. Test builds=${builds}"
+ if (parameters.length >= 1 && parameters[0] == "slurp") {
+ println "Running in 'slurp' mode."
checkForAttachments()
+ def builds = getTestBuilds()
+
+ println "Test builds to be triggered=$builds"
+
// For each ticket with new attachment, let's trigger remove build
jirasAttached.each { k, v ->
// Trailing slash is important for download; only need to pass JIRA number
println "Triggering the test builds for: $k = $ATTACHMENT_URL/$v/"
- runAllTestBuilds(builds,k)
+ runAllTestBuilds(builds, k)
}
}
- else if (parameters.length == 2 && parameters[0] == "patchApply" && parameters[1] ==~ /\w+-\d+/) {
+ else if (parameters.length > 1 && parameters[0] == "patchApply") {
+ if (parameters.length < 2 || parameters[1] !=~ /\w+-\d+/) {
+ println "There is no jira number to apply. Exit."
+
+ return
+ }
+
def jiraNum = parameters[1]
println "Running in 'patch apply' mode with jira number '$jiraNum'"
@@ -285,17 +389,16 @@ args.each {
applyPatch(jira, attachementURL)
}
}
- else if (parameters.length >= 2 && parameters[0] == "runAllBuilds" && parameters[1] ==~ /\w+-\d+/) {
+ else if (parameters.length > 1 && parameters[0] == "runAllBuilds" ) {
def jiraNum = parameters[1]
- def attachementURL=null
+ println "Running in 'all builds' mode with jira number='$jiraNum'."
- if (parameters[2] ==~ /\d+/)
- attachementURL = parameters[2]
+ def builds = getTestBuilds()
- println "Running in 'all builds' mode with jira number='$jiraNum' and attachment URL='$attachementURL'."
+ println "Test builds to be triggered=$builds"
- runAllTestBuilds jiraNum attachmentURL
+ runAllTestBuilds(builds, jiraNum)
}
}
[30/50] [abbrv] incubator-ignite git commit: Merge branch ignite-920
into ignite-sprint-5
Posted by sb...@apache.org.
Merge branch ignite-920 into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/02d0acd1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/02d0acd1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/02d0acd1
Branch: refs/heads/ignite-37
Commit: 02d0acd1d412914efdaf13c3ac0d798df74083b2
Parents: 26a713c f1b5ecd
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Tue May 19 11:16:12 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Tue May 19 11:16:12 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/internal/IgniteKernal.java | 26 +++-
.../processors/cache/GridCacheIoManager.java | 5 +-
.../GridCachePartitionExchangeManager.java | 4 +-
.../distributed/GridDistributedTxMapping.java | 5 +-
.../distributed/dht/GridDhtCacheAdapter.java | 6 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 1 +
.../dht/atomic/GridDhtAtomicCache.java | 4 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 42 ++++--
.../dht/atomic/GridNearAtomicUpdateRequest.java | 36 ++++-
.../colocated/GridDhtColocatedLockFuture.java | 4 +-
.../distributed/near/GridNearCacheEntry.java | 2 +-
.../cache/distributed/near/GridNearTxLocal.java | 5 +-
.../near/GridNearTxPrepareResponse.java | 28 +++-
.../transactions/IgniteTxLocalAdapter.java | 4 +-
.../cache/transactions/IgniteTxManager.java | 24 ++++
.../cache/IgniteCacheNearLockValueSelfTest.java | 144 +++++++++++++++++++
.../ignite/testsuites/IgniteCacheTestSuite.java | 2 +
17 files changed, 306 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d0acd1/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 9fd4e88,159a8d8..3fa3d9d
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@@ -153,6 -159,295 +153,8 @@@ public class IgniteCacheTestSuite exten
// suite.addTestSuite(GridCacheNearTxExceptionSelfTest.class);
// suite.addTestSuite(GridCacheStopSelfTest.class); TODO IGNITE-257
- // Local cache.
- suite.addTestSuite(GridCacheLocalBasicApiSelfTest.class);
- suite.addTestSuite(GridCacheLocalBasicStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalAtomicBasicStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalAtomicGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalLoadAllSelfTest.class);
- suite.addTestSuite(GridCacheLocalLockSelfTest.class);
- suite.addTestSuite(GridCacheLocalMultithreadedSelfTest.class);
- suite.addTestSuite(GridCacheLocalTxSingleThreadedSelfTest.class);
- suite.addTestSuite(GridCacheLocalTxTimeoutSelfTest.class);
- suite.addTestSuite(GridCacheLocalEventSelfTest.class);
- suite.addTestSuite(GridCacheLocalEvictionEventSelfTest.class);
- suite.addTestSuite(GridCacheVariableTopologySelfTest.class);
- suite.addTestSuite(GridCacheLocalTxMultiThreadedSelfTest.class);
- suite.addTestSuite(GridCacheTransformEventSelfTest.class);
- suite.addTestSuite(GridCacheLocalIsolatedNodesSelfTest.class);
-
- // Partitioned cache.
- suite.addTestSuite(GridCachePartitionedGetSelfTest.class);
- suite.addTest(new TestSuite(GridCachePartitionedBasicApiTest.class));
- suite.addTest(new TestSuite(GridCacheNearMultiGetSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearJobExecutionSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearOneNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicNearMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearReadersSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicNearReadersSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAffinitySelfTest.class));
- suite.addTest(new TestSuite(GridCacheRendezvousAffinityFunctionExcludeNeighborsSelfTest.class));
- suite.addTest(new TestSuite(GridCacheRendezvousAffinityClientSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedProjectionAffinitySelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedBasicOpSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedBasicStoreSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedGetAndTransformStoreSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAtomicGetAndTransformStoreSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedBasicStoreMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedEventSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedLockSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedMultiNodeLockSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedMultiThreadedPutGetSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedNodeFailureSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedExplicitLockNodeFailureSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedTxSingleThreadedSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedTxSingleThreadedSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedTxTimeoutSelfTest.class));
- suite.addTest(new TestSuite(GridCacheFinishPartitionsSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEntrySelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtInternalEntrySelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtMappingSelfTest.class));
-// suite.addTest(new TestSuite(GridCachePartitionedTxMultiThreadedSelfTest.class)); TODO-gg-4066
- suite.addTest(new TestSuite(GridCacheDhtPreloadSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadOffHeapSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadBigDataSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadPutGetSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadDisabledSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadMultiThreadedSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedPreloadRestartSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearPreloadRestartSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadStartStopSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadUnloadSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAffinityFilterSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedPreloadLifecycleSelfTest.class));
- suite.addTest(new TestSuite(CacheLoadingConcurrentGridStartSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadDelayedSelfTest.class));
- suite.addTest(new TestSuite(GridPartitionedBackupLoadSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedLoadCacheSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionNotLoadedEventSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEvictionsDisabledSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearEvictionEventSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicNearEvictionEventSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEvictionSelfTest.class));
- suite.addTest(new TestSuite(GridCacheReplicatedEvictionSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEvictionNearReadersSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtAtomicEvictionNearReadersSelfTest.class));
-// suite.addTest(new TestSuite(GridCachePartitionedTopologyChangeSelfTest.class)); TODO-gg-5489
- suite.addTest(new TestSuite(GridCachePartitionedPreloadEventsSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedUnloadEventsSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAffinityHashIdResolverSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedOptimisticTransactionSelfTest.class));
- suite.addTestSuite(GridCacheAtomicMessageCountSelfTest.class);
- suite.addTest(new TestSuite(GridCacheNearPartitionedClearSelfTest.class));
-
- suite.addTest(new TestSuite(GridCacheDhtExpiredEntriesPreloadSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearExpiredEntriesPreloadSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicExpiredEntriesPreloadSelfTest.class));
-
- suite.addTest(new TestSuite(GridCacheOffheapUpdateSelfTest.class));
-
- // TODO: GG-7242, GG-7243: Enabled when fixed.
-// suite.addTest(new TestSuite(GridCacheDhtRemoveFailureTest.class));
-// suite.addTest(new TestSuite(GridCacheNearRemoveFailureTest.class));
- // TODO: GG-7201: Enable when fixed.
- //suite.addTest(new TestSuite(GridCacheDhtAtomicRemoveFailureTest.class));
-
- suite.addTest(new TestSuite(GridCacheNearPrimarySyncSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedPrimarySyncSelfTest.class));
-
- // Value consistency tests.
- suite.addTestSuite(GridCacheValueConsistencyAtomicSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyAtomicNearEnabledSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderNearEnabledSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyTransactionalSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyTransactionalNearEnabledSelfTest.class);
- suite.addTestSuite(GridCacheValueBytesPreloadingSelfTest.class);
-
- // Replicated cache.
- suite.addTestSuite(GridCacheReplicatedBasicApiTest.class);
- suite.addTestSuite(GridCacheReplicatedBasicOpSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedBasicStoreSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedAtomicGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedEventSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedSynchronousCommitTest.class);
-
- // TODO: GG-7437.
- // suite.addTestSuite(GridCacheReplicatedInvalidateSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedLockSelfTest.class);
- // TODO: enable when GG-7437 is fixed.
- //suite.addTestSuite(GridCacheReplicatedMultiNodeLockSelfTest.class);
- //suite.addTestSuite(GridCacheReplicatedMultiNodeSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedNodeFailureSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedTxSingleThreadedSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedTxTimeoutSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadOffHeapSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadLifecycleSelfTest.class);
- suite.addTestSuite(GridCacheSyncReplicatedPreloadSelfTest.class);
-
- suite.addTestSuite(GridCacheDeploymentSelfTest.class);
- suite.addTestSuite(GridCacheDeploymentOffHeapSelfTest.class);
-
- suite.addTestSuite(GridCachePutArrayValueSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedUnswapAdvancedSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedEvictionEventSelfTest.class);
- // TODO: GG-7569.
- // suite.addTestSuite(GridCacheReplicatedTxMultiThreadedSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadEventsSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadStartStopEventsSelfTest.class);
- // TODO: GG-7434
- // suite.addTestSuite(GridReplicatedTxPreloadTest.class);
-
- suite.addTestSuite(IgniteTxReentryNearSelfTest.class);
- suite.addTestSuite(IgniteTxReentryColocatedSelfTest.class);
-
- suite.addTestSuite(GridCacheOrderedPreloadingSelfTest.class);
-
- // Test for byte array value special case.
-// suite.addTestSuite(GridCacheLocalByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheNearPartitionedP2PEnabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheNearPartitionedP2PDisabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCachePartitionedOnlyP2PEnabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCachePartitionedOnlyP2PDisabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.class);
-
- // Near-only cache.
- suite.addTest(IgniteCacheNearOnlySelfTestSuite.suite());
-
- // Test cache with daemon nodes.
- suite.addTestSuite(GridCacheDaemonNodeLocalSelfTest.class);
- suite.addTestSuite(GridCacheDaemonNodePartitionedSelfTest.class);
- suite.addTestSuite(GridCacheDaemonNodeReplicatedSelfTest.class);
-
- // Write-behind.
- suite.addTest(IgniteCacheWriteBehindTestSuite.suite());
-
- // Transform.
- suite.addTestSuite(GridCachePartitionedTransformWriteThroughBatchUpdateSelfTest.class);
-
- suite.addTestSuite(GridCacheEntryVersionSelfTest.class);
- suite.addTestSuite(GridCacheVersionSelfTest.class);
-
- // Memory leak tests.
- suite.addTestSuite(GridCacheReferenceCleanupSelfTest.class);
- suite.addTestSuite(GridCacheReloadSelfTest.class);
-
- suite.addTestSuite(GridCacheMixedModeSelfTest.class);
-
- // Cache metrics.
- suite.addTest(IgniteCacheMetricsSelfTestSuite.suite());
-
- // Topology validator.
- suite.addTest(IgniteTopologyValidatorTestSuit.suite());
-
- // Eviction.
- suite.addTest(IgniteCacheEvictionSelfTestSuite.suite());
-
- // Iterators.
- suite.addTest(IgniteCacheIteratorsSelfTestSuite.suite());
-
- // Cache interceptor tests.
- suite.addTest(IgniteCacheInterceptorSelfTestSuite.suite());
-
- // Multi node update.
- suite.addTestSuite(GridCacheMultinodeUpdateSelfTest.class);
- // TODO: GG-5353.
- // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledSelfTest.class);
- // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.class);
- suite.addTestSuite(GridCacheMultinodeUpdateAtomicSelfTest.class);
- suite.addTestSuite(GridCacheMultinodeUpdateAtomicNearEnabledSelfTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicLoadAllTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalLoadAllTest.class);
- suite.addTestSuite(IgniteCacheTxLoadAllTest.class);
- suite.addTestSuite(IgniteCacheTxLocalLoadAllTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicLoaderWriterTest.class);
- suite.addTestSuite(IgniteCacheTxLoaderWriterTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicStoreSessionTest.class);
- suite.addTestSuite(IgniteCacheTxStoreSessionTest.class);
- suite.addTestSuite(IgniteCacheAtomicStoreSessionWriteBehindTest.class);
- suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheTxLocalNoReadThroughTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheTxNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheTxLocalNoLoadPreviousValueTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheTxLocalNoWriteThroughTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicPeekModesTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearPeekModesTest.class);
- suite.addTestSuite(IgniteCacheAtomicReplicatedPeekModesTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxNearPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxLocalPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxReplicatedPeekModesTest.class);
-
- // TODO: IGNITE-114.
- // suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class);
- // suite.addTestSuite(GridCacheVersionMultinodeTest.class);
-
- suite.addTestSuite(IgniteCacheNearReadCommittedTest.class);
- suite.addTestSuite(IgniteCacheAtomicCopyOnReadDisabledTest.class);
- suite.addTestSuite(IgniteCacheTxCopyOnReadDisabledTest.class);
-
- suite.addTestSuite(IgniteCacheTxPreloadNoWriteTest.class);
-
- suite.addTestSuite(IgniteDynamicCacheStartSelfTest.class);
- suite.addTestSuite(IgniteCacheDynamicStopSelfTest.class);
- suite.addTestSuite(IgniteCacheConfigurationTemplateTest.class);
- suite.addTestSuite(IgniteCacheConfigurationDefaultTemplateTest.class);
-
- suite.addTestSuite(GridCacheTxLoadFromStoreOnLockSelfTest.class);
-
- suite.addTestSuite(GridCacheMarshallingNodeJoinSelfTest.class);
-
- suite.addTestSuite(IgniteCacheJdbcBlobStoreNodeRestartTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicLocalStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderNearEnabledStoreValueTest.class);
- suite.addTestSuite(IgniteCacheTxLocalStoreValueTest.class);
- suite.addTestSuite(IgniteCacheTxStoreValueTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledStoreValueTest.class);
-
- suite.addTestSuite(IgniteCacheLockFailoverSelfTest.class);
- suite.addTestSuite(IgniteCacheMultiTxLockSelfTest.class);
-
- suite.addTestSuite(IgniteInternalCacheTypesTest.class);
-
- suite.addTestSuite(IgniteExchangeFutureHistoryTest.class);
-
- suite.addTestSuite(CacheNoValueClassOnServerNodeTest.class);
-
+ suite.addTestSuite(IgniteCacheNearLockValueSelfTest.class);
+
return suite;
}
}
[32/50] [abbrv] incubator-ignite git commit: "Version changed
Posted by sb...@apache.org.
"Version changed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fa07e18f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fa07e18f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fa07e18f
Branch: refs/heads/ignite-37
Commit: fa07e18f7583a5c4f306056dcba5dfd4fe60ac5d
Parents: f9a4dd7
Author: Ignite Teamcity <ig...@apache.org>
Authored: Wed May 20 13:22:53 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Wed May 20 13:22:53 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/resources/ignite.properties | 2 +-
pom.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fa07e18f/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 80bffed..aec41ea 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.0.4
+ignite.version=1.0.6-SNAPSHOT1.0.6
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fa07e18f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8886c8a..0c6d0ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -291,7 +291,7 @@
<substitution expression="${project.version}" />
</replaceregexp>
- <chmod dir="${basedir}/target/release-package" perm="755" includes="**/*.sh"/>
+ <chmod dir="${basedir}/target/release-package" perm="755" includes="**/*.sh" />
<zip destfile="${basedir}/target/bin/${ignite.zip.pattern}.zip" encoding="UTF-8">
<zipfileset dir="${basedir}/target/release-package" prefix="${ignite.zip.pattern}" filemode="755">
@@ -566,7 +566,7 @@
<include name="**/*" />
</fileset>
</copy>
- <copy file="${basedir}/KEYS" todir="${basedir}/target/site" failonerror="false"/>
+ <copy file="${basedir}/KEYS" todir="${basedir}/target/site" failonerror="false" />
</target>
</configuration>
</execution>
[34/50] [abbrv] incubator-ignite git commit: IGNITE-927 Revisit
license packaging
Posted by sb...@apache.org.
IGNITE-927
Revisit license packaging
IGNITE-926
Revisit artifacts namings
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/73679128
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/73679128
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/73679128
Branch: refs/heads/ignite-37
Commit: 736791283c0333316fed5957f6cc64d1645e480e
Parents: 4423a46
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 20 15:40:18 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 20 15:40:18 2015 +0300
----------------------------------------------------------------------
modules/ssh/licenses/jcraft-revised-bsd.txt | 28 --------------------
modules/tools/licenses/jodd-revised-bsd.txt | 21 ---------------
.../licenses/jcraft-revised-bsd.txt | 28 --------------------
pom.xml | 6 ++---
4 files changed, 3 insertions(+), 80 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73679128/modules/ssh/licenses/jcraft-revised-bsd.txt
----------------------------------------------------------------------
diff --git a/modules/ssh/licenses/jcraft-revised-bsd.txt b/modules/ssh/licenses/jcraft-revised-bsd.txt
deleted file mode 100644
index 3748f98..0000000
--- a/modules/ssh/licenses/jcraft-revised-bsd.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-3-clause BSD license
-------------------------------------------------------------------------------
-Copyright (c) 2002-2014 Atsuhiko Yamanaka, JCraft,Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the distribution.
-
- 3. The names of the authors may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
-INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73679128/modules/tools/licenses/jodd-revised-bsd.txt
----------------------------------------------------------------------
diff --git a/modules/tools/licenses/jodd-revised-bsd.txt b/modules/tools/licenses/jodd-revised-bsd.txt
deleted file mode 100644
index 129f3f0..0000000
--- a/modules/tools/licenses/jodd-revised-bsd.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Jodd software is released under Revised BSD License.
-
-Copyright (c) 2003-2014, Jodd Team All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
-and/or other materials provided with the distribution.
-
-Neither the name of the Jodd nor the names of its contributors may be used to endorse or promote products derived from this software without specific
-prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73679128/modules/visor-console/licenses/jcraft-revised-bsd.txt
----------------------------------------------------------------------
diff --git a/modules/visor-console/licenses/jcraft-revised-bsd.txt b/modules/visor-console/licenses/jcraft-revised-bsd.txt
deleted file mode 100644
index 3748f98..0000000
--- a/modules/visor-console/licenses/jcraft-revised-bsd.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-3-clause BSD license
-------------------------------------------------------------------------------
-Copyright (c) 2002-2014 Atsuhiko Yamanaka, JCraft,Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the distribution.
-
- 3. The names of the authors may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
-INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73679128/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cb790bd..29ef8ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,7 +39,7 @@
<ignite.site>scp://localhost:/home</ignite.site>
<ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
<!--fix <attachartifact>...< /> at apache-release profile if changed-->
- <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
+ <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-bin</ignite.zip.pattern>
</properties>
<scm>
@@ -490,8 +490,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}.zip" classifier="fabric" type="zip" />
- <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip" classifier="hadoop" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}-bin.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}-bin.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
[41/50] [abbrv] incubator-ignite git commit: 1.0.7-SNAPSHOT
Posted by sb...@apache.org.
1.0.7-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7e643723
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7e643723
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7e643723
Branch: refs/heads/ignite-37
Commit: 7e64372353b3aaf324c6e3e7ec1f616a4e6cdf25
Parents: 4b4158f
Author: Ignite Teamcity <ig...@apache.org>
Authored: Thu May 21 12:23:26 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Thu May 21 12:23:26 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
32 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 064b804..0c53874 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index a248f85..0f7f3e4 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index a6604f9..abb89a8 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 96b6542..2efa860 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 25d610e..5c8e07e 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index ed4aa8f..617b3f4 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 72d993f..2521bd1 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 58aed26..61c6583 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.0.6
+ignite.version=1.0.7
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 2357695..c7c1c00 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index bffe625..e7076c8 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 310ba31..b985167 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index b8111f1..44f6038 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 782f0c9..cc3d6de 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index d9caf79..b196a5e 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 3ac136c..d892755 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index d81c7cb..193a881 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index e02e601..3abb2dd 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index b07549f..671756f 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 4be6b4a..5a031ab 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 295d3de..f38c7e6 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 1a36beb..3e347c4 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 0cda51b..f4f1245 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index d2fdcef..ff62c67 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 8494ad0..c88dfcf 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index ba29b8a..c0c6f19 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 1e9f270..5f19e7e 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index b5f5b75..80c4faa 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 95eb6cf..517425b 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index edc45b6..e59f71f 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 1479e79..63bab5f 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 0c20fbb..d99a57b 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e643723/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 537b8f9..abd3ab8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[43/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Conflicts:
modules/core/src/main/resources/ignite.properties
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3100dcc4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3100dcc4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3100dcc4
Branch: refs/heads/ignite-37
Commit: 3100dcc49c5a981661c6191cd004b3cebd0d3217
Parents: f879a3d 7e64372
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu May 21 13:24:12 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu May 21 13:24:12 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
32 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
[11/50] [abbrv] incubator-ignite git commit: # minor
Posted by sb...@apache.org.
# minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7fa8abcc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7fa8abcc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7fa8abcc
Branch: refs/heads/ignite-37
Commit: 7fa8abcc8aee3fe038cb28e7666b49de6b7be796
Parents: 04774b5f
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri May 15 17:52:38 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 15 17:52:38 2015 +0300
----------------------------------------------------------------------
.../streaming/wordcount/socket/WordsSocketStreamerServer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7fa8abcc/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
index 6a8911c..9e68096 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
@@ -114,7 +114,7 @@ public class WordsSocketStreamerServer {
sockStmr.start();
}
catch (IgniteException e) {
- System.out.println("Streaming server didn't start due to an error: ");
+ System.err.println("Streaming server didn't start due to an error: ");
e.printStackTrace();
[09/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/04774b5f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/04774b5f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/04774b5f
Branch: refs/heads/ignite-37
Commit: 04774b5f2e2df2f83bef66d1a1c686662ebee04d
Parents: 896b426 9c30fba
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 15 12:12:02 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 15 12:12:02 2015 +0300
----------------------------------------------------------------------
.../ignite/spi/communication/tcp/TcpCommunicationSpi.java | 2 +-
.../ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java | 8 ++++----
pom.xml | 2 ++
3 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/04774b5f/pom.xml
----------------------------------------------------------------------
[10/50] [abbrv] incubator-ignite git commit: # IGNITE-904:
Implemented interop start routine.
Posted by sb...@apache.org.
# IGNITE-904: Implemented interop start routine.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/15aa1cfa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/15aa1cfa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/15aa1cfa
Branch: refs/heads/ignite-37
Commit: 15aa1cfac4bd30c1d613c941d5afc994f34aa8e3
Parents: 04774b5f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri May 15 17:28:34 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri May 15 17:28:34 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/internal/IgnitionEx.java | 136 ++++++-------------
.../internal/interop/InteropBootstrap.java | 34 +++++
.../interop/InteropBootstrapFactory.java | 39 ++++++
.../internal/interop/InteropIgnition.java | 103 ++++++++++++++
.../internal/interop/InteropProcessor.java | 25 ++++
5 files changed, 240 insertions(+), 97 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/15aa1cfa/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 8d88677..d54e06f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -532,22 +532,6 @@ public class IgnitionEx {
}
/**
- * Start Grid passing a closure which will modify configuration before it is passed to start routine.
- *
- * @param springCfgPath Spring config path.
- * @param gridName Grid name.
- * @param cfgClo Configuration closure.
- * @return Started Grid.
- * @throws IgniteCheckedException If failed.
- */
- public static Ignite startWithClosure(@Nullable String springCfgPath, @Nullable String gridName,
- IgniteClosure<IgniteConfiguration, IgniteConfiguration> cfgClo) throws IgniteCheckedException {
- URL url = U.resolveSpringUrl(springCfgPath);
-
- return start(url, gridName, null, cfgClo);
- }
-
- /**
* Loads all grid configurations specified within given Spring XML configuration file.
* <p>
* Usually Spring XML configuration file will contain only one Grid definition. Note that
@@ -734,7 +718,40 @@ public class IgnitionEx {
*/
public static Ignite start(URL springCfgUrl, @Nullable String gridName,
@Nullable GridSpringResourceContext springCtx) throws IgniteCheckedException {
- return start(springCfgUrl, gridName, springCtx, null);
+ A.notNull(springCfgUrl, "springCfgUrl");
+
+ boolean isLog4jUsed = U.gridClassLoader().getResource("org/apache/log4j/Appender.class") != null;
+
+ IgniteBiTuple<Object, Object> t = null;
+
+ if (isLog4jUsed) {
+ try {
+ t = U.addLog4jNoOpLogger();
+ }
+ catch (IgniteCheckedException ignore) {
+ isLog4jUsed = false;
+ }
+ }
+
+ Collection<Handler> savedHnds = null;
+
+ if (!isLog4jUsed)
+ savedHnds = U.addJavaNoOpLogger();
+
+ IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> cfgMap;
+
+ try {
+ cfgMap = loadConfigurations(springCfgUrl);
+ }
+ finally {
+ if (isLog4jUsed && t != null)
+ U.removeLog4jNoOpLogger(t);
+
+ if (!isLog4jUsed)
+ U.removeJavaNoOpLogger(savedHnds);
+ }
+
+ return startConfigurations(cfgMap, springCfgUrl, gridName, springCtx);
}
/**
@@ -780,73 +797,6 @@ public class IgnitionEx {
*/
public static Ignite start(InputStream springCfgStream, @Nullable String gridName,
@Nullable GridSpringResourceContext springCtx) throws IgniteCheckedException {
- return start(springCfgStream, gridName, springCtx, null);
- }
-
- /**
- * Internal Spring-based start routine.
- *
- * @param springCfgUrl Spring XML configuration file URL. This cannot be {@code null}.
- * @param gridName Grid name that will override default.
- * @param springCtx Optional Spring application context.
- * @param cfgClo Optional closure to change configuration before it is used to start the grid.
- * @return Started grid.
- * @throws IgniteCheckedException If failed.
- */
- private static Ignite start(final URL springCfgUrl, @Nullable String gridName,
- @Nullable GridSpringResourceContext springCtx,
- @Nullable IgniteClosure<IgniteConfiguration, IgniteConfiguration> cfgClo)
- throws IgniteCheckedException {
- A.notNull(springCfgUrl, "springCfgUrl");
-
- boolean isLog4jUsed = U.gridClassLoader().getResource("org/apache/log4j/Appender.class") != null;
-
- IgniteBiTuple<Object, Object> t = null;
-
- if (isLog4jUsed) {
- try {
- t = U.addLog4jNoOpLogger();
- }
- catch (IgniteCheckedException ignore) {
- isLog4jUsed = false;
- }
- }
-
- Collection<Handler> savedHnds = null;
-
- if (!isLog4jUsed)
- savedHnds = U.addJavaNoOpLogger();
-
- IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> cfgMap;
-
- try {
- cfgMap = loadConfigurations(springCfgUrl);
- }
- finally {
- if (isLog4jUsed && t != null)
- U.removeLog4jNoOpLogger(t);
-
- if (!isLog4jUsed)
- U.removeJavaNoOpLogger(savedHnds);
- }
-
- return startConfigurations(cfgMap, springCfgUrl, gridName, springCtx, cfgClo);
- }
-
- /**
- * Internal Spring-based start routine.
- *
- * @param springCfgStream Input stream containing Spring XML configuration. This cannot be {@code null}.
- * @param gridName Grid name that will override default.
- * @param springCtx Optional Spring application context.
- * @param cfgClo Optional closure to change configuration before it is used to start the grid.
- * @return Started grid.
- * @throws IgniteCheckedException If failed.
- */
- private static Ignite start(final InputStream springCfgStream, @Nullable String gridName,
- @Nullable GridSpringResourceContext springCtx,
- @Nullable IgniteClosure<IgniteConfiguration, IgniteConfiguration> cfgClo)
- throws IgniteCheckedException {
A.notNull(springCfgStream, "springCfgUrl");
boolean isLog4jUsed = U.gridClassLoader().getResource("org/apache/log4j/Appender.class") != null;
@@ -880,7 +830,7 @@ public class IgnitionEx {
U.removeJavaNoOpLogger(savedHnds);
}
- return startConfigurations(cfgMap, null, gridName, springCtx, cfgClo);
+ return startConfigurations(cfgMap, null, gridName, springCtx);
}
/**
@@ -890,7 +840,6 @@ public class IgnitionEx {
* @param springCfgUrl Spring XML configuration file URL.
* @param gridName Grid name that will override default.
* @param springCtx Optional Spring application context.
- * @param cfgClo Optional closure to change configuration before it is used to start the grid.
* @return Started grid.
* @throws IgniteCheckedException If failed.
*/
@@ -898,8 +847,7 @@ public class IgnitionEx {
IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> cfgMap,
URL springCfgUrl,
@Nullable String gridName,
- @Nullable GridSpringResourceContext springCtx,
- @Nullable IgniteClosure<IgniteConfiguration, IgniteConfiguration> cfgClo)
+ @Nullable GridSpringResourceContext springCtx)
throws IgniteCheckedException {
List<IgniteNamedInstance> grids = new ArrayList<>(cfgMap.size());
@@ -910,12 +858,6 @@ public class IgnitionEx {
if (cfg.getGridName() == null && !F.isEmpty(gridName))
cfg.setGridName(gridName);
- if (cfgClo != null) {
- cfg = cfgClo.apply(cfg);
-
- assert cfg != null;
- }
-
// Use either user defined context or our one.
IgniteNamedInstance grid = start0(
new GridStartContext(cfg, springCfgUrl, springCtx == null ? cfgMap.get2() : springCtx));
@@ -1600,9 +1542,9 @@ public class IgnitionEx {
igfsExecSvc, restExecSvc,
new CA() {
@Override public void apply() {
- startLatch.countDown();
- }
- });
+ startLatch.countDown();
+ }
+ });
state = STARTED;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/15aa1cfa/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
new file mode 100644
index 0000000..820bef9
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
@@ -0,0 +1,34 @@
+/*
+ * 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.interop;
+
+import org.apache.ignite.configuration.*;
+
+/**
+ * Interop bootstrap. Responsible for starting Ignite node in interop mode.
+ */
+public interface InteropBootstrap {
+ /**
+ * Start Ignite node.
+ *
+ * @param cfg Configuration.
+ * @param envPtr Environment pointer.
+ * @return Ignite node.
+ */
+ public InteropProcessor start(IgniteConfiguration cfg, long envPtr);
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/15aa1cfa/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrapFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrapFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrapFactory.java
new file mode 100644
index 0000000..b61ca89
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrapFactory.java
@@ -0,0 +1,39 @@
+/*
+ * 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.interop;
+
+import java.io.*;
+
+/**
+ * Interop bootstrap factory.
+ */
+public interface InteropBootstrapFactory extends Serializable {
+ /**
+ * Get bootstrap factory ID.
+ *
+ * @return ID.
+ */
+ public int id();
+
+ /**
+ * Create bootstrap instance.
+ *
+ * @return Bootstrap instance.
+ */
+ public InteropBootstrap create();
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/15aa1cfa/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
new file mode 100644
index 0000000..f245122
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
@@ -0,0 +1,103 @@
+/*
+ * 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.interop;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.resource.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.net.*;
+import java.security.*;
+import java.util.*;
+
+/**
+ * Entry point for interop nodes.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public class InteropIgnition {
+ /**
+ * Start Ignite node in interop mode.
+ *
+ * @param springCfgPath Spring configuration path.
+ * @param gridName Grid name.
+ * @param factoryId Factory ID.
+ * @param envPtr Environment pointer.
+ * @return Ignite instance.
+ */
+ public static InteropProcessor start(@Nullable String springCfgPath, @Nullable String gridName, int factoryId,
+ long envPtr) {
+ IgniteConfiguration cfg = configuration(springCfgPath);
+
+ if (gridName != null)
+ cfg.setGridName(gridName);
+
+ InteropBootstrap bootstrap = bootstrap(factoryId);
+
+ return bootstrap.start(cfg, envPtr);
+ }
+
+ private static IgniteConfiguration configuration(@Nullable String springCfgPath) {
+ try {
+ URL url = springCfgPath == null ? U.resolveIgniteUrl(IgnitionEx.DFLT_CFG) :
+ U.resolveSpringUrl(springCfgPath);
+
+ IgniteBiTuple<IgniteConfiguration, GridSpringResourceContext> t = IgnitionEx.loadConfiguration(url);
+
+ return t.get1();
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException("Failed to instantiate configuration from Spring XML: " + springCfgPath, e);
+ }
+ }
+
+ /**
+ * Create bootstrap for the given factory ID.
+ *
+ * @param factoryId Factory ID.
+ * @return Bootstrap.
+ */
+ private static InteropBootstrap bootstrap(final int factoryId) {
+ InteropBootstrapFactory factory = AccessController.doPrivileged(
+ new PrivilegedAction<InteropBootstrapFactory>() {
+ @Override public InteropBootstrapFactory run() {
+ for (InteropBootstrapFactory factory : ServiceLoader.load(InteropBootstrapFactory.class)) {
+ if (factory.id() == factoryId)
+ return factory;
+ }
+
+ return null;
+ }
+ });
+
+ if (factory == null)
+ throw new IgniteException("Interop factory is not found (did you put into the classpath?): " + factoryId);
+
+ return factory.create();
+ }
+
+ /**
+ * Private constructor.
+ */
+ private InteropIgnition() {
+ // No-op.
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/15aa1cfa/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
new file mode 100644
index 0000000..6c55296
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
@@ -0,0 +1,25 @@
+/*
+ * 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.interop;
+
+/**
+ * Interop processor.
+ */
+public interface InteropProcessor {
+ // No-op.
+}
[39/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Conflicts:
pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c60ed9b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c60ed9b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c60ed9b1
Branch: refs/heads/ignite-37
Commit: c60ed9b160adc5824dd72839fea24e523a71d512
Parents: c4d81fe cff73bf
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 20 19:22:46 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 20 19:22:46 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/java/META-INF/LICENSE | 238 +++++++++++++++++++++++
modules/core/src/main/java/META-INF/NOTICE | 12 ++
parent/pom.xml | 1 -
pom.xml | 37 +++-
4 files changed, 277 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c60ed9b1/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 0c6d0ba,26f5456..537b8f9
--- a/pom.xml
+++ b/pom.xml
@@@ -36,8 -36,10 +36,8 @@@
<packaging>pom</packaging>
<properties>
- <ignite.site>scp://localhost:/home</ignite.site>
- <ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
<!--fix <attachartifact>...< /> at apache-release profile if changed-->
- <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
+ <ignite.zip.pattern>${project.artifactId}-${ignite.edition}-${project.version}-bin</ignite.zip.pattern>
</properties>
<scm>
[06/50] [abbrv] incubator-ignite git commit: ignite-430 Words count
Socket streamer examples
Posted by sb...@apache.org.
ignite-430 Words count Socket streamer examples
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7ee85179
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7ee85179
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7ee85179
Branch: refs/heads/ignite-37
Commit: 7ee85179103df637ba594fab68755dee71b69997
Parents: d87efce
Author: agura <ag...@gridgain.com>
Authored: Wed May 13 20:56:22 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:34 2015 +0300
----------------------------------------------------------------------
.../ignite/examples/streaming/package-info.java | 1 -
.../streaming/socket/SocketStreamerExample.java | 128 --------
.../socket/WordsSocketStreamerClient.java | 86 +++++
.../socket/WordsSocketStreamerServer.java | 93 ++++++
.../socket/ZStringsSocketStreamerExample.java | 141 ---------
.../socket/ZWordsSocketStreamerClient.java | 81 +++++
.../socket/ZWordsSocketStreamerServer.java | 111 +++++++
.../examples/streaming/socket/package-info.java | 3 +-
.../streaming/wordcount/CacheConfig.java | 2 +-
.../streaming/wordcount/QueryWords.java | 2 +-
.../streaming/wordcount/StreamWords.java | 2 +-
.../streaming/wordcount/package-info.java | 1 -
.../org/apache/ignite/stream/StreamAdapter.java | 111 +++++++
.../ignite/stream/StreamTupleExtractor.java | 33 ++
.../ignite/stream/adapters/StreamAdapter.java | 111 -------
.../stream/adapters/StreamTupleExtractor.java | 33 --
.../ignite/stream/adapters/package-info.java | 21 --
.../stream/socket/IgniteSocketStreamer.java | 217 -------------
.../ignite/stream/socket/SocketStreamer.java | 218 +++++++++++++
.../socket/IgniteSocketStreamerSelfTest.java | 315 -------------------
.../stream/socket/SocketStreamerSelfTest.java | 315 +++++++++++++++++++
.../testsuites/IgniteStreamTestSuite.java | 2 +-
22 files changed, 1053 insertions(+), 974 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
index 43dea13..43fbab3 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
@@ -16,7 +16,6 @@
*/
/**
- * <!-- Package description. -->
* Demonstrates usage of data streamer.
*/
package org.apache.ignite.examples.streaming;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
deleted file mode 100644
index 487572a..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
+++ /dev/null
@@ -1,128 +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.examples.streaming.socket;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.wordcount.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.stream.adapters.*;
-import org.apache.ignite.stream.socket.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * Stream words into Ignite cache through socket using {@link IgniteSocketStreamer} and message size based protocol.
- * <p>
- * To start the example, you should:
- * <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start streaming using {@link SocketStreamerExample}.</li>
- * <li>Start querying popular numbers using {@link QueryWords}.</li>
- * </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
- */
-public class SocketStreamerExample {
- /** Port. */
- private static final int PORT = 5555;
-
- /**
- * @param args Args.
- */
- public static void main(String[] args) throws InterruptedException, IOException {
- // Mark this cluster member as client.
- Ignition.setClientMode(true);
-
- try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
- if (!ExamplesUtils.hasServerNodes(ignite))
- return;
-
- // The cache is configured with sliding window holding 1 second of the streaming data.
- IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
-
- try (IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName())) {
- InetAddress addr = InetAddress.getLocalHost();
-
- // Configure socket streamer
- IgniteSocketStreamer<String, AffinityUuid, String> sockStmr = new IgniteSocketStreamer<>();
-
- sockStmr.setAddr(addr);
-
- sockStmr.setPort(PORT);
-
- sockStmr.setIgnite(ignite);
-
- sockStmr.setStreamer(stmr);
-
- sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
- @Override public Map.Entry<AffinityUuid, String> extract(String word) {
- // By using AffinityUuid we ensure that identical
- // words are processed on the same cluster node.
- return new IgniteBiTuple<>(new AffinityUuid(word), word);
- }
- });
-
- sockStmr.start();
-
- sendData(addr, PORT);
- }
- }
- }
-
- /**
- * @param addr Address.
- * @param port Port.
- */
- private static void sendData(InetAddress addr, int port) throws IOException, InterruptedException {
- try (Socket sock = new Socket(addr, port);
- OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
- while (true) {
- try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
- LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
- for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
- for (String word : line.split(" ")) {
- if (!word.isEmpty()) {
- // Stream words into Ignite through socket.
- try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bos)) {
-
- // Write message
- out.writeObject(word);
-
- byte[] arr = bos.toByteArray();
-
- // Write message length
- oos.write(arr.length >>> 24);
- oos.write(arr.length >>> 16);
- oos.write(arr.length >>> 8);
- oos.write(arr.length);
-
- oos.write(arr);
- }
- }
- }
- }
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.java
new file mode 100644
index 0000000..c5ec079
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.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.examples.streaming.socket;
+
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+
+/**
+ * Sends words to socket server based on {@link SocketStreamer} using message size based protocol.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class WordsSocketStreamerClient {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws IOException {
+ InetAddress addr = InetAddress.getLocalHost();
+
+ try (Socket sock = new Socket(addr, PORT);
+ OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
+
+ System.out.println("Words streaming started.");
+
+ while (true) {
+ try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
+ LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
+ for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
+ for (String word : line.split(" ")) {
+ if (!word.isEmpty()) {
+ // Stream words into Ignite through socket.
+ try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bos)) {
+
+ // Write message
+ out.writeObject(word);
+
+ byte[] arr = bos.toByteArray();
+
+ // Write message length
+ oos.write(arr.length >>> 24);
+ oos.write(arr.length >>> 16);
+ oos.write(arr.length >>> 8);
+ oos.write(arr.length);
+
+ oos.write(arr);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java
new file mode 100644
index 0000000..5af746d
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java
@@ -0,0 +1,93 @@
+/*
+ * 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.examples.streaming.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.stream.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * Receives words through socket using {@link SocketStreamer} and message size based protocol
+ * and streams them into Ignite cache.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class WordsSocketStreamerServer {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws InterruptedException, IOException {
+ // Mark this cluster member as client.
+ Ignition.setClientMode(true);
+
+ Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
+
+ if (!ExamplesUtils.hasServerNodes(ignite)) {
+ ignite.close();
+
+ return;
+ }
+
+ // The cache is configured with sliding window holding 1 second of the streaming data.
+ IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+
+ IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
+
+ InetAddress addr = InetAddress.getLocalHost();
+
+ // Configure socket streamer
+ SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
+
+ sockStmr.setAddr(addr);
+
+ sockStmr.setPort(PORT);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
+ @Override public Map.Entry<AffinityUuid, String> extract(String word) {
+ // By using AffinityUuid we ensure that identical
+ // words are processed on the same cluster node.
+ return new IgniteBiTuple<>(new AffinityUuid(word), word);
+ }
+ });
+
+ sockStmr.start();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
deleted file mode 100644
index fa5aa28..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
+++ /dev/null
@@ -1,141 +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.examples.streaming.socket;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.wordcount.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.stream.adapters.*;
-import org.apache.ignite.stream.socket.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * Stream words into Ignite cache through socket using {@link IgniteSocketStreamer} and message delimiter based
- * protocol.
- * <p>
- * Example illustrates usage of TCP socket streamer in case of non-Java clients. In this example client streams
- * zero-terminated strings.
- * <p>
- * To start the example, you should:
- * <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start streaming using {@link ZStringsSocketStreamerExample}.</li>
- * <li>Start querying popular numbers using {@link QueryWords}.</li>
- * </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
- */
-public class ZStringsSocketStreamerExample {
- /** Port. */
- private static final int PORT = 5555;
-
- /** Delimiter. */
- private static final byte[] DELIM = new byte[] {0};
-
- /**
- * @param args Args.
- */
- public static void main(String[] args) throws InterruptedException, IOException {
- // Mark this cluster member as client.
- Ignition.setClientMode(true);
-
- try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
- if (!ExamplesUtils.hasServerNodes(ignite))
- return;
-
- // The cache is configured with sliding window holding 1 second of the streaming data.
- IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
-
- try (IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName())) {
- InetAddress addr = InetAddress.getLocalHost();
-
- // Configure socket streamer
- IgniteSocketStreamer<String, AffinityUuid, String> sockStmr = new IgniteSocketStreamer<>();
-
- sockStmr.setAddr(addr);
-
- sockStmr.setPort(PORT);
-
- sockStmr.setDelimiter(DELIM);
-
- sockStmr.setIgnite(ignite);
-
- sockStmr.setStreamer(stmr);
-
- // Converter from zero-terminated string to Java strings.
- sockStmr.setConverter(new SocketMessageConverter<String>() {
- @Override public String convert(byte[] msg) {
- try {
- return new String(msg, "ASCII");
- }
- catch (UnsupportedEncodingException e) {
- throw new IgniteException(e);
- }
- }
- });
-
- sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
- @Override public Map.Entry<AffinityUuid, String> extract(String word) {
- // By using AffinityUuid we ensure that identical
- // words are processed on the same cluster node.
- return new IgniteBiTuple<>(new AffinityUuid(word), word);
- }
- });
-
- sockStmr.start();
-
- sendData(addr, PORT);
- }
- }
- }
-
- /**
- * @param addr Address.
- * @param port Port.
- */
- private static void sendData(InetAddress addr, int port) throws IOException, InterruptedException {
- try (Socket sock = new Socket(addr, port);
- OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
-
- while (true) {
- try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
- LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
- for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
- for (String word : line.split(" ")) {
- if (!word.isEmpty()) {
- // Stream words into Ignite through socket.
- byte[] arr = word.getBytes("ASCII");
-
- // Write message
- oos.write(arr);
-
- // Write message delimiter
- oos.write(DELIM);
- }
- }
- }
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java
new file mode 100644
index 0000000..c17ccdc
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java
@@ -0,0 +1,81 @@
+/*
+ * 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.examples.streaming.socket;
+
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+
+/**
+ * Sends words to socket server based on {@link SocketStreamer} using message delimiter based protocol.
+ * Example illustrates usage of TCP socket streamer in case of non-Java clients.
+ * In this example words are zero-terminated strings.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start socket server using {@link ZWordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link ZWordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class ZWordsSocketStreamerClient {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0};
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws IOException {
+ InetAddress addr = InetAddress.getLocalHost();
+
+ try (Socket sock = new Socket(addr, PORT);
+ OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
+
+ System.out.println("Words streaming started.");
+
+ while (true) {
+ try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
+ LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
+ for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
+ for (String word : line.split(" ")) {
+ if (!word.isEmpty()) {
+ // Stream words into Ignite through socket.
+ byte[] arr = word.getBytes("ASCII");
+
+ // Write message
+ oos.write(arr);
+
+ // Write message delimiter
+ oos.write(DELIM);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java
new file mode 100644
index 0000000..a0ef9da
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java
@@ -0,0 +1,111 @@
+/*
+ * 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.examples.streaming.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.stream.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * Receives words through socket using {@link SocketStreamer} and message delimiter based protocol
+ * and streams them into Ignite cache. Example illustrates usage of TCP socket streamer in case of non-Java clients.
+ * In this example words are zero-terminated strings.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start socket server using {@link ZWordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link ZWordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class ZWordsSocketStreamerServer {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0};
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws InterruptedException, IOException {
+ // Mark this cluster member as client.
+ Ignition.setClientMode(true);
+
+ Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
+
+ if (!ExamplesUtils.hasServerNodes(ignite)) {
+ ignite.close();
+
+ return;
+ }
+
+ // The cache is configured with sliding window holding 1 second of the streaming data.
+ IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+
+ IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
+
+ InetAddress addr = InetAddress.getLocalHost();
+
+ // Configure socket streamer
+ SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
+
+ sockStmr.setAddr(addr);
+
+ sockStmr.setPort(PORT);
+
+ sockStmr.setDelimiter(DELIM);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ // Converter from zero-terminated string to Java strings.
+ sockStmr.setConverter(new SocketMessageConverter<String>() {
+ @Override public String convert(byte[] msg) {
+ try {
+ return new String(msg, "ASCII");
+ }
+ catch (UnsupportedEncodingException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
+ @Override public Map.Entry<AffinityUuid, String> extract(String word) {
+ // By using AffinityUuid we ensure that identical
+ // words are processed on the same cluster node.
+ return new IgniteBiTuple<>(new AffinityUuid(word), word);
+ }
+ });
+
+ sockStmr.start();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
index d0a480a..c516ab4 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
@@ -16,7 +16,6 @@
*/
/**
- * <!-- Package description. -->
- * Contains {@link org.apache.ignite.stream.socket.IgniteSocketStreamer} usage examples.
+ * Contains {@link org.apache.ignite.stream.socket.SocketStreamer} usage examples.
*/
package org.apache.ignite.examples.streaming.socket;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
index 58704ca..d17b97d 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
@@ -26,7 +26,7 @@ import javax.cache.expiry.*;
import static java.util.concurrent.TimeUnit.*;
/**
- * Configuration for the streaming cache to store the stream of random numbers.
+ * Configuration for the streaming cache to store the stream of words.
* This cache is configured with sliding window of 1 second, which means that
* data older than 1 second will be automatically removed from the cache.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
index 3bd9d3d..149aa79 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
@@ -30,7 +30,7 @@ import java.util.*;
* <ul>
* <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
* <li>Start streaming using {@link StreamWords}.</li>
- * <li>Start querying popular numbers using {@link QueryWords}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
* <p>
* You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
index c59fa51..cc3c0cb 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
@@ -29,7 +29,7 @@ import java.io.*;
* <ul>
* <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
* <li>Start streaming using {@link StreamWords}.</li>
- * <li>Start querying popular numbers using {@link QueryWords}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
* <p>
* You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
index 010f86a..5d48ae3 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
@@ -16,7 +16,6 @@
*/
/**
- * <!-- Package description. -->
* Streaming word count example.
*/
package org.apache.ignite.examples.streaming.wordcount;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java
new file mode 100644
index 0000000..0c4e2d1
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java
@@ -0,0 +1,111 @@
+/*
+ * 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.stream;
+
+import org.apache.ignite.*;
+
+import java.util.*;
+
+/**
+ * Convenience adapter for streamers. Adapters are optional components for
+ * streaming from different data sources. The purpose of adapters is to
+ * convert different message formats into Ignite stream key-value tuples
+ * and feed the tuples into the provided {@link org.apache.ignite.IgniteDataStreamer}.
+ */
+public abstract class StreamAdapter<T, K, V> {
+ /** Tuple extractor. */
+ private StreamTupleExtractor<T, K, V> extractor;
+
+ /** Streamer. */
+ private IgniteDataStreamer<K, V> stmr;
+
+ /** Ignite. */
+ private Ignite ignite;
+
+ /**
+ * Empty constructor.
+ */
+ protected StreamAdapter() {
+ // No-op.
+ }
+
+ /**
+ * Stream adapter.
+ *
+ * @param stmr Streamer.
+ * @param extractor Tuple extractor.
+ */
+ protected StreamAdapter(IgniteDataStreamer<K, V> stmr, StreamTupleExtractor<T, K, V> extractor) {
+ this.stmr = stmr;
+ this.extractor = extractor;
+ }
+
+ /**
+ * @return Provided data streamer.
+ */
+ public IgniteDataStreamer<K, V> getStreamer() {
+ return stmr;
+ }
+
+ /**
+ * @param stmr Ignite data streamer.
+ */
+ public void setStreamer(IgniteDataStreamer<K, V> stmr) {
+ this.stmr = stmr;
+ }
+
+ /**
+ * @return Provided tuple extractor.
+ */
+ public StreamTupleExtractor<T, K, V> getTupleExtractor() {
+ return extractor;
+ }
+
+ /**
+ * @param extractor Extractor for key-value tuples from messages.
+ */
+ public void setTupleExtractor(StreamTupleExtractor<T, K, V> extractor) {
+ this.extractor = extractor;
+ }
+
+ /**
+ * @return Provided {@link Ignite} instance.
+ */
+ public Ignite getIgnite() {
+ return ignite;
+ }
+
+ /**
+ * @param ignite {@link Ignite} instance.
+ */
+ public void setIgnite(Ignite ignite) {
+ this.ignite = ignite;
+ }
+
+ /**
+ * Converts given message to a tuple and adds it to the underlying streamer.
+ *
+ * @param msg Message to convert.
+ */
+ protected void addMessage(T msg) {
+ Map.Entry<K, V> e = extractor.extract(msg);
+
+ if (e != null)
+ stmr.addData(e);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/main/java/org/apache/ignite/stream/StreamTupleExtractor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/StreamTupleExtractor.java b/modules/core/src/main/java/org/apache/ignite/stream/StreamTupleExtractor.java
new file mode 100644
index 0000000..d2a4ede
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamTupleExtractor.java
@@ -0,0 +1,33 @@
+/*
+ * 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.stream;
+
+import java.util.*;
+
+/**
+ * Stream tuple extractor to convert messages to Ignite key-value tuples.
+ */
+public interface StreamTupleExtractor<T, K, V> {
+ /**
+ * Extracts a key-value tuple from a message.
+ *
+ * @param msg Message.
+ * @return Key-value tuple.
+ */
+ public Map.Entry<K, V> extract(T msg);
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
deleted file mode 100644
index b99521a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
+++ /dev/null
@@ -1,111 +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.stream.adapters;
-
-import org.apache.ignite.*;
-
-import java.util.*;
-
-/**
- * Convenience adapter for streamers. Adapters are optional components for
- * streaming from different data sources. The purpose of adapters is to
- * convert different message formats into Ignite stream key-value tuples
- * and feed the tuples into the provided {@link org.apache.ignite.IgniteDataStreamer}.
- */
-public abstract class StreamAdapter<T, K, V> {
- /** Tuple extractor. */
- private StreamTupleExtractor<T, K, V> extractor;
-
- /** Streamer. */
- private IgniteDataStreamer<K, V> stmr;
-
- /** Ignite. */
- private Ignite ignite;
-
- /**
- * Empty constructor.
- */
- protected StreamAdapter() {
- // No-op.
- }
-
- /**
- * Stream adapter.
- *
- * @param stmr Streamer.
- * @param extractor Tuple extractor.
- */
- protected StreamAdapter(IgniteDataStreamer<K, V> stmr, StreamTupleExtractor<T, K, V> extractor) {
- this.stmr = stmr;
- this.extractor = extractor;
- }
-
- /**
- * @return Provided data streamer.
- */
- public IgniteDataStreamer<K, V> getStreamer() {
- return stmr;
- }
-
- /**
- * @param stmr Ignite data streamer.
- */
- public void setStreamer(IgniteDataStreamer<K, V> stmr) {
- this.stmr = stmr;
- }
-
- /**
- * @return Provided tuple extractor.
- */
- public StreamTupleExtractor<T, K, V> getTupleExtractor() {
- return extractor;
- }
-
- /**
- * @param extractor Extractor for key-value tuples from messages.
- */
- public void setTupleExtractor(StreamTupleExtractor<T, K, V> extractor) {
- this.extractor = extractor;
- }
-
- /**
- * @return Provided {@link Ignite} instance.
- */
- public Ignite getIgnite() {
- return ignite;
- }
-
- /**
- * @param ignite {@link Ignite} instance.
- */
- public void setIgnite(Ignite ignite) {
- this.ignite = ignite;
- }
-
- /**
- * Converts given message to a tuple and adds it to the underlying streamer.
- *
- * @param msg Message to convert.
- */
- protected void addMessage(T msg) {
- Map.Entry<K, V> e = extractor.extract(msg);
-
- if (e != null)
- stmr.addData(e);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamTupleExtractor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamTupleExtractor.java b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamTupleExtractor.java
deleted file mode 100644
index 9b0c395..0000000
--- a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamTupleExtractor.java
+++ /dev/null
@@ -1,33 +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.stream.adapters;
-
-import java.util.*;
-
-/**
- * Stream tuple extractor to convert messages to Ignite key-value tuples.
- */
-public interface StreamTupleExtractor<T, K, V> {
- /**
- * Extracts a key-value tuple from a message.
- *
- * @param msg Message.
- * @return Key-value tuple.
- */
- public Map.Entry<K, V> extract(T msg);
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/main/java/org/apache/ignite/stream/adapters/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/adapters/package-info.java b/modules/core/src/main/java/org/apache/ignite/stream/adapters/package-info.java
deleted file mode 100644
index a69ffc0..0000000
--- a/modules/core/src/main/java/org/apache/ignite/stream/adapters/package-info.java
+++ /dev/null
@@ -1,21 +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.
- */
-
-/**
- * Contains Ignite stream adapters.
- */
-package org.apache.ignite.stream.adapters;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java b/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java
deleted file mode 100644
index 66369ea..0000000
--- a/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java
+++ /dev/null
@@ -1,217 +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.stream.socket;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.util.nio.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.marshaller.jdk.*;
-import org.apache.ignite.stream.adapters.*;
-import org.jetbrains.annotations.*;
-
-import java.net.*;
-import java.nio.*;
-
-/**
- * Server that receives data from TCP socket, converts it to key-value pairs using {@link StreamTupleExtractor} and
- * streams into {@link IgniteDataStreamer} instance.
- * <p>
- * By default server uses size-based message processing. That is every message sent over the socket is prepended with
- * 4-byte integer header containing message size. If message delimiter is defined (see {@link #setDelimiter}) then
- * delimiter-based message processing will be used. That is every message sent over the socket is appended with
- * provided delimiter.
- * <p>
- * Received messages through socket converts to Java object using standard serialization. Conversion functionality
- * can be customized via user defined {@link SocketMessageConverter} (e.g. in order to convert messages from
- * non Java clients).
- */
-public class IgniteSocketStreamer<T, K, V> extends StreamAdapter<T, K, V> {
- /** Default threads. */
- private static final int DFLT_THREADS = Runtime.getRuntime().availableProcessors();
-
- /** Logger. */
- private IgniteLogger log;
-
- /** Address. */
- private InetAddress addr;
-
- /** Server port. */
- private int port;
-
- /** Threads number. */
- private int threads = DFLT_THREADS;
-
- /** Direct mode. */
- private boolean directMode;
-
- /** Delimiter. */
- private byte[] delim;
-
- /** Converter. */
- private SocketMessageConverter<T> converter;
-
- /** Server. */
- private GridNioServer<byte[]> srv;
-
- /**
- * Sets server address.
- *
- * @param addr Address.
- */
- public void setAddr(InetAddress addr) {
- this.addr = addr;
- }
-
- /**
- * Sets port number.
- *
- * @param port Port.
- */
- public void setPort(int port) {
- this.port = port;
- }
-
- /**
- * Sets threadds amount.
- *
- * @param threads Threads.
- */
- public void setThreads(int threads) {
- this.threads = threads;
- }
-
- /**
- * Sets direct mode flag.
- *
- * @param directMode Direct mode.
- */
- public void setDirectMode(boolean directMode) {
- this.directMode = directMode;
- }
-
- /**
- * Sets message delimiter.
- *
- * @param delim Delimiter.
- */
- public void setDelimiter(byte[] delim) {
- this.delim = delim;
- }
-
- /**
- * Sets message converter.
- *
- * @param converter Converter.
- */
- public void setConverter(SocketMessageConverter<T> converter) {
- this.converter = converter;
- }
-
- /**
- * Starts streamer.
- *
- * @throws IgniteException If failed.
- */
- public void start() {
- A.notNull(getTupleExtractor(), "tupleExtractor");
- A.notNull(getStreamer(), "streamer");
- A.notNull(getIgnite(), "ignite");
- A.ensure(threads > 0, "threads > 0");
-
- log = getIgnite().log();
-
- GridNioServerListener<byte[]> lsnr = new GridNioServerListenerAdapter<byte[]>() {
- @Override public void onConnected(GridNioSession ses) {
- assert ses.accepted();
-
- if (log.isDebugEnabled())
- log.debug("Accepted connection: " + ses.remoteAddress());
- }
-
- @Override public void onDisconnected(GridNioSession ses, @Nullable Exception e) {
- if (e != null)
- log.error("Connection failed with exception", e);
- }
-
- @Override public void onMessage(GridNioSession ses, byte[] msg) {
- addMessage(converter.convert(msg));
- }
- };
-
- ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
-
- GridNioParser parser = F.isEmpty(delim) ? new GridBufferedParser(directMode, byteOrder) :
- new GridDelimitedParser(delim, directMode);
-
- if (converter == null)
- converter = new DefaultConverter<>();
-
- GridNioFilter codec = new GridNioCodecFilter(parser, log, directMode);
-
- GridNioFilter[] filters = new GridNioFilter[] {codec};
-
- try {
- srv = new GridNioServer.Builder<byte[]>()
- .address(addr == null ? InetAddress.getLocalHost() : addr)
- .port(port)
- .listener(lsnr)
- .logger(log)
- .selectorCount(threads)
- .byteOrder(byteOrder)
- .filters(filters)
- .build();
- }
- catch (IgniteCheckedException | UnknownHostException e) {
- throw new IgniteException(e);
- }
-
- srv.start();
-
- if (log.isDebugEnabled())
- log.debug("Socket streaming server started on " + addr + ':' + port);
- }
-
- /**
- * Stops streamer.
- */
- public void stop() {
- srv.stop();
-
- if (log.isDebugEnabled())
- log.debug("Socket streaming server stopped");
- }
-
- /**
- * Converts message to Java object using Jdk marshaller.
- */
- private static class DefaultConverter<T> implements SocketMessageConverter<T> {
- /** Marshaller. */
- private static final JdkMarshaller MARSH = new JdkMarshaller();
-
- /** {@inheritDoc} */
- @Override public T convert(byte[] msg) {
- try {
- return MARSH.unmarshal(msg, null);
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java b/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java
new file mode 100644
index 0000000..07ce77e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java
@@ -0,0 +1,218 @@
+/*
+ * 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.stream.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.util.nio.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.marshaller.jdk.*;
+import org.apache.ignite.stream.*;
+
+import org.jetbrains.annotations.*;
+
+import java.net.*;
+import java.nio.*;
+
+/**
+ * Server that receives data from TCP socket, converts it to key-value pairs using {@link StreamTupleExtractor} and
+ * streams into {@link IgniteDataStreamer} instance.
+ * <p>
+ * By default server uses size-based message processing. That is every message sent over the socket is prepended with
+ * 4-byte integer header containing message size. If message delimiter is defined (see {@link #setDelimiter}) then
+ * delimiter-based message processing will be used. That is every message sent over the socket is appended with
+ * provided delimiter.
+ * <p>
+ * Received messages through socket converts to Java object using standard serialization. Conversion functionality
+ * can be customized via user defined {@link SocketMessageConverter} (e.g. in order to convert messages from
+ * non Java clients).
+ */
+public class SocketStreamer<T, K, V> extends StreamAdapter<T, K, V> {
+ /** Default threads. */
+ private static final int DFLT_THREADS = Runtime.getRuntime().availableProcessors();
+
+ /** Logger. */
+ private IgniteLogger log;
+
+ /** Address. */
+ private InetAddress addr;
+
+ /** Server port. */
+ private int port;
+
+ /** Threads number. */
+ private int threads = DFLT_THREADS;
+
+ /** Direct mode. */
+ private boolean directMode;
+
+ /** Delimiter. */
+ private byte[] delim;
+
+ /** Converter. */
+ private SocketMessageConverter<T> converter;
+
+ /** Server. */
+ private GridNioServer<byte[]> srv;
+
+ /**
+ * Sets server address.
+ *
+ * @param addr Address.
+ */
+ public void setAddr(InetAddress addr) {
+ this.addr = addr;
+ }
+
+ /**
+ * Sets port number.
+ *
+ * @param port Port.
+ */
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ /**
+ * Sets threadds amount.
+ *
+ * @param threads Threads.
+ */
+ public void setThreads(int threads) {
+ this.threads = threads;
+ }
+
+ /**
+ * Sets direct mode flag.
+ *
+ * @param directMode Direct mode.
+ */
+ public void setDirectMode(boolean directMode) {
+ this.directMode = directMode;
+ }
+
+ /**
+ * Sets message delimiter.
+ *
+ * @param delim Delimiter.
+ */
+ public void setDelimiter(byte[] delim) {
+ this.delim = delim;
+ }
+
+ /**
+ * Sets message converter.
+ *
+ * @param converter Converter.
+ */
+ public void setConverter(SocketMessageConverter<T> converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Starts streamer.
+ *
+ * @throws IgniteException If failed.
+ */
+ public void start() {
+ A.notNull(getTupleExtractor(), "tupleExtractor");
+ A.notNull(getStreamer(), "streamer");
+ A.notNull(getIgnite(), "ignite");
+ A.ensure(threads > 0, "threads > 0");
+
+ log = getIgnite().log();
+
+ GridNioServerListener<byte[]> lsnr = new GridNioServerListenerAdapter<byte[]>() {
+ @Override public void onConnected(GridNioSession ses) {
+ assert ses.accepted();
+
+ if (log.isDebugEnabled())
+ log.debug("Accepted connection: " + ses.remoteAddress());
+ }
+
+ @Override public void onDisconnected(GridNioSession ses, @Nullable Exception e) {
+ if (e != null)
+ log.error("Connection failed with exception", e);
+ }
+
+ @Override public void onMessage(GridNioSession ses, byte[] msg) {
+ addMessage(converter.convert(msg));
+ }
+ };
+
+ ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
+
+ GridNioParser parser = F.isEmpty(delim) ? new GridBufferedParser(directMode, byteOrder) :
+ new GridDelimitedParser(delim, directMode);
+
+ if (converter == null)
+ converter = new DefaultConverter<>();
+
+ GridNioFilter codec = new GridNioCodecFilter(parser, log, directMode);
+
+ GridNioFilter[] filters = new GridNioFilter[] {codec};
+
+ try {
+ srv = new GridNioServer.Builder<byte[]>()
+ .address(addr == null ? InetAddress.getLocalHost() : addr)
+ .port(port)
+ .listener(lsnr)
+ .logger(log)
+ .selectorCount(threads)
+ .byteOrder(byteOrder)
+ .filters(filters)
+ .build();
+ }
+ catch (IgniteCheckedException | UnknownHostException e) {
+ throw new IgniteException(e);
+ }
+
+ srv.start();
+
+ if (log.isDebugEnabled())
+ log.debug("Socket streaming server started on " + addr + ':' + port);
+ }
+
+ /**
+ * Stops streamer.
+ */
+ public void stop() {
+ srv.stop();
+
+ if (log.isDebugEnabled())
+ log.debug("Socket streaming server stopped");
+ }
+
+ /**
+ * Converts message to Java object using Jdk marshaller.
+ */
+ private static class DefaultConverter<T> implements SocketMessageConverter<T> {
+ /** Marshaller. */
+ private static final JdkMarshaller MARSH = new JdkMarshaller();
+
+ /** {@inheritDoc} */
+ @Override public T convert(byte[] msg) {
+ try {
+ return MARSH.unmarshal(msg, null);
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java
deleted file mode 100644
index 19852ce..0000000
--- a/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java
+++ /dev/null
@@ -1,315 +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.stream.socket;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.events.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.*;
-import org.apache.ignite.marshaller.jdk.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.stream.adapters.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.ignite.events.EventType.*;
-
-/**
- * Tests {@link IgniteSocketStreamer}.
- */
-public class IgniteSocketStreamerSelfTest extends GridCommonAbstractTest {
- /** IP finder. */
- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
- /** Grid count. */
- private final static int GRID_CNT = 3;
-
- /** Count. */
- private static final int CNT = 500;
-
- /** Delimiter. */
- private static final byte[] DELIM = new byte[] {0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0};
-
- /** Port. */
- private static int port;
-
- /** Ignite. */
- private static Ignite ignite;
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration() throws Exception {
- IgniteConfiguration cfg = super.getConfiguration();
-
- CacheConfiguration ccfg = cacheConfiguration(cfg, null);
-
- cfg.setCacheConfiguration(ccfg);
-
- TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
- discoSpi.setIpFinder(IP_FINDER);
-
- cfg.setDiscoverySpi(discoSpi);
-
- return cfg;
- }
-
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- ignite = startGrids(GRID_CNT);
- ignite.<Integer, String>getOrCreateCache(defaultCacheConfiguration());
-
- try (ServerSocket sock = new ServerSocket(0)) {
- port = sock.getLocalPort();
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- stopAllGrids();
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- ignite.cache(null).clear();
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testSizeBasedDefaultConverter() throws Exception {
- test(null, null, new Runnable() {
- @Override public void run() {
- try (Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
- Marshaller marsh = new JdkMarshaller();
-
- for (int i = 0; i < CNT; i++) {
- byte[] msg = marsh.marshal(new Tuple(i));
-
- os.write(msg.length >>> 24);
- os.write(msg.length >>> 16);
- os.write(msg.length >>> 8);
- os.write(msg.length);
-
- os.write(msg);
- }
- }
- catch (IOException | IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
- });
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testSizeBasedCustomConverter() throws Exception {
- SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
- @Override public Tuple convert(byte[] msg) {
- int i = (msg[0] & 0xFF) << 24;
- i |= (msg[1] & 0xFF) << 16;
- i |= (msg[2] & 0xFF) << 8;
- i |= msg[3] & 0xFF;
-
- return new Tuple(i);
- }
- };
-
- test(converter, null, new Runnable() {
- @Override public void run() {
- try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
-
- for (int i = 0; i < CNT; i++) {
- os.write(0);
- os.write(0);
- os.write(0);
- os.write(4);
-
- os.write(i >>> 24);
- os.write(i >>> 16);
- os.write(i >>> 8);
- os.write(i);
- }
- }
- catch (IOException e) {
- throw new IgniteException(e);
- }
- }
- });
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testDelimiterBasedDefaultConverter() throws Exception {
- test(null, DELIM, new Runnable() {
- @Override public void run() {
- try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
- Marshaller marsh = new JdkMarshaller();
-
- for (int i = 0; i < CNT; i++) {
- byte[] msg = marsh.marshal(new Tuple(i));
-
- os.write(msg);
- os.write(DELIM);
- }
- }
- catch (IOException | IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
- });
-
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testDelimiterBasedCustomConverter() throws Exception {
- SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
- @Override public Tuple convert(byte[] msg) {
- int i = (msg[0] & 0xFF) << 24;
- i |= (msg[1] & 0xFF) << 16;
- i |= (msg[2] & 0xFF) << 8;
- i |= msg[3] & 0xFF;
-
- return new Tuple(i);
- }
- };
-
- test(converter, DELIM, new Runnable() {
- @Override public void run() {
- try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
-
- for (int i = 0; i < CNT; i++) {
- os.write(i >>> 24);
- os.write(i >>> 16);
- os.write(i >>> 8);
- os.write(i);
-
- os.write(DELIM);
- }
- }
- catch (IOException e) {
- throw new IgniteException(e);
- }
- }
- });
- }
-
- /**
- * @param converter Converter.
- * @param r Runnable..
- */
- private void test(@Nullable SocketMessageConverter<Tuple> converter, @Nullable byte[] delim, Runnable r) throws Exception
- {
- IgniteSocketStreamer<Tuple, Integer, String> sockStmr = null;
-
- try (IgniteDataStreamer<Integer, String> stmr = ignite.dataStreamer(null)) {
-
- stmr.allowOverwrite(true);
- stmr.autoFlushFrequency(10);
-
- sockStmr = new IgniteSocketStreamer<>();
-
- IgniteCache<Integer, String> cache = ignite.cache(null);
-
- sockStmr.setIgnite(ignite);
-
- sockStmr.setStreamer(stmr);
-
- sockStmr.setPort(port);
-
- sockStmr.setDelimiter(delim);
-
- sockStmr.setTupleExtractor(new StreamTupleExtractor<Tuple, Integer, String>() {
- @Override public Map.Entry<Integer, String> extract(Tuple msg) {
- return new IgniteBiTuple<>(msg.key, msg.val);
- }
- });
-
- if (converter != null)
- sockStmr.setConverter(converter);
-
- final CountDownLatch latch = new CountDownLatch(CNT);
-
- IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
- @Override public boolean apply(UUID uuid, CacheEvent evt) {
- latch.countDown();
-
- return true;
- }
- };
-
- ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
-
- sockStmr.start();
-
- r.run();
-
- latch.await();
-
- assertEquals(CNT, cache.size(CachePeekMode.PRIMARY));
-
- for (int i = 0; i < CNT; i++)
- assertEquals(Integer.toString(i), cache.get(i));
- }
- finally {
- if (sockStmr != null)
- sockStmr.stop();
- }
-
- }
-
- /**
- * Tuple.
- */
- private static class Tuple implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0L;
-
- /** Key. */
- private final int key;
-
- /** Value. */
- private final String val;
-
- /**
- * @param key Key.
- */
- Tuple(int key) {
- this.key = key;
- this.val = Integer.toString(key);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
new file mode 100644
index 0000000..752e43c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
@@ -0,0 +1,315 @@
+/*
+ * 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.stream.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.marshaller.*;
+import org.apache.ignite.marshaller.jdk.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.stream.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ * Tests {@link SocketStreamer}.
+ */
+public class SocketStreamerSelfTest extends GridCommonAbstractTest {
+ /** IP finder. */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** Grid count. */
+ private final static int GRID_CNT = 3;
+
+ /** Count. */
+ private static final int CNT = 500;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0};
+
+ /** Port. */
+ private static int port;
+
+ /** Ignite. */
+ private static Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration() throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration();
+
+ CacheConfiguration ccfg = cacheConfiguration(cfg, null);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(discoSpi);
+
+ return cfg;
+ }
+
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ ignite = startGrids(GRID_CNT);
+ ignite.<Integer, String>getOrCreateCache(defaultCacheConfiguration());
+
+ try (ServerSocket sock = new ServerSocket(0)) {
+ port = sock.getLocalPort();
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ ignite.cache(null).clear();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSizeBasedDefaultConverter() throws Exception {
+ test(null, null, new Runnable() {
+ @Override public void run() {
+ try (Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+ Marshaller marsh = new JdkMarshaller();
+
+ for (int i = 0; i < CNT; i++) {
+ byte[] msg = marsh.marshal(new Tuple(i));
+
+ os.write(msg.length >>> 24);
+ os.write(msg.length >>> 16);
+ os.write(msg.length >>> 8);
+ os.write(msg.length);
+
+ os.write(msg);
+ }
+ }
+ catch (IOException | IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSizeBasedCustomConverter() throws Exception {
+ SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
+ @Override public Tuple convert(byte[] msg) {
+ int i = (msg[0] & 0xFF) << 24;
+ i |= (msg[1] & 0xFF) << 16;
+ i |= (msg[2] & 0xFF) << 8;
+ i |= msg[3] & 0xFF;
+
+ return new Tuple(i);
+ }
+ };
+
+ test(converter, null, new Runnable() {
+ @Override public void run() {
+ try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+
+ for (int i = 0; i < CNT; i++) {
+ os.write(0);
+ os.write(0);
+ os.write(0);
+ os.write(4);
+
+ os.write(i >>> 24);
+ os.write(i >>> 16);
+ os.write(i >>> 8);
+ os.write(i);
+ }
+ }
+ catch (IOException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDelimiterBasedDefaultConverter() throws Exception {
+ test(null, DELIM, new Runnable() {
+ @Override public void run() {
+ try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+ Marshaller marsh = new JdkMarshaller();
+
+ for (int i = 0; i < CNT; i++) {
+ byte[] msg = marsh.marshal(new Tuple(i));
+
+ os.write(msg);
+ os.write(DELIM);
+ }
+ }
+ catch (IOException | IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDelimiterBasedCustomConverter() throws Exception {
+ SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
+ @Override public Tuple convert(byte[] msg) {
+ int i = (msg[0] & 0xFF) << 24;
+ i |= (msg[1] & 0xFF) << 16;
+ i |= (msg[2] & 0xFF) << 8;
+ i |= msg[3] & 0xFF;
+
+ return new Tuple(i);
+ }
+ };
+
+ test(converter, DELIM, new Runnable() {
+ @Override public void run() {
+ try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+
+ for (int i = 0; i < CNT; i++) {
+ os.write(i >>> 24);
+ os.write(i >>> 16);
+ os.write(i >>> 8);
+ os.write(i);
+
+ os.write(DELIM);
+ }
+ }
+ catch (IOException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+ }
+
+ /**
+ * @param converter Converter.
+ * @param r Runnable..
+ */
+ private void test(@Nullable SocketMessageConverter<Tuple> converter, @Nullable byte[] delim, Runnable r) throws Exception
+ {
+ SocketStreamer<Tuple, Integer, String> sockStmr = null;
+
+ try (IgniteDataStreamer<Integer, String> stmr = ignite.dataStreamer(null)) {
+
+ stmr.allowOverwrite(true);
+ stmr.autoFlushFrequency(10);
+
+ sockStmr = new SocketStreamer<>();
+
+ IgniteCache<Integer, String> cache = ignite.cache(null);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ sockStmr.setPort(port);
+
+ sockStmr.setDelimiter(delim);
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<Tuple, Integer, String>() {
+ @Override public Map.Entry<Integer, String> extract(Tuple msg) {
+ return new IgniteBiTuple<>(msg.key, msg.val);
+ }
+ });
+
+ if (converter != null)
+ sockStmr.setConverter(converter);
+
+ final CountDownLatch latch = new CountDownLatch(CNT);
+
+ IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
+ @Override public boolean apply(UUID uuid, CacheEvent evt) {
+ latch.countDown();
+
+ return true;
+ }
+ };
+
+ ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
+
+ sockStmr.start();
+
+ r.run();
+
+ latch.await();
+
+ assertEquals(CNT, cache.size(CachePeekMode.PRIMARY));
+
+ for (int i = 0; i < CNT; i++)
+ assertEquals(Integer.toString(i), cache.get(i));
+ }
+ finally {
+ if (sockStmr != null)
+ sockStmr.stop();
+ }
+
+ }
+
+ /**
+ * Tuple.
+ */
+ private static class Tuple implements Serializable {
+ /** Serial version uid. */
+ private static final long serialVersionUID = 0L;
+
+ /** Key. */
+ private final int key;
+
+ /** Value. */
+ private final String val;
+
+ /**
+ * @param key Key.
+ */
+ Tuple(int key) {
+ this.key = key;
+ this.val = Integer.toString(key);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ee85179/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
index 87bbfbb..61be976 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
@@ -32,7 +32,7 @@ public class IgniteStreamTestSuite extends TestSuite {
public static TestSuite suite() throws Exception {
TestSuite suite = new TestSuite("Ignite Stream Test Suite");
- suite.addTest(new TestSuite(IgniteSocketStreamerSelfTest.class));
+ suite.addTest(new TestSuite(SocketStreamerSelfTest.class));
return suite;
}
[38/50] [abbrv] incubator-ignite git commit: DEPENDENCIES, LICENSE,
NOTICE files fix for main project + LICENSE, NOTICE files overrided for core
Posted by sb...@apache.org.
DEPENDENCIES, LICENSE, NOTICE files fix for main project
+ LICENSE, NOTICE files overrided for core
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cff73bfa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cff73bfa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cff73bfa
Branch: refs/heads/ignite-37
Commit: cff73bfa9e08ab8e9f6c70c335bd4c86750e92f4
Parents: 7ec8df6
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 20 18:41:27 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 20 18:41:27 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/java/META-INF/LICENSE | 238 +++++++++++++++++++++++
modules/core/src/main/java/META-INF/NOTICE | 12 ++
parent/pom.xml | 1 -
pom.xml | 17 ++
4 files changed, 267 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cff73bfa/modules/core/src/main/java/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/META-INF/LICENSE b/modules/core/src/main/java/META-INF/LICENSE
new file mode 100644
index 0000000..7649b39
--- /dev/null
+++ b/modules/core/src/main/java/META-INF/LICENSE
@@ -0,0 +1,238 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
+
+
+==============================================================================
+Apache Ignite (incubating) Subcomponents:
+
+The Apache Ignite project contains subcomponents with separate copyright
+notices and license terms. Your use of the source code for the these
+subcomponents is subject to the terms and conditions of the following
+licenses.
+
+
+==============================================================================
+For SnapTree:
+==============================================================================
+This product bundles SnapTree, which is available under a
+"3-clause BSD" license. For details, see
+https://github.com/nbronson/snaptree/blob/master/LICENSE.
+
+==============================================================================
+For JSR 166 classes in "org.jsr166" package
+==============================================================================
+This product bundles JSR-166 classes which are donated to public domain.
+For details, see CC0 1.0 Universal (1.0), Public Domain Dedication,
+http://creativecommons.org/publicdomain/zero/1.0/
+
+==============================================================================
+For books used for tests in "org.apache.ignite.internal.processors.hadoop.books"
+==============================================================================
+This code bundles book text files used for testing purposes which contain
+the following header:
+
+This eBook is for the use of anyone anywhere at no cost and with
+almost no restrictions whatsoever. You may copy it, give it away or
+re-use it under the terms of the Project Gutenberg License included
+with this eBook or online at www.gutenberg.org
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cff73bfa/modules/core/src/main/java/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/META-INF/NOTICE b/modules/core/src/main/java/META-INF/NOTICE
new file mode 100644
index 0000000..298d05b
--- /dev/null
+++ b/modules/core/src/main/java/META-INF/NOTICE
@@ -0,0 +1,12 @@
+Apache Ignite (incubating)
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
+This software includes code from IntelliJ IDEA Community Edition
+Copyright (C) JetBrains s.r.o.
+https://www.jetbrains.com/idea/
+Licensed under Apache License, Version 2.0.
+http://search.maven.org/#artifactdetails%7Corg.jetbrains%7Cannotations%7C13.0%7Cjar
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cff73bfa/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index cd098d9..e3f70b4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -619,7 +619,6 @@
<exclude>**/keystore/*.pfx</exclude><!--bin-files-->
<!--special excludes-->
<exclude>DEVNOTES.txt</exclude>
- <exclude>DEPENDENCIES</exclude><!--automatically generated file. presents at source pack-->
<exclude>src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffHeapSnapTreeMap.java</exclude><!--BSD license-->
<exclude>src/main/java/org/apache/ignite/internal/util/snaptree/*.java</exclude><!--BSD license-->
<exclude>src/main/java/org/jsr166/*.java</exclude>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cff73bfa/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b91c904..26f5456 100644
--- a/pom.xml
+++ b/pom.xml
@@ -512,6 +512,23 @@
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <!-- no <resourceBundle>, fix unexpected generation of
+ DEPENDENCIES, LICENSE, NOTICE files-->
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
[24/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-4' into ignite-sprint-4
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-4' into ignite-sprint-4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d3c056e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d3c056e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d3c056e1
Branch: refs/heads/ignite-37
Commit: d3c056e153c17629c1b12db593877c3c1fde9798
Parents: b218e78 9c30fba
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Mon May 18 11:07:11 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Mon May 18 11:07:11 2015 -0700
----------------------------------------------------------------------
DEVNOTES.txt | 6 -
assembly/release-base.xml | 4 +-
bin/ignite-schema-import.bat | 2 +-
bin/ignite-schema-import.sh | 2 +-
bin/ignite.bat | 2 +-
bin/ignite.sh | 2 +-
bin/ignitevisorcmd.bat | 2 +-
bin/ignitevisorcmd.sh | 2 +-
bin/include/build-classpath.bat | 46 ++
bin/include/build-classpath.sh | 71 +++
bin/include/target-classpath.bat | 46 --
bin/include/target-classpath.sh | 71 ---
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
.../ignite/codegen/MessageCodeGenerator.java | 4 +-
modules/core/pom.xml | 2 +-
.../communication/GridIoMessageFactory.java | 4 +-
.../cache/DynamicCacheDescriptor.java | 16 +-
.../processors/cache/GridCacheAdapter.java | 518 +++++++++---------
.../processors/cache/GridCacheMapEntry.java | 18 +-
.../GridCachePartitionExchangeManager.java | 3 +
.../processors/cache/GridCacheProcessor.java | 189 ++++---
.../processors/cache/GridCacheTtlManager.java | 42 +-
.../processors/cache/GridCacheUtils.java | 5 +-
...ridCacheOptimisticCheckPreparedTxFuture.java | 434 ---------------
...idCacheOptimisticCheckPreparedTxRequest.java | 232 --------
...dCacheOptimisticCheckPreparedTxResponse.java | 179 -------
.../distributed/GridCacheTxRecoveryFuture.java | 506 ++++++++++++++++++
.../distributed/GridCacheTxRecoveryRequest.java | 261 +++++++++
.../GridCacheTxRecoveryResponse.java | 182 +++++++
.../GridDistributedTxRemoteAdapter.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../dht/GridPartitionedGetFuture.java | 2 +-
.../cache/query/GridCacheSqlQuery.java | 2 +-
.../cache/query/GridCacheTwoStepQuery.java | 17 +
.../cache/transactions/IgniteInternalTx.java | 5 +-
.../cache/transactions/IgniteTxAdapter.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 38 +-
.../transactions/IgniteTxLocalAdapter.java | 2 +-
.../cache/transactions/IgniteTxManager.java | 173 ++----
.../datastreamer/DataStreamerImpl.java | 2 +
.../processors/igfs/IgfsDataManager.java | 3 +
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../internal/processors/igfs/IgfsUtils.java | 11 +-
.../internal/visor/query/VisorQueryArg.java | 14 +-
.../internal/visor/query/VisorQueryJob.java | 2 +
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 8 +-
.../resources/META-INF/classnames.properties | 12 +-
.../internal/GridUpdateNotifierSelfTest.java | 21 +-
.../processors/cache/CacheGetFromJobTest.java | 110 ++++
.../GridCacheAbstractFailoverSelfTest.java | 4 +-
.../GridCacheAbstractNodeRestartSelfTest.java | 94 ++--
...xOriginatingNodeFailureAbstractSelfTest.java | 2 +-
.../dht/GridCacheDhtPreloadSelfTest.java | 2 +-
...rDisabledPrimaryNodeFailureRecoveryTest.java | 31 ++
...rtitionedPrimaryNodeFailureRecoveryTest.java | 31 ++
...woBackupsPrimaryNodeFailureRecoveryTest.java | 37 ++
...ePrimaryNodeFailureRecoveryAbstractTest.java | 533 +++++++++++++++++++
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../GridCacheReplicatedNodeRestartSelfTest.java | 2 +
.../IgniteCacheExpiryPolicyAbstractTest.java | 2 +-
.../IgniteCacheExpiryPolicyTestSuite.java | 2 +
.../expiry/IgniteCacheTtlCleanupSelfTest.java | 85 +++
.../igfs/IgfsClientCacheSelfTest.java | 132 +++++
.../processors/igfs/IgfsOneClientNodeTest.java | 133 +++++
.../processors/igfs/IgfsStreamsSelfTest.java | 2 +-
.../testsuites/IgniteCacheRestartTestSuite.java | 5 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 3 -
.../IgniteCacheTxRecoverySelfTestSuite.java | 4 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 3 +
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
.../processors/query/h2/IgniteH2Indexing.java | 4 +
.../processors/query/h2/sql/GridSqlQuery.java | 20 +
.../query/h2/sql/GridSqlQueryParser.java | 10 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 11 +-
.../processors/query/h2/sql/GridSqlSelect.java | 2 +-
.../processors/query/h2/sql/GridSqlUnion.java | 2 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 3 +
.../h2/twostep/GridReduceQueryExecutor.java | 119 ++++-
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 21 +
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
.../ignite/schema/generator/CodeGenerator.java | 41 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
.../commands/cache/VisorCacheScanCommand.scala | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
parent/pom.xml | 2 +
pom.xml | 88 +--
112 files changed, 3088 insertions(+), 1693 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3c056e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3c056e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
[25/50] [abbrv] incubator-ignite git commit: IGNITE-920 - Fixed value
sending in near cache.
Posted by sb...@apache.org.
IGNITE-920 - Fixed value sending in near cache.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a927eb29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a927eb29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a927eb29
Branch: refs/heads/ignite-37
Commit: a927eb29276796831ead8e9351e30947c4480bf8
Parents: d3c056e
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Mon May 18 11:38:49 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Mon May 18 11:38:49 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/internal/IgniteKernal.java | 24 +++-
.../distributed/GridDistributedTxMapping.java | 5 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 1 +
.../distributed/near/GridNearCacheEntry.java | 2 +-
.../cache/distributed/near/GridNearTxLocal.java | 5 +-
.../near/GridNearTxPrepareFuture.java | 10 +-
.../near/GridNearTxPrepareResponse.java | 28 +++-
.../transactions/IgniteTxLocalAdapter.java | 4 +-
.../cache/IgniteCacheNearLockValueSelfTest.java | 144 +++++++++++++++++++
.../ignite/testsuites/IgniteCacheTestSuite.java | 2 +
10 files changed, 212 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index d98b023..2d9828a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -2297,7 +2297,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), null, false).get();
+ if (ctx.cache().cache(cacheCfg.getName()) == null)
+ ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), null, false).get();
return ctx.cache().publicJCache(cacheCfg.getName());
}
@@ -2341,7 +2342,14 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), nearCfg, false).get();
+ IgniteInternalCache<Object, Object> cache = ctx.cache().cache(cacheCfg.getName());
+
+ if (cache == null)
+ ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), nearCfg, false).get();
+ else {
+ if (cache.configuration().getNearConfiguration() == null)
+ ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), nearCfg, false).get();
+ }
return ctx.cache().publicJCache(cacheCfg.getName());
}
@@ -2380,7 +2388,14 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().dynamicStartCache(null, cacheName, nearCfg, false).get();
+ IgniteInternalCache<Object, Object> internalCache = ctx.cache().cache(cacheName);
+
+ if (internalCache == null)
+ ctx.cache().dynamicStartCache(null, cacheName, nearCfg, false).get();
+ else {
+ if (internalCache.configuration().getNearConfiguration() == null)
+ ctx.cache().dynamicStartCache(null, cacheName, nearCfg, false).get();
+ }
return ctx.cache().publicJCache(cacheName);
}
@@ -2418,7 +2433,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().getOrCreateFromTemplate(cacheName).get();
+ if (ctx.cache().cache(cacheName) == null)
+ ctx.cache().getOrCreateFromTemplate(cacheName).get();
return ctx.cache().publicJCache(cacheName);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
index 58c7725..fded3c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
@@ -169,12 +169,13 @@ public class GridDistributedTxMapping implements Externalizable {
/**
* @param dhtVer DHT version.
+ * @param writeVer DHT writeVersion.
*/
- public void dhtVersion(GridCacheVersion dhtVer) {
+ public void dhtVersion(GridCacheVersion dhtVer, GridCacheVersion writeVer) {
this.dhtVer = dhtVer;
for (IgniteTxEntry e : entries)
- e.dhtVersion(dhtVer);
+ e.dhtVersion(writeVer);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 3a1a80a..8cb10cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -586,6 +586,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
tx.colocated() ? tx.xid() : tx.nearFutureId(),
nearMiniId == null ? tx.xid() : nearMiniId,
tx.xidVersion(),
+ tx.writeVersion(),
tx.invalidPartitions(),
ret,
prepErr);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index c7fa4ab..29a8e5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@ -301,7 +301,7 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
else {
CacheObject val0 = valueBytesUnlocked();
- return F.t(ver, val0);
+ return F.t(dhtVer, val0);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index c665354..1e9b502 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -388,15 +388,16 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
/**
* @param nodeId Node ID.
* @param dhtVer DHT version.
+ * @param writeVer Write version.
*/
- void addDhtVersion(UUID nodeId, GridCacheVersion dhtVer) {
+ void addDhtVersion(UUID nodeId, GridCacheVersion dhtVer, GridCacheVersion writeVer) {
// This step is very important as near and DHT versions grow separately.
cctx.versions().onReceived(nodeId, dhtVer);
GridDistributedTxMapping m = mappings.get(nodeId);
if (m != null)
- m.dhtVersion(dhtVer);
+ m.dhtVersion(dhtVer, writeVer);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
index f573187..9284f49 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
@@ -1023,10 +1023,16 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
}
if (!m.empty()) {
+ GridCacheVersion writeVer = res.writeVersion();
+
+ // Backward compatibility.
+ if (writeVer == null)
+ writeVer = res.dhtVersion();
+
// Register DHT version.
- tx.addDhtVersion(m.node().id(), res.dhtVersion());
+ tx.addDhtVersion(m.node().id(), res.dhtVersion(), writeVer);
- m.dhtVersion(res.dhtVersion());
+ m.dhtVersion(res.dhtVersion(), writeVer);
if (m.near())
tx.readyNearLocks(m, res.pending(), res.committedVersions(), res.rolledbackVersions());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
index 2456674..f8c07f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
@@ -53,6 +53,9 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
/** DHT version. */
private GridCacheVersion dhtVer;
+ /** Write version. */
+ private GridCacheVersion writeVer;
+
/** */
@GridToStringInclude
@GridDirectCollection(int.class)
@@ -101,6 +104,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
IgniteUuid futId,
IgniteUuid miniId,
GridCacheVersion dhtVer,
+ GridCacheVersion writeVer,
Collection<Integer> invalidParts,
GridCacheReturn retVal,
Throwable err
@@ -114,6 +118,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
this.futId = futId;
this.miniId = miniId;
this.dhtVer = dhtVer;
+ this.writeVer = writeVer;
this.invalidParts = invalidParts;
this.retVal = retVal;
}
@@ -158,6 +163,13 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
}
/**
+ * @return Write version.
+ */
+ public GridCacheVersion writeVersion() {
+ return writeVer;
+ }
+
+ /**
* Adds owned value.
*
* @param key Key.
@@ -371,6 +383,12 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
writer.incrementState();
+ case 19:
+ if (!writer.writeMessage("writeVer", writeVer))
+ return false;
+
+ writer.incrementState();
+
}
return true;
@@ -459,6 +477,14 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
+ case 19:
+ writeVer = reader.readMessage("writeVer");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
}
return true;
@@ -471,7 +497,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 19;
+ return 20;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index fc3efba..5c5076e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -738,7 +738,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
// in order to keep near entries on backup nodes until
// backup remote transaction completes.
if (cacheCtx.isNear()) {
- ((GridNearCacheEntry)cached).recordDhtVersion(txEntry.dhtVersion());
+ if (txEntry.op() == CREATE || txEntry.op() == UPDATE ||
+ txEntry.op() == DELETE || txEntry.op() == TRANSFORM)
+ ((GridNearCacheEntry)cached).recordDhtVersion(txEntry.dhtVersion());
if ((txEntry.op() == CREATE || txEntry.op() == UPDATE) &&
txEntry.conflictExpireTime() == CU.EXPIRE_TIME_CALCULATE) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
new file mode 100644
index 0000000..fe60331
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.managers.communication.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.apache.ignite.transactions.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.transactions.TransactionConcurrency.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ *
+ */
+public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ startGridsMultiThreaded(2);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ if (getTestGridName(0).equals(gridName))
+ cfg.setClientMode(true);
+
+ cfg.setCommunicationSpi(new TestCommunicationSpi());
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDhtVersion() throws Exception {
+ CacheConfiguration<Object, Object> pCfg = new CacheConfiguration<>("partitioned");
+
+ pCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+
+ try (IgniteCache<Object, Object> cache = ignite(0).getOrCreateCache(pCfg, new NearCacheConfiguration<>())) {
+ cache.put("key1", "val1");
+
+ for (int i = 0; i < 3; i++) {
+ ((TestCommunicationSpi)ignite(0).configuration().getCommunicationSpi()).clear();
+ ((TestCommunicationSpi)ignite(1).configuration().getCommunicationSpi()).clear();
+
+ try (Transaction tx = ignite(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ cache.get("key1");
+
+ tx.commit();
+ }
+
+ TestCommunicationSpi comm = (TestCommunicationSpi)ignite(0).configuration().getCommunicationSpi();
+
+ assertEquals(1, comm.requests().size());
+
+ GridCacheAdapter<Object, Object> primary = ((IgniteKernal)grid(1)).internalCache("partitioned");
+
+ GridCacheEntryEx dhtEntry = primary.peekEx(primary.context().toCacheKeyObject("key1"));
+
+ assertNotNull(dhtEntry);
+
+ GridNearLockRequest req = comm.requests().iterator().next();
+
+ assertEquals(dhtEntry.version(), req.dhtVersion(0));
+
+ // Check entry version in near cache after commit.
+ GridCacheAdapter<Object, Object> near = ((IgniteKernal)grid(0)).internalCache("partitioned");
+
+ GridNearCacheEntry nearEntry = (GridNearCacheEntry)near.peekEx(near.context().toCacheKeyObject("key1"));
+
+ assertNotNull(nearEntry);
+
+ assertEquals(dhtEntry.version(), nearEntry.dhtVersion());
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ private static class TestCommunicationSpi extends TcpCommunicationSpi {
+ /** */
+ private Collection<GridNearLockRequest> reqs = new ConcurrentLinkedDeque<>();
+
+ /** {@inheritDoc} */
+ @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
+ if (msg instanceof GridIoMessage) {
+ GridIoMessage ioMsg = (GridIoMessage)msg;
+
+ if (ioMsg.message() instanceof GridNearLockRequest)
+ reqs.add((GridNearLockRequest)ioMsg.message());
+ }
+
+ super.sendMessage(node, msg);
+ }
+
+ /**
+ * @return Collected requests.
+ */
+ public Collection<GridNearLockRequest> requests() {
+ return reqs;
+ }
+
+ /**
+ *
+ */
+ public void clear() {
+ reqs.clear();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a927eb29/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 28b10d9..159a8d8 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
@@ -446,6 +446,8 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(CacheNoValueClassOnServerNodeTest.class);
+ suite.addTestSuite(IgniteCacheNearLockValueSelfTest.class);
+
return suite;
}
}
[16/50] [abbrv] incubator-ignite git commit: # added test
Posted by sb...@apache.org.
# added test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a27a35d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a27a35d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a27a35d8
Branch: refs/heads/ignite-37
Commit: a27a35d8bfd4954b5f6b912e2d5dd54f75c31f3c
Parents: da5a228
Author: sboikov <se...@inria.fr>
Authored: Sat May 16 06:56:15 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Sat May 16 06:56:15 2015 +0300
----------------------------------------------------------------------
.../near/IgniteCacheNearOnlyTxTest.java | 140 +++++++++++++++++++
1 file changed, 140 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a27a35d8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java
new file mode 100644
index 0000000..06a4bfc
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java
@@ -0,0 +1,140 @@
+/*
+ * 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.near;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.transactions.*;
+
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.transactions.TransactionConcurrency.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ *
+ */
+public class IgniteCacheNearOnlyTxTest extends IgniteCacheAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 2;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return TRANSACTIONAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected NearCacheConfiguration nearConfiguration() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ if (getTestGridName(1).equals(gridName)) {
+ cfg.setClientMode(true);
+
+ cfg.setCacheConfiguration();
+ }
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testNearOnlyPutMultithreaded() throws Exception {
+ final Ignite ignite1 = ignite(1);
+
+ assertTrue(ignite1.configuration().isClientMode());
+
+ ignite1.createNearCache(null, new NearCacheConfiguration<>());
+
+ GridTestUtils.runMultiThreaded(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgniteCache cache = ignite1.cache(null);
+
+ int key = 1;
+
+ for (int i = 0; i < 100; i++)
+ cache.put(key, 1);
+
+ return null;
+ }
+ }, 5, "put-thread");
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testOptimisticTx() throws Exception {
+ txMultithreaded(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPessimisticTx() throws Exception {
+ txMultithreaded(false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ private void txMultithreaded(final boolean optimistic) throws Exception {
+ final Ignite ignite1 = ignite(1);
+
+ assertTrue(ignite1.configuration().isClientMode());
+
+ ignite1.createNearCache(null, new NearCacheConfiguration<>());
+
+ GridTestUtils.runMultiThreaded(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgniteCache cache = ignite1.cache(null);
+
+ int key = 1;
+
+ IgniteTransactions txs = ignite1.transactions();
+
+ for (int i = 0; i < 100; i++) {
+ try (Transaction tx = txs.txStart(optimistic ? OPTIMISTIC : PESSIMISTIC, REPEATABLE_READ)) {
+ cache.get(key);
+
+ cache.put(key, 1);
+
+ tx.commit();
+ }
+ }
+
+ return null;
+ }
+ }, 5, "put-thread");
+ }
+}
[08/50] [abbrv] incubator-ignite git commit: ignite-430 Words count
Socket streamer examples
Posted by sb...@apache.org.
ignite-430 Words count Socket streamer examples
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/896b426b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/896b426b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/896b426b
Branch: refs/heads/ignite-37
Commit: 896b426bff3e37aeebbb00f54e179492543f1a1d
Parents: fe78d42
Author: agura <ag...@gridgain.com>
Authored: Thu May 14 20:29:33 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:40 2015 +0300
----------------------------------------------------------------------
.../streaming/StreamTransformerExample.java | 4 +-
.../streaming/StreamVisitorExample.java | 4 +-
.../socket/WordsSocketStreamerServer.java | 93 --------------------
.../streaming/wordcount/QueryWords.java | 4 +-
.../streaming/wordcount/StreamWords.java | 4 +-
.../socket/WordsSocketStreamerClient.java | 14 +--
.../socket/WordsSocketStreamerServer.java | 27 ++++--
7 files changed, 31 insertions(+), 119 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/896b426b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
index 5e95892..966fce2 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
@@ -30,11 +30,9 @@ import java.util.*;
* Stream random numbers into the streaming cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamTransformerExample}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class StreamTransformerExample {
/** Random number generator. */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/896b426b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
index 0fbce68..baae5af 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
@@ -31,11 +31,9 @@ import java.util.*;
* Stream random numbers into the streaming cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamVisitorExample}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class StreamVisitorExample {
/** Random number generator. */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/896b426b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java
deleted file mode 100644
index 5af746d..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerServer.java
+++ /dev/null
@@ -1,93 +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.examples.streaming.socket;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.wordcount.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.stream.*;
-import org.apache.ignite.stream.socket.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * Receives words through socket using {@link SocketStreamer} and message size based protocol
- * and streams them into Ignite cache.
- * <p>
- * To start the example, you should:
- * <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
- * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
- * <li>Start querying popular words using {@link QueryWords}.</li>
- * </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
- */
-public class WordsSocketStreamerServer {
- /** Port. */
- private static final int PORT = 5555;
-
- /**
- * @param args Args.
- */
- public static void main(String[] args) throws InterruptedException, IOException {
- // Mark this cluster member as client.
- Ignition.setClientMode(true);
-
- Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
-
- if (!ExamplesUtils.hasServerNodes(ignite)) {
- ignite.close();
-
- return;
- }
-
- // The cache is configured with sliding window holding 1 second of the streaming data.
- IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
-
- IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
-
- InetAddress addr = InetAddress.getLocalHost();
-
- // Configure socket streamer
- SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
-
- sockStmr.setAddr(addr);
-
- sockStmr.setPort(PORT);
-
- sockStmr.setIgnite(ignite);
-
- sockStmr.setStreamer(stmr);
-
- sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
- @Override public Map.Entry<AffinityUuid, String> extract(String word) {
- // By using AffinityUuid we ensure that identical
- // words are processed on the same cluster node.
- return new IgniteBiTuple<>(new AffinityUuid(word), word);
- }
- });
-
- sockStmr.start();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/896b426b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
index faf8b51..58c6ef2 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
@@ -28,12 +28,10 @@ import java.util.*;
* Periodically query popular numbers from the streaming cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamWords}.</li>
* <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class QueryWords {
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/896b426b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
index 26be178..6024c4b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
@@ -27,12 +27,10 @@ import java.io.*;
* Stream words into Ignite cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamWords}.</li>
* <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class StreamWords {
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/896b426b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
index ea3beaa..c4d7b8c 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
@@ -25,19 +25,19 @@ import java.io.*;
import java.net.*;
/**
- * Sends words to socket server based on {@link SocketStreamer} using message delimiter based protocol.
- * Example illustrates usage of TCP socket streamer in case of non-Java clients.
- * In this example words are zero-terminated strings.
+ * Example demonstrates streaming of data from external components into Ignite cache.
+ * <p>
+ * {@code WordsSocketStreamerClient} is simple socket streaming client implementation that sends words to socket server
+ * based on {@link SocketStreamer} using message delimiter based protocol. Example illustrates usage of TCP socket
+ * streamer in case of non-Java clients. In this example words are zero-terminated strings.
* <p>
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
* <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
* <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class WordsSocketStreamerClient {
/** Port. */
@@ -59,7 +59,7 @@ public class WordsSocketStreamerClient {
System.out.println("Words streaming started.");
while (true) {
- try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
+ try (InputStream in = WordsSocketStreamerClient.class.getResourceAsStream("../alice-in-wonderland.txt");
LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
for (String word : line.split(" ")) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/896b426b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
index 259c925..6a8911c 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
@@ -30,19 +30,20 @@ import java.net.*;
import java.util.*;
/**
- * Receives words through socket using {@link SocketStreamer} and message delimiter based protocol
+ * Example demonstrates streaming of data from external components into Ignite cache.
+ * <p>
+ * {@code WordsSocketStreamerServer} is simple socket streaming server implementation that
+ * receives words from socket using {@link SocketStreamer} and message delimiter based protocol
* and streams them into Ignite cache. Example illustrates usage of TCP socket streamer in case of non-Java clients.
* In this example words are zero-terminated strings.
* <p>
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
* <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
* <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class WordsSocketStreamerServer {
/** Port. */
@@ -52,9 +53,12 @@ public class WordsSocketStreamerServer {
private static final byte[] DELIM = new byte[] {0};
/**
- * @param args Args.
+ * Starts socket streaming server.
+ *
+ * @param args Command line arguments (none required).
+ * @throws Exception If failed.
*/
- public static void main(String[] args) throws InterruptedException, IOException {
+ public static void main(String[] args) throws Exception {
// Mark this cluster member as client.
Ignition.setClientMode(true);
@@ -106,6 +110,15 @@ public class WordsSocketStreamerServer {
}
});
- sockStmr.start();
+ try {
+ sockStmr.start();
+ }
+ catch (IgniteException e) {
+ System.out.println("Streaming server didn't start due to an error: ");
+
+ e.printStackTrace();
+
+ ignite.close();
+ }
}
}
[42/50] [abbrv] incubator-ignite git commit: # Adjusted version in
ignite.properties.
Posted by sb...@apache.org.
# Adjusted version in ignite.properties.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f879a3db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f879a3db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f879a3db
Branch: refs/heads/ignite-37
Commit: f879a3dbb29d16aed5fbb22d4087d17fac085c14
Parents: 4b4158f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu May 21 13:23:48 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu May 21 13:23:48 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/resources/ignite.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f879a3db/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 58aed26..f53dec6 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.0.6
+ignite.version=1.0.7-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
[35/50] [abbrv] incubator-ignite git commit: # ignite-456: Implemented
Posted by sb...@apache.org.
# ignite-456: Implemented
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3cc3fbe3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3cc3fbe3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3cc3fbe3
Branch: refs/heads/ignite-37
Commit: 3cc3fbe3168acaf49e691ffe74d780239968b311
Parents: c4d81fe
Author: null <null>
Authored: Wed May 20 15:45:33 2015 +0300
Committer: null <null>
Committed: Wed May 20 15:45:33 2015 +0300
----------------------------------------------------------------------
dev-tools/build.gradle | 35 +-
dev-tools/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 51017 bytes
.../gradle/wrapper/gradle-wrapper.properties | 6 +
dev-tools/gradlew | 164 ++++++++++
dev-tools/src/main/groovy/jiraslurp.groovy | 326 ++++++++++++++-----
parent/pom.xml | 4 +
6 files changed, 442 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3cc3fbe3/dev-tools/build.gradle
----------------------------------------------------------------------
diff --git a/dev-tools/build.gradle b/dev-tools/build.gradle
index b760bc1..164a775 100644
--- a/dev-tools/build.gradle
+++ b/dev-tools/build.gradle
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
apply plugin: 'groovy'
repositories {
@@ -25,21 +26,29 @@ dependencies {
}
task help {
- println '''There are two interfaces to work with JIRA attachment validation tool
- - to do the batch validation of all latest patch attachments
- gradle slurp
- - to grab a single JIRA's latest attachment and run test validation on it
- JIRA_NUM=INGITE-### gradle patchapply'''
+ println '''There are 3 interfaces to work with JIRA attachment validation tool
+ - to do the batch validation of all latest patch attachments
+ gradle slurp
+ - to grab a single JIRA's latest attachment and run test validation on it
+ JIRA_NUM=INGITE-### gradle patchapply
+ - to run all test builds for a single JIRA's latest attachment and run test validation on it
+ JIRA_NUM=INGITE-### gradle runAllBuilds'''
+}
+
+task slurp(dependsOn: 'classes', type: JavaExec) {
+ args(project.buildDir, "slurp,${System.getenv('TEST_BUILDS')}")
+ main = 'jiraslurp'
+ classpath = sourceSets.main.runtimeClasspath
}
-task slurp (dependsOn: 'classes', type: JavaExec) {
- args (project.buildDir, 'slurp')
- main = 'jiraslurp'
- classpath = sourceSets.main.runtimeClasspath
+task patchapply(dependsOn: 'classes', type: JavaExec) {
+ args("patchApply,${System.getenv('JIRA_NUM')}")
+ main = 'jiraslurp'
+ classpath = sourceSets.main.runtimeClasspath
}
-task patchapply (dependsOn: 'classes', type: JavaExec) {
- args ("JIRA_NUM=${System.getenv('JIRA_NUM')}")
- main = 'jiraslurp'
- classpath = sourceSets.main.runtimeClasspath
+task runAllBuilds(dependsOn: 'classes', type: JavaExec) {
+ args("runAllBuilds,${System.getenv('JIRA_NUM')}")
+ main = 'jiraslurp'
+ classpath = sourceSets.main.runtimeClasspath
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3cc3fbe3/dev-tools/gradle/wrapper/gradle-wrapper.jar
----------------------------------------------------------------------
diff --git a/dev-tools/gradle/wrapper/gradle-wrapper.jar b/dev-tools/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..b761216
Binary files /dev/null and b/dev-tools/gradle/wrapper/gradle-wrapper.jar differ
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3cc3fbe3/dev-tools/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/dev-tools/gradle/wrapper/gradle-wrapper.properties b/dev-tools/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..3111cd7
--- /dev/null
+++ b/dev-tools/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Feb 24 21:36:05 PST 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3cc3fbe3/dev-tools/gradlew
----------------------------------------------------------------------
diff --git a/dev-tools/gradlew b/dev-tools/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/dev-tools/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3cc3fbe3/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index 0a876fa..34ac79c 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -20,33 +20,52 @@
*/
final GIT_REPO = "https://git1-us-west.apache.org/repos/asf/incubator-ignite.git"
final ATTACHMENT_URL = "https://issues.apache.org/jira/secure/attachment"
-final validated_filename = "validated-jira.txt"
-final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_Main/.lastSuccessful/$validated_filename"
+final validated_filename = "${System.getProperty("user.home")}/validated-jira.txt"
+final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_PatchChecker/.lastSuccessful/$validated_filename"
final def JIRA_CMD = System.getProperty('JIRA_COMMAND', 'jira.sh')
LinkedHashMap<String, String> jirasAttached = [:]
+/**
+ * Gets jiras for which test tasks were already triggered.
+ *
+ * @return List of pairs [jira,attachemntId].
+ */
def readHistory = {
- final int MAX_HISTORY = 5000
-
- List validated_list = []
- def validated = new File(validated_filename)
- if (validated.exists()) {
- validated_list = validated.text.split('\n')
- validated.delete()
- } else {
- try {
- validated_list =
- new URL("http://204.14.53.152/$LAST_SUCCESSFUL_ARTIFACT").text.split('\n')
- } catch (Exception e) {
- println e.getMessage()
+ final int MAX_HISTORY = 5000
+
+ List validated_list = []
+
+ // TODO do not use folder.
+ def validated = new File(validated_filename)
+
+ if (validated.exists()) {
+ // TODO use commented way.
+ validated_list = validated.text.split('\n')
}
- }
- // Let's make sure the preserved history isn't too long
- if (validated_list.size > MAX_HISTORY) {
- validated_list = validated_list[validated_list.size-MAX_HISTORY..validated_list.size-1]
- }
- validated_list
+
+ // TODO use it way.
+// try {
+// def historyUrl = "http://${System.getenv('TC_URL')}/$LAST_SUCCESSFUL_ARTIFACT"
+//
+// println "Reading history from $historyUrl"
+//
+// validated_list = new URL(historyUrl).text.split('\n')
+//
+// println "Got validated list=$validated_list"
+// }
+// catch (Exception e) {
+// println e.getMessage()
+//
+// }
+
+ // Let's make sure the preserved history isn't too long
+ if (validated_list.size > MAX_HISTORY)
+ validated_list = validated_list[validated_list.size - MAX_HISTORY..validated_list.size - 1]
+
+ println "History=$validated_list"
+
+ validated_list
}
/**
@@ -54,83 +73,230 @@ def readHistory = {
* @return <code>null</code> or <code>JIRA-###,latest_attach_id</code>
*/
def getLatestAttachment = { jira ->
- def latestAttr = jira.attachments[0].attachment.list().sort {
- it.@id.toInteger()
- }.reverse()[0]
- String row = null
- if (latestAttr == null) {
- println "${jira.key} is in invalid state: patch is not available"
- } else {
- row = "${jira.key},${latestAttr.@id}"
- }
+ def latestAttr = jira.attachments[0].attachment.list().sort {
+ it.@id.toInteger()
+ }.reverse()[0]
+
+ String row = null
+
+ if (latestAttr == null) {
+ println "${jira.key} is in invalid state: patch is not available"
+ }
+ else {
+ row = "${jira.key},${latestAttr.@id}"
+ }
}
def checkForAttachments = {
- def JIRA_FILTER =
- "https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/12330308/SearchRequest-12330308.xml?tempMax=100&field=key&field=attachments"
- def rss = new XmlSlurper().parse(JIRA_FILTER)
- List list = readHistory{}
-
- rss.channel.item.each { jira ->
- String row = getLatestAttachment (jira)
- if (row != null && !list.contains(row)) {
- def pair = row.split(',')
- jirasAttached.put(pair[0] as String, pair[1] as String)
- list.add(row)
+ def JIRA_FILTER =
+ "https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/12330308/SearchRequest-12330308.xml?tempMax=100&field=key&field=attachments"
+ def rss = new XmlSlurper().parse(JIRA_FILTER)
+
+ List list = readHistory {}
+
+ rss.channel.item.each { jira ->
+ String row = getLatestAttachment(jira)
+
+ if (row != null && !list.contains(row)) {
+ def pair = row.split(',')
+
+ jirasAttached.put(pair[0] as String, pair[1] as String)
+
+ list.add(row)
+ }
}
- }
- // Write everything back to persist the list
- def validated = new File(validated_filename)
- validated << list.join('\n')
+ // Write everything back to persist the list
+ def validated = new File(validated_filename)
+
+ if (validated.exists())
+ validated.delete()
+
+ validated << list.join('\n')
}
+/**
+ * Monitors given process and show errors if exist.
+ */
def checkprocess = { process ->
- process.waitFor()
- if (process.exitValue() != 0) {
- println "Return code: " + process.exitValue()
- println "Errout:\n" + process.err.text
- assert process.exitValue() == 0 || process.exitValue() == 128
- }
+ println process.text
+
+ process.waitFor()
+
+ if (process.exitValue() != 0) {
+ println "Return code: " + process.exitValue()
+ println "Errout:\n" + process.err.text
+
+ assert process.exitValue() == 0 || process.exitValue() == 128
+ }
}
-def create_gitbranch = {jira, attachementURL ->
- println jira
- GIT_REPO
- println "$ATTACHMENT_URL/$attachementURL/"
-
- def patchFile = new File("${jira}.patch")
- patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text
- checkprocess "git clone --depth 1 $GIT_REPO".execute()
- checkprocess "git checkout -b sprint-2 origin/sprint-2".execute(null, new File('incubator-ignite'))
- checkprocess "git am ../${patchFile.name}".execute(null, new File('incubator-ignite'))
- patchFile.delete()
+/**
+ * Applys patch from jira to given git state.
+ */
+def applyPatch = { jira, attachementURL ->
+ def userEmail = System.getenv("env.GIT_USER_EMAIL");
+ def userName = System.getenv("env.GIT_USER_NAME");
+
+ println "Patch apllying with jira='$jira' and attachment='$ATTACHMENT_URL/$attachementURL/'."
+
+ def patchFile = new File("${jira}-${attachementURL}.patch")
+
+ try {
+ patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text
+
+ try {
+ checkprocess "git branch".execute()
+
+ checkprocess "git config user.email \"$userEmail\"".execute(null, new File("../"))
+ checkprocess "git config user.name \"$userName\"".execute(null, new File("../"))
+
+ // Create a new uniqueue branch to applying patch
+ def newTestBranch = "test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}"
+ checkprocess "git checkout -b ${newTestBranch}".execute(null, new File("../"))
+
+ checkprocess "git branch".execute()
+
+ checkprocess "git am dev-tools/${patchFile.name}".execute(null, new File("../"))
+
+ println "Patch was applied successfully."
+ }
+ catch (Exception e) {
+ println "Patch was not applied successfully. Aborting patch applying."
+
+ checkprocess "git am --abort".execute(null, new File("../"))
+
+ throw e;
+ }
+ }
+ finally {
+ assert patchFile.delete(), 'Could not delete patch file.'
+ }
}
def JIRA_xml = { jiranum ->
- "https://issues.apache.org/jira/si/jira.issueviews:issue-xml/$jiranum/${jiranum}.xml"
+ "https://issues.apache.org/jira/si/jira.issueviews:issue-xml/$jiranum/${jiranum}.xml"
+}
+
+/**
+ * Runs all given test builds to validate last patch from given jira.
+ */
+def runAllTestBuilds = { builds, jiraNum ->
+ assert jiraNum != 'null', 'Jira number should not be null.'
+ assert jiraNum != null, 'Jira number should not be null.'
+
+ if (jiraNum) {
+ def tcURL = System.getenv('TC_URL')
+ def user = System.getenv('TASK_RUNNER_USER')
+ def pwd = System.getenv('TASK_RUNNER_PWD')
+
+ builds.each {
+ try {
+ println "Triggering $it build for $jiraNum jira..."
+
+ String postData =
+ "<build>" +
+ " <buildType id='$it'/>" +
+ " <properties>" +
+ " <property name='JIRA_NUM' value='$jiraNum'/>" +
+ " </properties>" +
+ "</build>";
+
+ URL url = new URL("http://$tcURL:80/httpAuth/app/rest/buildQueue");
+
+ HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+
+ String encoded = new sun.misc.BASE64Encoder().encode("$user:$pwd".getBytes());
+
+ conn.setRequestProperty("Authorization", "Basic " + encoded);
+
+ conn.setDoOutput(true);
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", "application/xml");
+ conn.setRequestProperty("Content-Length", String.valueOf(postData.length()));
+
+ OutputStream os = conn.getOutputStream();
+ os.write(postData.getBytes());
+ os.flush();
+ os.close();
+
+ conn.connect();
+
+ // Read response.
+ print "Response: "
+
+ BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ String line;
+ while ((line = br.readLine()) != null)
+ println line
+
+ br.close();
+ }
+ catch (Exception e) {
+ e.printStackTrace()
+ }
+ }
+ }
}
+/**
+ * Main.
+ */
args.each {
- println it
- def parameters = it.split('=')
-
- if (parameters[0] == 'slurp') {
- checkForAttachments()
- // For each ticket with new attachment, let's trigger remove build
- jirasAttached.each { k, v ->
- // Trailing slash is important for download; only need to pass JIRA number
- println "Triggering the build for: $k = $ATTACHMENT_URL/$v/"
+ println "Arg=$it"
+
+ def parameters = it.split(",")
+
+ println parameters
+
+ if (parameters.length == 2 && parameters[0] == "slurp" && parameters[1] != 'null') {
+ def builds = parameters[1].split(' ');
+
+ println "Running in 'slurp' mode. Test builds=${builds}"
+
+ checkForAttachments()
+
+ // For each ticket with new attachment, let's trigger remove build
+ jirasAttached.each { k, v ->
+ // Trailing slash is important for download; only need to pass JIRA number
+ println "Triggering the test builds for: $k = $ATTACHMENT_URL/$v/"
+
+ runAllTestBuilds(builds,k)
+ }
+ }
+ else if (parameters.length == 2 && parameters[0] == "patchApply" && parameters[1] ==~ /\w+-\d+/) {
+ def jiraNum = parameters[1]
+
+ println "Running in 'patch apply' mode with jira number '$jiraNum'"
+
+ // Extract JIRA rss from the and pass the ticket element into attachment extraction
+ def rss = new XmlSlurper().parse(JIRA_xml(parameters[1]))
+
+ String row = getLatestAttachment(rss.channel.item)
+
+ println "Got row: $row."
+
+ if (row != null) {
+ def pair = row.split(',')
+ def jira = pair[0]
+ def attachementURL = pair[1]
+
+ applyPatch(jira, attachementURL)
+ }
}
- } else if (parameters.length == 2 && parameters[0] == 'JIRA_NUM' && parameters[1] ==~ /\w+-\d+/) {
- // Extract JIRA rss from the and pass the ticket element into attachment extraction
- def rss = new XmlSlurper().parse(JIRA_xml(parameters[1]))
- String row = getLatestAttachment(rss.channel.item)
- if (row != null) {
- def pair = row.split(',')
- create_gitbranch(pair[0], pair[1])
+ else if (parameters.length >= 2 && parameters[0] == "runAllBuilds" && parameters[1] ==~ /\w+-\d+/) {
+ def jiraNum = parameters[1]
+
+ def attachementURL=null
+
+ if (parameters[2] ==~ /\d+/)
+ attachementURL = parameters[2]
+
+ println "Running in 'all builds' mode with jira number='$jiraNum' and attachment URL='$attachementURL'."
+
+ runAllTestBuilds jiraNum attachmentURL
}
- }
}
/* Workflow:
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3cc3fbe3/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index cd098d9..f06586a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -634,6 +634,10 @@
<exclude>src/main/java/META-INF/services/javax.cache.spi.CachingProvider</exclude><!--cannot be changed-->
<exclude>src/main/java/org/jetbrains/annotations/*.java</exclude><!--copyright-->
<exclude>src/main/resources/META-INF/services/org.apache.hadoop.mapreduce.protocol.ClientProtocolProvider</exclude><!--cannot be changed-->
+ <exclude>dev-tools/IGNITE-*.patch</exclude>
+ <exclude>dev-tools/.gradle/**/*</exclude>
+ <exclude>dev-tools/gradle/wrapper/**/*</exclude>
+ <exclude>dev-tools/gradlew</exclude>
<!--shmem-->
<exclude>ipc/shmem/**/Makefile.in</exclude><!--auto generated files-->
<exclude>ipc/shmem/**/Makefile</exclude><!--auto generated files-->
[03/50] [abbrv] incubator-ignite git commit: # ignite-669 - streaming
design.
Posted by sb...@apache.org.
# ignite-669 - streaming design.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b0fbfa05
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b0fbfa05
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b0fbfa05
Branch: refs/heads/ignite-37
Commit: b0fbfa05cb1cb712fe217da7166d945c7c2ec597
Parents: 877eb76
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Thu Apr 2 03:13:04 2015 -0700
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:24 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/stream/adapters/StreamAdapter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0fbfa05/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
index 9d4772f..c729362 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
@@ -37,7 +37,7 @@ public abstract class StreamAdapter<T, K, V> {
/**
* Empty constructor.
*/
- public StreamAdapter() {
+ protected StreamAdapter() {
// No-op.
}
[04/50] [abbrv] incubator-ignite git commit: ignite-430 Implement
IgniteSocketStreamer to stream data from TCP socket.
Posted by sb...@apache.org.
ignite-430 Implement IgniteSocketStreamer to stream data from TCP socket.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/53995dcb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/53995dcb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/53995dcb
Branch: refs/heads/ignite-37
Commit: 53995dcb3470de07df73d8dfd284da0dbb8df8dd
Parents: b0fbfa0
Author: agura <ag...@gridgain.com>
Authored: Mon Apr 13 18:28:40 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:27 2015 +0300
----------------------------------------------------------------------
.../streaming/socket/SocketStreamerExample.java | 158 ++++++++++
.../socket/ZStringsSocketStreamerExample.java | 151 +++++++++
.../examples/streaming/socket/package-info.java | 21 ++
.../internal/util/nio/GridBufferedParser.java | 4 -
.../internal/util/nio/GridDelimitedParser.java | 91 ++++++
.../util/nio/GridNioDelimitedBuffer.java | 106 +++++++
.../ignite/stream/adapters/StreamAdapter.java | 17 +
.../stream/socket/IgniteSocketStreamer.java | 217 +++++++++++++
.../stream/socket/SocketMessageConverter.java | 31 ++
.../ignite/stream/socket/package-info.java | 21 ++
.../util/nio/GridNioDelimitedBufferTest.java | 112 +++++++
.../socket/IgniteSocketStreamerSelfTest.java | 315 +++++++++++++++++++
.../ignite/stream/socket/package-info.java | 21 ++
.../testsuites/IgniteStreamTestSuite.java | 39 +++
.../testsuites/IgniteUtilSelfTestSuite.java | 1 +
15 files changed, 1301 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
new file mode 100644
index 0000000..73cb970
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/SocketStreamerExample.java
@@ -0,0 +1,158 @@
+/*
+ * 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.examples.streaming.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.numbers.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.stream.*;
+import org.apache.ignite.stream.adapters.*;
+import org.apache.ignite.stream.socket.*;
+
+import javax.cache.processor.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * Streams random numbers into the streaming cache using {@link IgniteSocketStreamer}.
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start streaming using {@link SocketStreamerExample}.</li>
+ * <li>Start querying popular numbers using {@link QueryPopularNumbers}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class SocketStreamerExample {
+ /** Random number generator. */
+ private static final Random RAND = new Random();
+
+ /** Range within which to generate numbers. */
+ private static final int RANGE = 1000;
+
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws InterruptedException, IOException {
+ // Mark this cluster member as client.
+ Ignition.setClientMode(true);
+
+ try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+ if (!ExamplesUtils.hasServerNodes(ignite))
+ return;
+
+ // The cache is configured with sliding window holding 1 second of the streaming data.
+ IgniteCache<Integer, Long> stmCache = ignite.getOrCreateCache(CacheConfig.randomNumbersCache());
+
+ try (IgniteDataStreamer<Integer, Long> stmr = ignite.dataStreamer(stmCache.getName())) {
+ // Allow data updates.
+ stmr.allowOverwrite(true);
+
+ // Configure data transformation to count instances of the same word.
+ stmr.receiver(new StreamTransformer<Integer, Long>() {
+ @Override public Object process(MutableEntry<Integer, Long> e, Object... objects)
+ throws EntryProcessorException {
+ Long val = e.getValue();
+
+ e.setValue(val == null ? 1L : val + 1);
+
+ return null;
+ }
+ });
+
+ InetAddress addr = InetAddress.getLocalHost();
+
+ IgniteSocketStreamer<Tuple, Integer, Long> sockStmr = new IgniteSocketStreamer<>();
+
+ sockStmr.setAddr(addr);
+
+ sockStmr.setPort(PORT);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<Tuple, Integer, Long>() {
+ @Override public Map.Entry<Integer, Long> extract(Tuple tuple) {
+ return new IgniteBiTuple<>(tuple.key, tuple.cnt);
+ }
+ });
+
+ sockStmr.start();
+
+ sendData(addr, PORT);
+ }
+ }
+ }
+
+ /**
+ * @param addr Address.
+ * @param port Port.
+ */
+ private static void sendData(InetAddress addr, int port) throws IOException, InterruptedException {
+ try (Socket sock = new Socket(addr, port);
+ OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
+ while (true) {
+ try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bos)) {
+ Tuple tuple = new Tuple(RAND.nextInt(RANGE), 1L);
+
+ out.writeObject(tuple);
+
+ byte[] arr = bos.toByteArray();
+
+ oos.write(arr.length >>> 24);
+ oos.write(arr.length >>> 16);
+ oos.write(arr.length >>> 8);
+ oos.write(arr.length);
+
+ oos.write(arr);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tuple.
+ */
+ private static class Tuple implements Serializable {
+ /** Serial version uid. */
+ private static final long serialVersionUID = 0;
+
+ /** Key. */
+ private final int key;
+
+ /** Count. */
+ private final long cnt;
+
+ /**
+ * @param key Key.
+ * @param cnt Count.
+ */
+ public Tuple(int key, long cnt) {
+ this.key = key;
+ this.cnt = cnt;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
new file mode 100644
index 0000000..a535c73
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZStringsSocketStreamerExample.java
@@ -0,0 +1,151 @@
+/*
+ * 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.examples.streaming.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.numbers.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.stream.*;
+import org.apache.ignite.stream.adapters.*;
+import org.apache.ignite.stream.socket.*;
+
+import javax.cache.processor.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * Stream random numbers into the streaming cache using {@link IgniteSocketStreamer}.
+ * <p>
+ * Example illustrates usage of TCP socket streamer in case of non-Java clients. In this example client streams
+ * zero-terminated strings.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start streaming using {@link ZStringsSocketStreamerExample}.</li>
+ * <li>Start querying popular numbers using {@link QueryPopularNumbers}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class ZStringsSocketStreamerExample {
+ /** Random number generator. */
+ private static final Random RAND = new Random();
+
+ /** Range within which to generate numbers. */
+ private static final int RANGE = 1000;
+
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0};
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws InterruptedException, IOException {
+ // Mark this cluster member as client.
+ Ignition.setClientMode(true);
+
+ try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+ if (!ExamplesUtils.hasServerNodes(ignite))
+ return;
+
+ // The cache is configured with sliding window holding 1 second of the streaming data.
+ IgniteCache<Integer, Long> stmCache = ignite.getOrCreateCache(CacheConfig.randomNumbersCache());
+
+ try (IgniteDataStreamer<Integer, Long> stmr = ignite.dataStreamer(stmCache.getName())) {
+ // Allow data updates.
+ stmr.allowOverwrite(true);
+
+ // Configure data transformation to count instances of the same word.
+ stmr.receiver(new StreamTransformer<Integer, Long>() {
+ @Override public Object process(MutableEntry<Integer, Long> e, Object... objects)
+ throws EntryProcessorException {
+ Long val = e.getValue();
+
+ e.setValue(val == null ? 1L : val + 1);
+
+ return null;
+ }
+ });
+
+ InetAddress addr = InetAddress.getLocalHost();
+
+ IgniteSocketStreamer<String, Integer, Long> sockStmr = new IgniteSocketStreamer<>();
+
+ sockStmr.setAddr(addr);
+
+ sockStmr.setPort(PORT);
+
+ sockStmr.setDelimiter(DELIM);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ // Converter from zero-terminated string to Java strings.
+ sockStmr.setConverter(new SocketMessageConverter<String>() {
+ @Override public String convert(byte[] msg) {
+ try {
+ return new String(msg, "ASCII");
+ }
+ catch (UnsupportedEncodingException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<String, Integer, Long>() {
+ @Override public Map.Entry<Integer, Long> extract(String input) {
+ String[] pair = input.split("=");
+ return new IgniteBiTuple<>(Integer.parseInt(pair[0]), Long.parseLong(pair[1]));
+ }
+ });
+
+ sockStmr.start();
+
+ sendData(addr, PORT);
+ }
+ }
+ }
+
+ /**
+ * @param addr Address.
+ * @param port Port.
+ */
+ private static void sendData(InetAddress addr, int port) throws IOException, InterruptedException {
+ try (Socket sock = new Socket(addr, port);
+ OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
+
+ while (true) {
+ int key = RAND.nextInt(RANGE);
+
+ String str = key + "=1";
+
+ byte[] arr = str.getBytes("ASCII");
+
+ oos.write(arr);
+ oos.write(DELIM);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
new file mode 100644
index 0000000..ae7bdf9
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * Contains {@link org.apache.ignite.stream.socket.IgniteSocketStreamer} usage examples.
+ */
+package org.apache.ignite.examples.streaming.socket;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java
index 3f81dc4..a03d2c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.util.nio;
import org.apache.ignite.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
import java.io.*;
import java.nio.*;
@@ -33,9 +32,6 @@ import java.nio.*;
* | MSG_SIZE | MESSAGE | MSG_SIZE | MESSAGE |
* +--+--+--+--+--+--+...+--+--+--+--+--+--+--+...+--+
* </pre>
- * <p>
- * It expects that first 4 bytes in stream are {@link U#IGNITE_HEADER}. If beginning of a stream,
- * isn't equal to these bytes than exception will be thrown.
*/
public class GridBufferedParser implements GridNioParser {
/** Buffer metadata key. */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java
new file mode 100644
index 0000000..256597c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java
@@ -0,0 +1,91 @@
+/*
+ * 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.util.nio;
+
+import org.apache.ignite.*;
+
+import java.io.*;
+import java.nio.*;
+
+/**
+ * This class implements stream parser based on {@link GridNioDelimitedBuffer}.
+ * <p>
+ * The rule for this parser is that every message sent over the stream is appended with
+ * delimiter (bytes array). So, the stream structure is as follows:
+ * <pre>
+ * +--+--+...+--+--+--+--+--+--+--+...+--+--+--+--+--+-
+ * | MESSAGE | DELIMITER | MESSAGE | DELIMITER |
+ * +--+--+...+--+--+--+--+--+--+--+...+--+--+--+--+--+-
+ * </pre>
+ */
+public class GridDelimitedParser implements GridNioParser {
+ /** Buffer metadata key. */
+ private static final int BUF_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
+
+ /** Delimiter. */
+ private final byte[] delim;
+
+ /** Direct buffer. */
+ private final boolean directBuf;
+
+ /**
+ * @param delim Delimiter.
+ * @param directBuf Direct buffer.
+ */
+ public GridDelimitedParser(byte[] delim, boolean directBuf) {
+ this.delim = delim;
+ this.directBuf = directBuf;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte[] decode(GridNioSession ses, ByteBuffer buf) throws IOException, IgniteCheckedException {
+ GridNioDelimitedBuffer nioBuf = ses.meta(BUF_META_KEY);
+
+ // Decode for a given session is called per one thread, so there should not be any concurrency issues.
+ // However, we make some additional checks.
+ if (nioBuf == null) {
+ nioBuf = new GridNioDelimitedBuffer(delim);
+
+ GridNioDelimitedBuffer old = ses.addMeta(BUF_META_KEY, nioBuf);
+
+ assert old == null;
+ }
+
+ return nioBuf.read(buf);
+ }
+
+ /** {@inheritDoc} */
+ @Override public ByteBuffer encode(GridNioSession ses, Object msg) throws IOException, IgniteCheckedException {
+ byte[] msg0 = (byte[])msg;
+
+ int cap = msg0.length + delim.length;
+ ByteBuffer res = directBuf ? ByteBuffer.allocateDirect(cap) : ByteBuffer.allocate(cap);
+
+ res.put(msg0);
+ res.put(delim);
+
+ res.flip();
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return this.getClass().getSimpleName();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java
new file mode 100644
index 0000000..2b764ec
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java
@@ -0,0 +1,106 @@
+/*
+ * 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.util.nio;
+
+import org.jetbrains.annotations.*;
+
+import java.nio.*;
+import java.util.*;
+
+/**
+ * Buffer with message delimiter support.
+ */
+public class GridNioDelimitedBuffer {
+ /** Delimiter. */
+ private final byte[] delim;
+
+ /** Data. */
+ private byte[] data = new byte[16384];
+
+ /** Count. */
+ private int cnt;
+
+ /** Index. */
+ private int idx;
+
+ /**
+ * @param delim Delimiter.
+ */
+ public GridNioDelimitedBuffer(byte[] delim) {
+ assert delim != null;
+ assert delim.length > 0;
+
+ this.delim = delim;
+
+ reset();
+ }
+
+ /**
+ * Resets buffer state.
+ */
+ private void reset() {
+ cnt = 0;
+ idx = 0;
+ }
+
+ /**
+ * @param buf Buffer.
+ * @return Message bytes or {@code null} if message is not fully read yet.
+ */
+ @Nullable public byte[] read(ByteBuffer buf) {
+ while(buf.hasRemaining()) {
+ if (cnt == data.length)
+ data = Arrays.copyOf(data, data.length * 2);
+
+ byte b = buf.get();
+
+ data[cnt++] = b;
+
+ if (b == delim[idx])
+ idx++;
+ else if (idx > 0) {
+ int pos = cnt - idx;
+
+ idx = 0;
+
+ for (int i = pos; i < cnt; i++) {
+ if (data[pos] == delim[idx]) {
+ pos++;
+
+ idx++;
+ }
+ else {
+ pos = cnt - idx;
+
+ idx = 0;
+ }
+ }
+ }
+
+ if (idx == delim.length) {
+ byte[] bytes = Arrays.copyOfRange(data, 0, cnt - delim.length);
+
+ reset();
+
+ return bytes;
+ }
+ }
+
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
index c729362..b99521a 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/adapters/StreamAdapter.java
@@ -34,6 +34,9 @@ public abstract class StreamAdapter<T, K, V> {
/** Streamer. */
private IgniteDataStreamer<K, V> stmr;
+ /** Ignite. */
+ private Ignite ignite;
+
/**
* Empty constructor.
*/
@@ -81,6 +84,20 @@ public abstract class StreamAdapter<T, K, V> {
}
/**
+ * @return Provided {@link Ignite} instance.
+ */
+ public Ignite getIgnite() {
+ return ignite;
+ }
+
+ /**
+ * @param ignite {@link Ignite} instance.
+ */
+ public void setIgnite(Ignite ignite) {
+ this.ignite = ignite;
+ }
+
+ /**
* Converts given message to a tuple and adds it to the underlying streamer.
*
* @param msg Message to convert.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java b/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java
new file mode 100644
index 0000000..66369ea
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/stream/socket/IgniteSocketStreamer.java
@@ -0,0 +1,217 @@
+/*
+ * 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.stream.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.util.nio.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.marshaller.jdk.*;
+import org.apache.ignite.stream.adapters.*;
+import org.jetbrains.annotations.*;
+
+import java.net.*;
+import java.nio.*;
+
+/**
+ * Server that receives data from TCP socket, converts it to key-value pairs using {@link StreamTupleExtractor} and
+ * streams into {@link IgniteDataStreamer} instance.
+ * <p>
+ * By default server uses size-based message processing. That is every message sent over the socket is prepended with
+ * 4-byte integer header containing message size. If message delimiter is defined (see {@link #setDelimiter}) then
+ * delimiter-based message processing will be used. That is every message sent over the socket is appended with
+ * provided delimiter.
+ * <p>
+ * Received messages through socket converts to Java object using standard serialization. Conversion functionality
+ * can be customized via user defined {@link SocketMessageConverter} (e.g. in order to convert messages from
+ * non Java clients).
+ */
+public class IgniteSocketStreamer<T, K, V> extends StreamAdapter<T, K, V> {
+ /** Default threads. */
+ private static final int DFLT_THREADS = Runtime.getRuntime().availableProcessors();
+
+ /** Logger. */
+ private IgniteLogger log;
+
+ /** Address. */
+ private InetAddress addr;
+
+ /** Server port. */
+ private int port;
+
+ /** Threads number. */
+ private int threads = DFLT_THREADS;
+
+ /** Direct mode. */
+ private boolean directMode;
+
+ /** Delimiter. */
+ private byte[] delim;
+
+ /** Converter. */
+ private SocketMessageConverter<T> converter;
+
+ /** Server. */
+ private GridNioServer<byte[]> srv;
+
+ /**
+ * Sets server address.
+ *
+ * @param addr Address.
+ */
+ public void setAddr(InetAddress addr) {
+ this.addr = addr;
+ }
+
+ /**
+ * Sets port number.
+ *
+ * @param port Port.
+ */
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ /**
+ * Sets threadds amount.
+ *
+ * @param threads Threads.
+ */
+ public void setThreads(int threads) {
+ this.threads = threads;
+ }
+
+ /**
+ * Sets direct mode flag.
+ *
+ * @param directMode Direct mode.
+ */
+ public void setDirectMode(boolean directMode) {
+ this.directMode = directMode;
+ }
+
+ /**
+ * Sets message delimiter.
+ *
+ * @param delim Delimiter.
+ */
+ public void setDelimiter(byte[] delim) {
+ this.delim = delim;
+ }
+
+ /**
+ * Sets message converter.
+ *
+ * @param converter Converter.
+ */
+ public void setConverter(SocketMessageConverter<T> converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Starts streamer.
+ *
+ * @throws IgniteException If failed.
+ */
+ public void start() {
+ A.notNull(getTupleExtractor(), "tupleExtractor");
+ A.notNull(getStreamer(), "streamer");
+ A.notNull(getIgnite(), "ignite");
+ A.ensure(threads > 0, "threads > 0");
+
+ log = getIgnite().log();
+
+ GridNioServerListener<byte[]> lsnr = new GridNioServerListenerAdapter<byte[]>() {
+ @Override public void onConnected(GridNioSession ses) {
+ assert ses.accepted();
+
+ if (log.isDebugEnabled())
+ log.debug("Accepted connection: " + ses.remoteAddress());
+ }
+
+ @Override public void onDisconnected(GridNioSession ses, @Nullable Exception e) {
+ if (e != null)
+ log.error("Connection failed with exception", e);
+ }
+
+ @Override public void onMessage(GridNioSession ses, byte[] msg) {
+ addMessage(converter.convert(msg));
+ }
+ };
+
+ ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
+
+ GridNioParser parser = F.isEmpty(delim) ? new GridBufferedParser(directMode, byteOrder) :
+ new GridDelimitedParser(delim, directMode);
+
+ if (converter == null)
+ converter = new DefaultConverter<>();
+
+ GridNioFilter codec = new GridNioCodecFilter(parser, log, directMode);
+
+ GridNioFilter[] filters = new GridNioFilter[] {codec};
+
+ try {
+ srv = new GridNioServer.Builder<byte[]>()
+ .address(addr == null ? InetAddress.getLocalHost() : addr)
+ .port(port)
+ .listener(lsnr)
+ .logger(log)
+ .selectorCount(threads)
+ .byteOrder(byteOrder)
+ .filters(filters)
+ .build();
+ }
+ catch (IgniteCheckedException | UnknownHostException e) {
+ throw new IgniteException(e);
+ }
+
+ srv.start();
+
+ if (log.isDebugEnabled())
+ log.debug("Socket streaming server started on " + addr + ':' + port);
+ }
+
+ /**
+ * Stops streamer.
+ */
+ public void stop() {
+ srv.stop();
+
+ if (log.isDebugEnabled())
+ log.debug("Socket streaming server stopped");
+ }
+
+ /**
+ * Converts message to Java object using Jdk marshaller.
+ */
+ private static class DefaultConverter<T> implements SocketMessageConverter<T> {
+ /** Marshaller. */
+ private static final JdkMarshaller MARSH = new JdkMarshaller();
+
+ /** {@inheritDoc} */
+ @Override public T convert(byte[] msg) {
+ try {
+ return MARSH.unmarshal(msg, null);
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketMessageConverter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketMessageConverter.java b/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketMessageConverter.java
new file mode 100644
index 0000000..8161d86
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketMessageConverter.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.stream.socket;
+
+/**
+ * Socket message converter.
+ */
+public interface SocketMessageConverter<T> {
+ /**
+ * Converter message represented by array of bytes to object.
+ *
+ * @param msg Message.
+ * @return Converted object.
+ */
+ public T convert(byte[] msg);
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/main/java/org/apache/ignite/stream/socket/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/socket/package-info.java b/modules/core/src/main/java/org/apache/ignite/stream/socket/package-info.java
new file mode 100644
index 0000000..e1cef65
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/stream/socket/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * Contains socket streamer implementation.
+ */
+package org.apache.ignite.stream.socket;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java
new file mode 100644
index 0000000..a0dd2e5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java
@@ -0,0 +1,112 @@
+/*
+ * 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.util.nio;
+
+import junit.framework.TestCase;
+
+import java.nio.*;
+import java.util.*;
+
+/**
+ * Tests for {@link GridNioDelimitedBuffer}.
+ */
+public class GridNioDelimitedBufferTest extends TestCase {
+ /** */
+ private static final String ASCII = "ASCII";
+
+ /**
+ * Tests simple delimiter (excluded from alphabet)
+ */
+ public void testReadZString() throws Exception {
+ Random rnd = new Random();
+
+ int buffSize = 0;
+
+ byte[] delim = new byte[] {0};
+
+ List<String> strs = new ArrayList<>(50);
+
+ for (int i = 0; i < 50; i++) {
+ int len = rnd.nextInt(128) + 1;
+
+ buffSize += len + delim.length;
+
+ StringBuilder sb = new StringBuilder(len);
+
+ for (int j = 0; j < len; j++)
+ sb.append((char)(rnd.nextInt(26) + 'a'));
+
+
+ strs.add(sb.toString());
+ }
+
+ ByteBuffer buff = ByteBuffer.allocate(buffSize);
+
+ for (String str : strs) {
+ buff.put(str.getBytes(ASCII));
+ buff.put(delim);
+ }
+
+ buff.flip();
+
+ byte[] msg;
+
+ GridNioDelimitedBuffer delimBuff = new GridNioDelimitedBuffer(delim);
+
+ List<String> res = new ArrayList<>(strs.size());
+
+ while ((msg = delimBuff.read(buff)) != null)
+ res.add(new String(msg, ASCII));
+
+ assertEquals(strs, res);
+ }
+
+ /**
+ * Tests compound delimiter (included to alphabet)
+ */
+ public void testDelim() throws Exception {
+ byte[] delim = "aabb".getBytes(ASCII);
+
+ List<String> strs = Arrays.asList("za", "zaa", "zaab", "zab", "zaabaababbbbabaab");
+
+ int buffSize = 0;
+
+ for (String str : strs)
+ buffSize += str.length() + delim.length;
+
+ ByteBuffer buff = ByteBuffer.allocate(buffSize);
+
+ for (String str : strs) {
+ buff.put(str.getBytes(ASCII));
+ buff.put(delim);
+ }
+
+ buff.flip();
+
+ byte[] msg;
+
+ GridNioDelimitedBuffer delimBuff = new GridNioDelimitedBuffer(delim);
+
+ List<String> res = new ArrayList<>(strs.size());
+
+ while ((msg = delimBuff.read(buff)) != null)
+ res.add(new String(msg, ASCII));
+
+ assertEquals(strs, res);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java
new file mode 100644
index 0000000..19852ce
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/stream/socket/IgniteSocketStreamerSelfTest.java
@@ -0,0 +1,315 @@
+/*
+ * 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.stream.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.marshaller.*;
+import org.apache.ignite.marshaller.jdk.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.stream.adapters.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ * Tests {@link IgniteSocketStreamer}.
+ */
+public class IgniteSocketStreamerSelfTest extends GridCommonAbstractTest {
+ /** IP finder. */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** Grid count. */
+ private final static int GRID_CNT = 3;
+
+ /** Count. */
+ private static final int CNT = 500;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0};
+
+ /** Port. */
+ private static int port;
+
+ /** Ignite. */
+ private static Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration() throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration();
+
+ CacheConfiguration ccfg = cacheConfiguration(cfg, null);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(discoSpi);
+
+ return cfg;
+ }
+
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ ignite = startGrids(GRID_CNT);
+ ignite.<Integer, String>getOrCreateCache(defaultCacheConfiguration());
+
+ try (ServerSocket sock = new ServerSocket(0)) {
+ port = sock.getLocalPort();
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ ignite.cache(null).clear();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSizeBasedDefaultConverter() throws Exception {
+ test(null, null, new Runnable() {
+ @Override public void run() {
+ try (Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+ Marshaller marsh = new JdkMarshaller();
+
+ for (int i = 0; i < CNT; i++) {
+ byte[] msg = marsh.marshal(new Tuple(i));
+
+ os.write(msg.length >>> 24);
+ os.write(msg.length >>> 16);
+ os.write(msg.length >>> 8);
+ os.write(msg.length);
+
+ os.write(msg);
+ }
+ }
+ catch (IOException | IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSizeBasedCustomConverter() throws Exception {
+ SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
+ @Override public Tuple convert(byte[] msg) {
+ int i = (msg[0] & 0xFF) << 24;
+ i |= (msg[1] & 0xFF) << 16;
+ i |= (msg[2] & 0xFF) << 8;
+ i |= msg[3] & 0xFF;
+
+ return new Tuple(i);
+ }
+ };
+
+ test(converter, null, new Runnable() {
+ @Override public void run() {
+ try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+
+ for (int i = 0; i < CNT; i++) {
+ os.write(0);
+ os.write(0);
+ os.write(0);
+ os.write(4);
+
+ os.write(i >>> 24);
+ os.write(i >>> 16);
+ os.write(i >>> 8);
+ os.write(i);
+ }
+ }
+ catch (IOException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDelimiterBasedDefaultConverter() throws Exception {
+ test(null, DELIM, new Runnable() {
+ @Override public void run() {
+ try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+ Marshaller marsh = new JdkMarshaller();
+
+ for (int i = 0; i < CNT; i++) {
+ byte[] msg = marsh.marshal(new Tuple(i));
+
+ os.write(msg);
+ os.write(DELIM);
+ }
+ }
+ catch (IOException | IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDelimiterBasedCustomConverter() throws Exception {
+ SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
+ @Override public Tuple convert(byte[] msg) {
+ int i = (msg[0] & 0xFF) << 24;
+ i |= (msg[1] & 0xFF) << 16;
+ i |= (msg[2] & 0xFF) << 8;
+ i |= msg[3] & 0xFF;
+
+ return new Tuple(i);
+ }
+ };
+
+ test(converter, DELIM, new Runnable() {
+ @Override public void run() {
+ try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+
+ for (int i = 0; i < CNT; i++) {
+ os.write(i >>> 24);
+ os.write(i >>> 16);
+ os.write(i >>> 8);
+ os.write(i);
+
+ os.write(DELIM);
+ }
+ }
+ catch (IOException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+ }
+
+ /**
+ * @param converter Converter.
+ * @param r Runnable..
+ */
+ private void test(@Nullable SocketMessageConverter<Tuple> converter, @Nullable byte[] delim, Runnable r) throws Exception
+ {
+ IgniteSocketStreamer<Tuple, Integer, String> sockStmr = null;
+
+ try (IgniteDataStreamer<Integer, String> stmr = ignite.dataStreamer(null)) {
+
+ stmr.allowOverwrite(true);
+ stmr.autoFlushFrequency(10);
+
+ sockStmr = new IgniteSocketStreamer<>();
+
+ IgniteCache<Integer, String> cache = ignite.cache(null);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ sockStmr.setPort(port);
+
+ sockStmr.setDelimiter(delim);
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<Tuple, Integer, String>() {
+ @Override public Map.Entry<Integer, String> extract(Tuple msg) {
+ return new IgniteBiTuple<>(msg.key, msg.val);
+ }
+ });
+
+ if (converter != null)
+ sockStmr.setConverter(converter);
+
+ final CountDownLatch latch = new CountDownLatch(CNT);
+
+ IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
+ @Override public boolean apply(UUID uuid, CacheEvent evt) {
+ latch.countDown();
+
+ return true;
+ }
+ };
+
+ ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
+
+ sockStmr.start();
+
+ r.run();
+
+ latch.await();
+
+ assertEquals(CNT, cache.size(CachePeekMode.PRIMARY));
+
+ for (int i = 0; i < CNT; i++)
+ assertEquals(Integer.toString(i), cache.get(i));
+ }
+ finally {
+ if (sockStmr != null)
+ sockStmr.stop();
+ }
+
+ }
+
+ /**
+ * Tuple.
+ */
+ private static class Tuple implements Serializable {
+ /** Serial version uid. */
+ private static final long serialVersionUID = 0L;
+
+ /** Key. */
+ private final int key;
+
+ /** Value. */
+ private final String val;
+
+ /**
+ * @param key Key.
+ */
+ Tuple(int key) {
+ this.key = key;
+ this.val = Integer.toString(key);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java b/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java
new file mode 100644
index 0000000..2e28469
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * Contains tests for socket streamer.
+ */
+package org.apache.ignite.stream.socket;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
new file mode 100644
index 0000000..87bbfbb
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
@@ -0,0 +1,39 @@
+/*
+ * 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.testsuites;
+
+import org.apache.ignite.stream.socket.*;
+
+import junit.framework.*;
+
+/**
+ * Stream test suite.
+ */
+public class IgniteStreamTestSuite extends TestSuite {
+ /**
+ * @return Stream tests suite.
+ * @throws Exception If failed.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Ignite Stream Test Suite");
+
+ suite.addTest(new TestSuite(IgniteSocketStreamerSelfTest.class));
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53995dcb/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
index 941b06e..32cd038 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
@@ -67,6 +67,7 @@ public class IgniteUtilSelfTestSuite extends TestSuite {
suite.addTestSuite(GridNioSelfTest.class);
suite.addTestSuite(GridNioFilterChainSelfTest.class);
suite.addTestSuite(GridNioSslSelfTest.class);
+ suite.addTestSuite(GridNioDelimitedBufferTest.class);
return suite;
}
[28/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3f7a80a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3f7a80a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3f7a80a2
Branch: refs/heads/ignite-37
Commit: 3f7a80a26ee06723f75bbb7247f4ce04d4586038
Parents: ba7fddb 4423a46
Author: avinogradov <av...@gridgain.com>
Authored: Tue May 19 16:42:46 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue May 19 16:42:46 2015 +0300
----------------------------------------------------------------------
LICENSE | 238 +++++++++++++++++++++++++++++++++++++++++
LICENSE.txt | 238 -----------------------------------------
NOTICE | 12 +++
NOTICE.txt | 12 ---
assembly/release-base.xml | 4 +-
5 files changed, 252 insertions(+), 252 deletions(-)
----------------------------------------------------------------------
[36/50] [abbrv] incubator-ignite git commit: IGNITE-926 Revisit
artifacts namings
Posted by sb...@apache.org.
IGNITE-926
Revisit artifacts namings
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0a4b1267
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0a4b1267
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0a4b1267
Branch: refs/heads/ignite-37
Commit: 0a4b12670e6f38229690288eaadde776d380c600
Parents: 7367912
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 20 16:03:48 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 20 16:03:48 2015 +0300
----------------------------------------------------------------------
pom.xml | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0a4b1267/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 29ef8ed..b91c904 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
</parent>
<groupId>org.apache.ignite</groupId>
- <artifactId>ignite</artifactId>
+ <artifactId>apache-ignite</artifactId>
<version>1.0.4-SNAPSHOT</version>
<packaging>pom</packaging>
@@ -39,7 +39,7 @@
<ignite.site>scp://localhost:/home</ignite.site>
<ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
<!--fix <attachartifact>...< /> at apache-release profile if changed-->
- <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-bin</ignite.zip.pattern>
+ <ignite.zip.pattern>${project.artifactId}-${ignite.edition}-${project.version}-bin</ignite.zip.pattern>
</properties>
<scm>
@@ -470,7 +470,7 @@
<descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
</descriptorRefs>
<tarLongFileMode>gnu</tarLongFileMode>
- <finalName>ignite-${project.version}-src</finalName>
+ <finalName>${project.artifactId}-${project.version}-src</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
@@ -482,7 +482,7 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
- <id>attach-artifact</id>
+ <id>attach-artifact</id><!-- allows to sign *bin.zip files -->
<phase>package</phase>
<goals>
<goal>run</goal>
@@ -490,8 +490,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}-bin.zip" classifier="fabric" type="zip" />
- <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}-bin.zip" classifier="hadoop" type="zip" />
+ <attachartifact file="${basedir}/target/bin/${project.artifactId}-fabric-${project.version}-bin.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/${project.artifactId}-hadoop-${project.version}-bin.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
@@ -538,7 +538,7 @@
<fileSet>
<directory>${basedir}/target</directory>
<includes>
- <include>ignite-${project.version}-src.zip</include>
+ <include>${project.artifactId}-${project.version}-src.zip</include>
<include>bin/*.zip</include>
</includes>
</fileSet>
@@ -566,10 +566,10 @@
<failOnError>false</failOnError>
<target>
<mkdir dir="${basedir}/target/site" />
- <copy file="${basedir}/target/ignite-${project.version}-src.zip" tofile="${basedir}/target/site/ignite-${project.version}-src.zip" failonerror="false" />
- <copy file="${basedir}/target/ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.asc" failonerror="false" />
- <copy file="${basedir}/target/ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.md5" failonerror="false" />
- <copy file="${basedir}/target/ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.sha1" failonerror="false" />
+ <copy file="${basedir}/target/${project.artifactId}-${project.version}-src.zip" tofile="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip" failonerror="false" />
+ <copy file="${basedir}/target/${project.artifactId}-${project.version}-src.zip.asc" tofile="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.asc" failonerror="false" />
+ <copy file="${basedir}/target/${project.artifactId}-${project.version}-src.zip.md5" tofile="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.md5" failonerror="false" />
+ <copy file="${basedir}/target/${project.artifactId}-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.sha1" failonerror="false" />
<copy todir="${basedir}/target/site">
<fileset dir="${basedir}/target/bin">
<include name="**/*" />
[15/50] [abbrv] incubator-ignite git commit: #ignite-797: Remove
'groupLock' logic from cache code.
Posted by sb...@apache.org.
#ignite-797: Remove 'groupLock' logic from cache code.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/da5a2282
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/da5a2282
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/da5a2282
Branch: refs/heads/ignite-37
Commit: da5a2282edc8e32d58d504d4ce96d5e88ab046e5
Parents: 94e202a
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri May 15 18:04:23 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri May 15 18:04:23 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 8 +-
.../processors/cache/GridCacheMapEntry.java | 35 +---
.../distributed/GridDistributedLockRequest.java | 111 +++----------
.../GridDistributedTxFinishRequest.java | 70 ++------
.../GridDistributedTxPrepareRequest.java | 112 +++----------
.../GridDistributedTxRemoteAdapter.java | 20 +--
.../distributed/dht/GridDhtLockFuture.java | 2 -
.../distributed/dht/GridDhtLockRequest.java | 45 +++--
.../dht/GridDhtTransactionalCacheAdapter.java | 6 -
.../distributed/dht/GridDhtTxFinishFuture.java | 3 -
.../distributed/dht/GridDhtTxFinishRequest.java | 43 +++--
.../cache/distributed/dht/GridDhtTxLocal.java | 6 -
.../distributed/dht/GridDhtTxLocalAdapter.java | 68 +-------
.../distributed/dht/GridDhtTxPrepareFuture.java | 18 +-
.../dht/GridDhtTxPrepareRequest.java | 60 ++++---
.../cache/distributed/dht/GridDhtTxRemote.java | 8 +-
.../colocated/GridDhtColocatedLockFuture.java | 6 -
.../distributed/near/GridNearLockFuture.java | 6 -
.../distributed/near/GridNearLockRequest.java | 61 +++----
.../near/GridNearOptimisticTxPrepareFuture.java | 15 +-
.../GridNearPessimisticTxPrepareFuture.java | 2 -
.../near/GridNearTransactionalCache.java | 4 -
.../near/GridNearTxFinishRequest.java | 28 ++--
.../cache/distributed/near/GridNearTxLocal.java | 20 +--
.../near/GridNearTxPrepareRequest.java | 52 +++---
.../distributed/near/GridNearTxRemote.java | 24 +--
.../cache/transactions/IgniteInternalTx.java | 10 --
.../transactions/IgniteTransactionsImpl.java | 4 +-
.../cache/transactions/IgniteTxAdapter.java | 72 +-------
.../cache/transactions/IgniteTxEntry.java | 48 +-----
.../cache/transactions/IgniteTxHandler.java | 6 -
.../transactions/IgniteTxLocalAdapter.java | 165 ++-----------------
.../cache/transactions/IgniteTxLocalEx.java | 21 +--
.../cache/transactions/IgniteTxManager.java | 62 +------
.../processors/cache/jta/CacheJtaManager.java | 4 +-
35 files changed, 239 insertions(+), 986 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 4106cb0..8d7b135 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -3906,9 +3906,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
READ_COMMITTED,
tCfg.getDefaultTxTimeout(),
!ctx.skipStore(),
- 0,
- /** group lock keys */null,
- /** partition lock */false
+ 0
);
assert tx != null;
@@ -3977,9 +3975,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
READ_COMMITTED,
ctx.kernalContext().config().getTransactionConfiguration().getDefaultTxTimeout(),
!ctx.skipStore(),
- 0,
- null,
- false);
+ 0);
return asyncOp(tx, op);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/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 86ed57a..92035af 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
@@ -961,13 +961,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
synchronized (this) {
checkObsolete();
- if (cctx.kernalContext().config().isCacheSanityCheckEnabled()) {
- if (tx != null && tx.groupLock())
- groupLockSanityCheck(tx);
- else
- assert tx == null || (!tx.local() && tx.onePhaseCommit()) || tx.ownsLock(this) :
- "Transaction does not own lock for update [entry=" + this + ", tx=" + tx + ']';
- }
+ assert tx == null || (!tx.local() && tx.onePhaseCommit()) || tx.ownsLock(this) :
+ "Transaction does not own lock for update [entry=" + this + ", tx=" + tx + ']';
// Load and remove from swap if it is new.
boolean startVer = isStartVersion();
@@ -1125,10 +1120,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
synchronized (this) {
checkObsolete();
- if (tx != null && tx.groupLock() && cctx.kernalContext().config().isCacheSanityCheckEnabled())
- groupLockSanityCheck(tx);
- else
- assert tx == null || (!tx.local() && tx.onePhaseCommit()) || tx.ownsLock(this) :
+ assert tx == null || (!tx.local() && tx.onePhaseCommit()) || tx.ownsLock(this) :
"Transaction does not own lock for remove[entry=" + this + ", tx=" + tx + ']';
boolean startVer = isStartVersion();
@@ -1195,7 +1187,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
obsoleteVer = newVer;
else {
// Only delete entry if the lock is not explicit.
- if (tx.groupLock() || lockedBy(tx.xidVersion()))
+ if (lockedBy(tx.xidVersion()))
obsoleteVer = tx.xidVersion();
else if (log.isDebugEnabled())
log.debug("Obsolete version was not set because lock was explicit: " + this);
@@ -2796,25 +2788,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
}
/**
- * Checks that entries in group locks transactions are not locked during commit.
- *
- * @param tx Transaction to check.
- * @throws GridCacheEntryRemovedException If entry is obsolete.
- * @throws IgniteCheckedException If entry was externally locked.
- */
- private void groupLockSanityCheck(IgniteInternalTx tx) throws GridCacheEntryRemovedException, IgniteCheckedException {
- assert tx.groupLock();
-
- IgniteTxEntry txEntry = tx.entry(txKey());
-
- if (txEntry.groupLockEntry()) {
- if (lockedByAny())
- throw new IgniteCheckedException("Failed to update cache entry (entry was externally locked while " +
- "accessing entry within group lock transaction) [entry=" + this + ", tx=" + tx + ']');
- }
- }
-
- /**
* @param failFast Fail fast flag.
* @param topVer Topology version.
* @param filter Filter.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index fd1040f..c5ac847 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed;
import org.apache.ignite.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -83,12 +82,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
/** Key count. */
private int txSize;
- /** Group lock key if this is a group-lock transaction. */
- private IgniteTxKey grpLockKey;
-
- /** Partition lock flag. Only if group-lock transaction. */
- private boolean partLock;
-
/**
* Additional flags.
* GridCacheUtils.SKIP_STORE_FLAG_MASK - for skipStore flag value.
@@ -116,9 +109,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
* @param timeout Lock timeout.
* @param keyCnt Number of keys.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
- * @param partLock {@code True} if this is a group-lock transaction request and whole partition is
- * locked.
* @param skipStore Skip store flag.
*/
public GridDistributedLockRequest(
@@ -135,8 +125,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
long timeout,
int keyCnt,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock,
boolean skipStore
) {
super(lockVer, keyCnt);
@@ -156,8 +144,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
this.isInvalidate = isInvalidate;
this.timeout = timeout;
this.txSize = txSize;
- this.grpLockKey = grpLockKey;
- this.partLock = partLock;
retVals = new boolean[keyCnt];
@@ -295,27 +281,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
}
/**
- * @return {@code True} if lock request for group-lock transaction.
- */
- public boolean groupLock() {
- return grpLockKey != null;
- }
-
- /**
- * @return Group lock key.
- */
- @Nullable public IgniteTxKey groupLockKey() {
- return grpLockKey;
- }
-
- /**
- * @return {@code True} if partition is locked in group-lock transaction.
- */
- public boolean partitionLock() {
- return partLock;
- }
-
- /**
* @return Max lock wait time.
*/
public long timeout() {
@@ -330,9 +295,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
GridCacheContext cctx = ctx.cacheContext(cacheId);
prepareMarshalCacheObjects(keys, cctx);
-
- if (grpLockKey != null)
- grpLockKey.prepareMarshal(cctx);
}
/** {@inheritDoc} */
@@ -342,9 +304,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
GridCacheContext cctx = ctx.cacheContext(cacheId);
finishUnmarshalCacheObjects(keys, cctx, ldr);
-
- if (grpLockKey != null)
- grpLockKey.finishUnmarshal(cctx, ldr);
}
/** {@inheritDoc} */
@@ -375,78 +334,66 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
writer.incrementState();
case 10:
- if (!writer.writeMessage("grpLockKey", grpLockKey))
- return false;
-
- writer.incrementState();
-
- case 11:
if (!writer.writeBoolean("isInTx", isInTx))
return false;
writer.incrementState();
- case 12:
+ case 11:
if (!writer.writeBoolean("isInvalidate", isInvalidate))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeBoolean("isRead", isRead))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeByte("isolation", isolation != null ? (byte)isolation.ordinal() : -1))
return false;
writer.incrementState();
- case 15:
+ case 14:
if (!writer.writeCollection("keys", keys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 16:
+ case 15:
if (!writer.writeMessage("nearXidVer", nearXidVer))
return false;
writer.incrementState();
- case 17:
+ case 16:
if (!writer.writeUuid("nodeId", nodeId))
return false;
writer.incrementState();
- case 18:
- if (!writer.writeBoolean("partLock", partLock))
- return false;
-
- writer.incrementState();
-
- case 19:
+ case 17:
if (!writer.writeBooleanArray("retVals", retVals))
return false;
writer.incrementState();
- case 20:
+ case 18:
if (!writer.writeLong("threadId", threadId))
return false;
writer.incrementState();
- case 21:
+ case 19:
if (!writer.writeLong("timeout", timeout))
return false;
writer.incrementState();
- case 22:
+ case 20:
if (!writer.writeInt("txSize", txSize))
return false;
@@ -485,14 +432,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
case 10:
- grpLockKey = reader.readMessage("grpLockKey");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 11:
isInTx = reader.readBoolean("isInTx");
if (!reader.isLastRead())
@@ -500,7 +439,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 12:
+ case 11:
isInvalidate = reader.readBoolean("isInvalidate");
if (!reader.isLastRead())
@@ -508,7 +447,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 13:
+ case 12:
isRead = reader.readBoolean("isRead");
if (!reader.isLastRead())
@@ -516,7 +455,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 14:
+ case 13:
byte isolationOrd;
isolationOrd = reader.readByte("isolation");
@@ -528,7 +467,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 15:
+ case 14:
keys = reader.readCollection("keys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -536,7 +475,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 16:
+ case 15:
nearXidVer = reader.readMessage("nearXidVer");
if (!reader.isLastRead())
@@ -544,7 +483,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 17:
+ case 16:
nodeId = reader.readUuid("nodeId");
if (!reader.isLastRead())
@@ -552,15 +491,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 18:
- partLock = reader.readBoolean("partLock");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 19:
+ case 17:
retVals = reader.readBooleanArray("retVals");
if (!reader.isLastRead())
@@ -568,7 +499,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 20:
+ case 18:
threadId = reader.readLong("threadId");
if (!reader.isLastRead())
@@ -576,7 +507,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 21:
+ case 19:
timeout = reader.readLong("timeout");
if (!reader.isLastRead())
@@ -584,7 +515,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 22:
+ case 20:
txSize = reader.readInt("txSize");
if (!reader.isLastRead())
@@ -604,7 +535,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 23;
+ return 21;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
index 9672a75..c524575 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
@@ -18,10 +18,8 @@
package org.apache.ignite.internal.processors.cache.distributed;
import org.apache.ignite.*;
-import org.apache.ignite.internal.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.lang.*;
@@ -66,9 +64,6 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
/** Expected txSize. */
private int txSize;
- /** Group lock key. */
- private IgniteTxKey grpLockKey;
-
/** System transaction flag. */
private boolean sys;
@@ -95,7 +90,6 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
* @param committedVers Committed versions.
* @param rolledbackVers Rolled back versions.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
*/
public GridDistributedTxFinishRequest(
GridCacheVersion xidVer,
@@ -111,8 +105,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
GridCacheVersion baseVer,
Collection<GridCacheVersion> committedVers,
Collection<GridCacheVersion> rolledbackVers,
- int txSize,
- @Nullable IgniteTxKey grpLockKey
+ int txSize
) {
super(xidVer, 0);
assert xidVer != null;
@@ -128,7 +121,6 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
this.syncRollback = syncRollback;
this.baseVer = baseVer;
this.txSize = txSize;
- this.grpLockKey = grpLockKey;
completedVersions(committedVers, rolledbackVers);
}
@@ -219,35 +211,15 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
return commit ? syncCommit : syncRollback;
}
- /**
- * @return {@code True} if group lock transaction.
- */
- public boolean groupLock() {
- return grpLockKey != null;
- }
-
- /**
- * @return Group lock key.
- */
- @Nullable public IgniteTxKey groupLockKey() {
- return grpLockKey;
- }
-
/** {@inheritDoc}
* @param ctx*/
@Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
super.prepareMarshal(ctx);
-
- if (grpLockKey != null)
- grpLockKey.prepareMarshal(ctx.cacheContext(cacheId));
}
/** {@inheritDoc} */
@Override public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException {
super.finishUnmarshal(ctx, ldr);
-
- if (grpLockKey != null)
- grpLockKey.finishUnmarshal(ctx.cacheContext(cacheId), ldr);
}
/** {@inheritDoc} */
@@ -290,48 +262,42 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
writer.incrementState();
case 12:
- if (!writer.writeMessage("grpLockKey", grpLockKey))
- return false;
-
- writer.incrementState();
-
- case 13:
if (!writer.writeBoolean("invalidate", invalidate))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
return false;
writer.incrementState();
- case 15:
+ case 14:
if (!writer.writeBoolean("syncCommit", syncCommit))
return false;
writer.incrementState();
- case 16:
+ case 15:
if (!writer.writeBoolean("syncRollback", syncRollback))
return false;
writer.incrementState();
- case 17:
+ case 16:
if (!writer.writeBoolean("sys", sys))
return false;
writer.incrementState();
- case 18:
+ case 17:
if (!writer.writeLong("threadId", threadId))
return false;
writer.incrementState();
- case 19:
+ case 18:
if (!writer.writeInt("txSize", txSize))
return false;
@@ -386,14 +352,6 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
case 12:
- grpLockKey = reader.readMessage("grpLockKey");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 13:
invalidate = reader.readBoolean("invalidate");
if (!reader.isLastRead())
@@ -401,7 +359,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 14:
+ case 13:
byte plcOrd;
plcOrd = reader.readByte("plc");
@@ -413,7 +371,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 15:
+ case 14:
syncCommit = reader.readBoolean("syncCommit");
if (!reader.isLastRead())
@@ -421,7 +379,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 16:
+ case 15:
syncRollback = reader.readBoolean("syncRollback");
if (!reader.isLastRead())
@@ -429,7 +387,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 17:
+ case 16:
sys = reader.readBoolean("sys");
if (!reader.isLastRead())
@@ -437,7 +395,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 18:
+ case 17:
threadId = reader.readLong("threadId");
if (!reader.isLastRead())
@@ -445,7 +403,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 19:
+ case 18:
txSize = reader.readInt("txSize");
if (!reader.isLastRead())
@@ -465,7 +423,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 20;
+ return 19;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index ec02e6e..cc2783a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -88,18 +88,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
@GridDirectCollection(GridCacheVersion.class)
private Collection<GridCacheVersion> dhtVerVals;
- /** Group lock key, if any. */
- @GridToStringInclude
- @GridDirectTransient
- private IgniteTxKey grpLockKey;
-
- /** Group lock key bytes. */
- @GridToStringExclude
- private byte[] grpLockKeyBytes;
-
- /** Partition lock flag. */
- private boolean partLock;
-
/** Expected transaction size. */
private int txSize;
@@ -130,8 +118,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
* @param tx Cache transaction.
* @param reads Read entries.
* @param writes Write entries.
- * @param grpLockKey Group lock key.
- * @param partLock {@code True} if preparing group-lock transaction with partition lock.
* @param txNodes Transaction nodes mapping.
* @param onePhaseCommit One phase commit flag.
*/
@@ -139,8 +125,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
IgniteInternalTx tx,
@Nullable Collection<IgniteTxEntry> reads,
Collection<IgniteTxEntry> writes,
- IgniteTxKey grpLockKey,
- boolean partLock,
Map<UUID, Collection<UUID>> txNodes,
boolean onePhaseCommit
) {
@@ -158,8 +142,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
this.reads = reads;
this.writes = writes;
- this.grpLockKey = grpLockKey;
- this.partLock = partLock;
this.txNodes = txNodes;
this.onePhaseCommit = onePhaseCommit;
}
@@ -272,20 +254,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
}
/**
- * @return Group lock key if preparing group-lock transaction.
- */
- @Nullable public IgniteTxKey groupLockKey() {
- return grpLockKey;
- }
-
- /**
- * @return {@code True} if preparing group-lock transaction with partition lock.
- */
- public boolean partitionLock() {
- return partLock;
- }
-
- /**
* @return Expected transaction size.
*/
public int txSize() {
@@ -310,9 +278,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
if (reads != null)
marshalTx(reads, ctx);
- if (grpLockKey != null && grpLockKeyBytes == null)
- grpLockKeyBytes = ctx.marshaller().marshal(grpLockKey);
-
if (dhtVers != null) {
for (IgniteTxKey key : dhtVers.keySet()) {
GridCacheContext cctx = ctx.cacheContext(key.cacheId());
@@ -338,9 +303,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
if (reads != null)
unmarshalTx(reads, false, ctx, ldr);
- if (grpLockKeyBytes != null && grpLockKey == null)
- grpLockKey = ctx.marshaller().unmarshal(grpLockKeyBytes, ldr);
-
if (dhtVerKeys != null && dhtVers == null) {
assert dhtVerVals != null;
assert dhtVerKeys.size() == dhtVerVals.size();
@@ -397,84 +359,72 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
writer.incrementState();
case 11:
- if (!writer.writeByteArray("grpLockKeyBytes", grpLockKeyBytes))
- return false;
-
- writer.incrementState();
-
- case 12:
if (!writer.writeBoolean("invalidate", invalidate))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeByte("isolation", isolation != null ? (byte)isolation.ordinal() : -1))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeBoolean("onePhaseCommit", onePhaseCommit))
return false;
writer.incrementState();
- case 15:
- if (!writer.writeBoolean("partLock", partLock))
- return false;
-
- writer.incrementState();
-
- case 16:
+ case 14:
if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
return false;
writer.incrementState();
- case 17:
+ case 15:
if (!writer.writeCollection("reads", reads, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 18:
+ case 16:
if (!writer.writeBoolean("sys", sys))
return false;
writer.incrementState();
- case 19:
+ case 17:
if (!writer.writeLong("threadId", threadId))
return false;
writer.incrementState();
- case 20:
+ case 18:
if (!writer.writeLong("timeout", timeout))
return false;
writer.incrementState();
- case 21:
+ case 19:
if (!writer.writeByteArray("txNodesBytes", txNodesBytes))
return false;
writer.incrementState();
- case 22:
+ case 20:
if (!writer.writeInt("txSize", txSize))
return false;
writer.incrementState();
- case 23:
+ case 21:
if (!writer.writeMessage("writeVer", writeVer))
return false;
writer.incrementState();
- case 24:
+ case 22:
if (!writer.writeCollection("writes", writes, MessageCollectionItemType.MSG))
return false;
@@ -525,14 +475,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
case 11:
- grpLockKeyBytes = reader.readByteArray("grpLockKeyBytes");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 12:
invalidate = reader.readBoolean("invalidate");
if (!reader.isLastRead())
@@ -540,7 +482,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 13:
+ case 12:
byte isolationOrd;
isolationOrd = reader.readByte("isolation");
@@ -552,7 +494,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 14:
+ case 13:
onePhaseCommit = reader.readBoolean("onePhaseCommit");
if (!reader.isLastRead())
@@ -560,15 +502,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 15:
- partLock = reader.readBoolean("partLock");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 16:
+ case 14:
byte plcOrd;
plcOrd = reader.readByte("plc");
@@ -580,7 +514,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 17:
+ case 15:
reads = reader.readCollection("reads", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -588,7 +522,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 18:
+ case 16:
sys = reader.readBoolean("sys");
if (!reader.isLastRead())
@@ -596,7 +530,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 19:
+ case 17:
threadId = reader.readLong("threadId");
if (!reader.isLastRead())
@@ -604,7 +538,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 20:
+ case 18:
timeout = reader.readLong("timeout");
if (!reader.isLastRead())
@@ -612,7 +546,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 21:
+ case 19:
txNodesBytes = reader.readByteArray("txNodesBytes");
if (!reader.isLastRead())
@@ -620,7 +554,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 22:
+ case 20:
txSize = reader.readInt("txSize");
if (!reader.isLastRead())
@@ -628,7 +562,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 23:
+ case 21:
writeVer = reader.readMessage("writeVer");
if (!reader.isLastRead())
@@ -636,7 +570,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 24:
+ case 22:
writes = reader.readCollection("writes", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -656,7 +590,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 25;
+ return 23;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 3215138..8594853 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -95,7 +95,6 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
* @param invalidate Invalidate flag.
* @param timeout Timeout.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
* @param subjId Subject ID.
* @param taskNameHash Task name hash code.
*/
@@ -112,7 +111,6 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
boolean invalidate,
long timeout,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
@Nullable UUID subjId,
int taskNameHash
) {
@@ -128,7 +126,6 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
isolation,
timeout,
txSize,
- grpLockKey,
subjId,
taskNameHash);
@@ -195,16 +192,6 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
// No-op.
}
- /**
- * Adds group lock key to remote transaction.
- *
- * @param key Key.
- */
- public void groupLockKey(IgniteTxKey key) {
- if (grpLockKey == null)
- grpLockKey = key;
- }
-
/** {@inheritDoc} */
@Override public GridTuple<CacheObject> peek(GridCacheContext cacheCtx,
boolean failFast,
@@ -350,7 +337,6 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
entry.op(e.op());
entry.ttl(e.ttl());
entry.explicitVersion(e.explicitVersion());
- entry.groupLockEntry(e.groupLockEntry());
// Conflict resolution stuff.
entry.conflictVersion(e.conflictVersion());
@@ -446,7 +432,7 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
GridCacheVersion ver = txEntry.explicitVersion() != null ? txEntry.explicitVersion() : xidVer;
// If locks haven't been acquired yet, keep waiting.
- if (!txEntry.groupLockEntry() && !Entry.lockedBy(ver)) {
+ if (!Entry.lockedBy(ver)) {
if (log.isDebugEnabled())
log.debug("Transaction does not own lock for entry (will wait) [entry=" + Entry +
", tx=" + this + ']');
@@ -607,10 +593,6 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
}
// No-op.
else {
- assert !groupLock() || txEntry.groupLockEntry() || ownsLock(txEntry.cached()):
- "Transaction does not own lock for group lock entry during commit [tx=" +
- this + ", txEntry=" + txEntry + ']';
-
if (conflictCtx == null || !conflictCtx.isUseOld()) {
if (txEntry.ttl() != CU.TTL_NOT_CHANGED)
cached.updateTtl(null, txEntry.ttl());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 5b0275c..c57eded 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -833,8 +833,6 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
cnt,
0,
inTx() ? tx.size() : cnt,
- inTx() ? tx.groupLockKey() : null,
- inTx() && tx.partitionLock(),
inTx() ? tx.subjectId() : null,
inTx() ? tx.taskNameHash() : 0,
read ? accessTtl : -1L,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
index 9b69571..94ec718 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
-import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.tostring.*;
@@ -101,8 +100,6 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
* @param dhtCnt DHT count.
* @param nearCnt Near count.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key.
- * @param partLock {@code True} if partition lock.
* @param subjId Subject ID.
* @param taskNameHash Task name hash code.
* @param accessTtl TTL for read operation.
@@ -125,8 +122,6 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
int dhtCnt,
int nearCnt,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock,
@Nullable UUID subjId,
int taskNameHash,
long accessTtl,
@@ -145,8 +140,6 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
timeout,
dhtCnt == 0 ? nearCnt : dhtCnt,
txSize,
- grpLockKey,
- partLock,
skipStore);
this.topVer = topVer;
@@ -331,55 +324,55 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
}
switch (writer.state()) {
- case 23:
+ case 21:
if (!writer.writeLong("accessTtl", accessTtl))
return false;
writer.incrementState();
- case 24:
+ case 22:
if (!writer.writeBitSet("invalidateEntries", invalidateEntries))
return false;
writer.incrementState();
- case 25:
+ case 23:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 26:
+ case 24:
if (!writer.writeCollection("nearKeys", nearKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 27:
+ case 25:
if (!writer.writeByteArray("ownedBytes", ownedBytes))
return false;
writer.incrementState();
- case 28:
+ case 26:
if (!writer.writeBitSet("preloadKeys", preloadKeys))
return false;
writer.incrementState();
- case 29:
+ case 27:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 30:
+ case 28:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 31:
+ case 29:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -401,7 +394,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
return false;
switch (reader.state()) {
- case 23:
+ case 21:
accessTtl = reader.readLong("accessTtl");
if (!reader.isLastRead())
@@ -409,7 +402,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 24:
+ case 22:
invalidateEntries = reader.readBitSet("invalidateEntries");
if (!reader.isLastRead())
@@ -417,7 +410,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 25:
+ case 23:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -425,7 +418,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 26:
+ case 24:
nearKeys = reader.readCollection("nearKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -433,7 +426,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 27:
+ case 25:
ownedBytes = reader.readByteArray("ownedBytes");
if (!reader.isLastRead())
@@ -441,7 +434,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 28:
+ case 26:
preloadKeys = reader.readBitSet("preloadKeys");
if (!reader.isLastRead())
@@ -449,7 +442,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 29:
+ case 27:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -457,7 +450,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 30:
+ case 28:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -465,7 +458,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 31:
+ case 29:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -485,7 +478,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 32;
+ return 30;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 068e8b2..26eef50 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -203,7 +203,6 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
req.isInvalidate(),
req.timeout(),
req.txSize(),
- req.groupLockKey(),
req.subjectId(),
req.taskNameHash());
@@ -222,9 +221,6 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
null,
req.accessTtl(),
req.skipStore());
-
- if (req.groupLock())
- tx.groupLockKey(txKey);
}
entry = entryExx(key, req.topologyVersion());
@@ -810,8 +806,6 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
req.isInvalidate(),
false,
req.txSize(),
- req.groupLockKey(),
- req.partitionLock(),
null,
req.subjectId(),
req.taskNameHash());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 7c35fc5..7fd79e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -309,7 +309,6 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
tx.rolledbackVersions(),
tx.pendingVersions(),
tx.size(),
- tx.groupLockKey(),
tx.subjectId(),
tx.taskNameHash());
@@ -387,7 +386,6 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
tx.rolledbackVersions(),
tx.pendingVersions(),
tx.size(),
- tx.groupLockKey(),
tx.subjectId(),
tx.taskNameHash());
@@ -439,7 +437,6 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
tx.rolledbackVersions(),
tx.pendingVersions(),
tx.size(),
- tx.groupLockKey(),
tx.subjectId(),
tx.taskNameHash());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
index d20a7c3..7b077c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
-import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -97,7 +96,6 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
* @param rolledbackVers Rolled back versions.
* @param pendingVers Pending versions.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key.
* @param subjId Subject ID.
* @param taskNameHash Task name hash.
*/
@@ -122,12 +120,11 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
Collection<GridCacheVersion> rolledbackVers,
Collection<GridCacheVersion> pendingVers,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
@Nullable UUID subjId,
int taskNameHash
) {
super(xidVer, futId, commitVer, threadId, commit, invalidate, sys, plc, syncCommit, syncRollback, baseVer,
- committedVers, rolledbackVers, txSize, grpLockKey);
+ committedVers, rolledbackVers, txSize);
assert miniId != null;
assert nearNodeId != null;
@@ -241,55 +238,55 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
}
switch (writer.state()) {
- case 20:
+ case 19:
if (!writer.writeByte("isolation", isolation != null ? (byte)isolation.ordinal() : -1))
return false;
writer.incrementState();
- case 21:
+ case 20:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeUuid("nearNodeId", nearNodeId))
return false;
writer.incrementState();
- case 23:
+ case 22:
if (!writer.writeCollection("pendingVers", pendingVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 25:
+ case 24:
if (!writer.writeBoolean("sysInvalidate", sysInvalidate))
return false;
writer.incrementState();
- case 26:
+ case 25:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 27:
+ case 26:
if (!writer.writeMessage("topVer", topVer))
return false;
writer.incrementState();
- case 28:
+ case 27:
if (!writer.writeMessage("writeVer", writeVer))
return false;
@@ -311,7 +308,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
return false;
switch (reader.state()) {
- case 20:
+ case 19:
byte isolationOrd;
isolationOrd = reader.readByte("isolation");
@@ -323,7 +320,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 21:
+ case 20:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -331,7 +328,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 22:
+ case 21:
nearNodeId = reader.readUuid("nearNodeId");
if (!reader.isLastRead())
@@ -339,7 +336,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 23:
+ case 22:
pendingVers = reader.readCollection("pendingVers", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -347,7 +344,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 24:
+ case 23:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -355,7 +352,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 25:
+ case 24:
sysInvalidate = reader.readBoolean("sysInvalidate");
if (!reader.isLastRead())
@@ -363,7 +360,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 26:
+ case 25:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -371,7 +368,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 27:
+ case 26:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -379,7 +376,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 28:
+ case 27:
writeVer = reader.readMessage("writeVer");
if (!reader.isLastRead())
@@ -399,6 +396,6 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 29;
+ return 28;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
index 614f520..841cac8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
@@ -93,8 +93,6 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
* @param timeout Timeout.
* @param storeEnabled Store enabled flag.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
- * @param partLock {@code True} if this is a group-lock transaction and whole partition should be locked.
* @param txNodes Transaction nodes mapping.
*/
public GridDhtTxLocal(
@@ -115,8 +113,6 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
boolean invalidate,
boolean storeEnabled,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock,
Map<UUID, Collection<UUID>> txNodes,
UUID subjId,
int taskNameHash
@@ -135,8 +131,6 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
invalidate,
storeEnabled,
txSize,
- grpLockKey,
- partLock,
subjId,
taskNameHash);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 444085f..54b59b8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -94,8 +94,6 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
* @param isolation Isolation.
* @param timeout Timeout.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
- * @param partLock If this is a group-lock transaction and the whole partition should be locked.
*/
protected GridDhtTxLocalAdapter(
GridCacheSharedContext cctx,
@@ -111,13 +109,11 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
boolean invalidate,
boolean storeEnabled,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock,
@Nullable UUID subjId,
int taskNameHash
) {
super(cctx, xidVer, implicit, implicitSingle, sys, plc, concurrency, isolation, timeout, invalidate,
- storeEnabled, txSize, grpLockKey, partLock, subjId, taskNameHash);
+ storeEnabled, txSize, subjId, taskNameHash);
assert cctx != null;
@@ -733,68 +729,6 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
}
/** {@inheritDoc} */
- @Override protected void addGroupTxMapping(Collection<IgniteTxKey> keys) {
- assert groupLock();
-
- for (GridDistributedTxMapping mapping : dhtMap.values())
- mapping.entries(Collections.unmodifiableCollection(txMap.values()), true);
-
- // Here we know that affinity key for all given keys is our group lock key.
- // Just add entries to dht mapping.
- // Add near readers. If near cache is disabled on all nodes, do nothing.
- Collection<UUID> backupIds = dhtMap.keySet();
-
- Map<ClusterNode, List<GridDhtCacheEntry>> locNearMap = null;
-
- for (IgniteTxKey key : keys) {
- IgniteTxEntry txEntry = entry(key);
-
- if (!txEntry.groupLockEntry() || txEntry.context().isNear())
- continue;
-
- assert txEntry.cached() instanceof GridDhtCacheEntry : "Invalid entry type: " + txEntry.cached();
-
- while (true) {
- try {
- GridDhtCacheEntry entry = (GridDhtCacheEntry)txEntry.cached();
-
- Collection<UUID> readers = entry.readers();
-
- if (!F.isEmpty(readers)) {
- Collection<ClusterNode> nearNodes = cctx.discovery().nodes(readers, F0.notEqualTo(nearNodeId()),
- F.notIn(backupIds));
-
- if (log.isDebugEnabled())
- log.debug("Mapping entry to near nodes [nodes=" + U.nodeIds(nearNodes) + ", entry=" +
- entry + ']');
-
- for (ClusterNode n : nearNodes) {
- if (locNearMap == null)
- locNearMap = new HashMap<>();
-
- List<GridDhtCacheEntry> entries = locNearMap.get(n);
-
- if (entries == null)
- locNearMap.put(n, entries = new LinkedList<>());
-
- entries.add(entry);
- }
- }
-
- break;
- }
- catch (GridCacheEntryRemovedException ignored) {
- // Retry.
- txEntry.cached(txEntry.context().dht().entryExx(key.key(), topologyVersion()));
- }
- }
- }
-
- if (locNearMap != null)
- addNearNodeEntryMapping(locNearMap);
- }
-
- /** {@inheritDoc} */
@SuppressWarnings({"CatchGenericClass", "ThrowableInstanceNeverThrown"})
@Override public boolean finish(boolean commit) throws IgniteCheckedException {
if (log.isDebugEnabled())
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 0e64726..3056ae5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -414,8 +414,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
if (log.isDebugEnabled())
log.debug("Marking all local candidates as ready: " + this);
- Iterable<IgniteTxEntry> checkEntries = tx.groupLock() ?
- Collections.singletonList(tx.groupLockEntry()) : writes;
+ Iterable<IgniteTxEntry> checkEntries = writes;
for (IgniteTxEntry txEntry : checkEntries) {
GridCacheContext cacheCtx = txEntry.context();
@@ -431,10 +430,8 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
txEntry.cached(entry);
}
- if (tx.optimistic() && txEntry.explicitVersion() == null) {
- if (!tx.groupLock() || tx.groupLockKey().equals(entry.txKey()))
- lockKeys.add(txEntry.txKey());
- }
+ if (tx.optimistic() && txEntry.explicitVersion() == null)
+ lockKeys.add(txEntry.txKey());
while (true) {
try {
@@ -803,8 +800,6 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
tx,
dhtWrites,
nearWrites,
- tx.groupLockKey(),
- tx.partitionLock(),
txNodes,
tx.nearXidVersion(),
true,
@@ -823,9 +818,6 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
if (entry.explicitVersion() == null) {
GridCacheMvccCandidate added = cached.candidate(version());
- assert added != null || entry.groupLockEntry() :
- "Null candidate for non-group-lock entry " +
- "[added=" + added + ", entry=" + entry + ']';
assert added == null || added.dhtLocal() :
"Got non-dht-local candidate for prepare future " +
"[added=" + added + ", entry=" + entry + ']';
@@ -906,8 +898,6 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
tx,
null,
nearMapping.writes(),
- tx.groupLockKey(),
- tx.partitionLock(),
tx.transactionNodes(),
tx.nearXidVersion(),
true,
@@ -920,8 +910,6 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
if (entry.explicitVersion() == null) {
GridCacheMvccCandidate added = entry.cached().candidate(version());
- assert added != null || entry.groupLockEntry() : "Null candidate for non-group-lock entry " +
- "[added=" + added + ", entry=" + entry + ']';
assert added == null || added.dhtLocal() : "Got non-dht-local candidate for prepare future" +
"[added=" + added + ", entry=" + entry + ']';
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index c033273..73f86fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -104,8 +104,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
* @param tx Transaction.
* @param dhtWrites DHT writes.
* @param nearWrites Near writes.
- * @param grpLockKey Group lock key if preparing group-lock transaction.
- * @param partLock {@code True} if group-lock transaction locks partition.
* @param txNodes Transaction nodes mapping.
* @param nearXidVer Near transaction ID.
* @param last {@code True} if this is last prepare request for node.
@@ -118,15 +116,13 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
GridDhtTxLocalAdapter tx,
Collection<IgniteTxEntry> dhtWrites,
Collection<IgniteTxEntry> nearWrites,
- IgniteTxKey grpLockKey,
- boolean partLock,
Map<UUID, Collection<UUID>> txNodes,
GridCacheVersion nearXidVer,
boolean last,
boolean onePhaseCommit,
UUID subjId,
int taskNameHash) {
- super(tx, null, dhtWrites, grpLockKey, partLock, txNodes, onePhaseCommit);
+ super(tx, null, dhtWrites, txNodes, onePhaseCommit);
assert futId != null;
assert miniId != null;
@@ -337,79 +333,79 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
}
switch (writer.state()) {
- case 25:
+ case 23:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 26:
+ case 24:
if (!writer.writeBitSet("invalidateNearEntries", invalidateNearEntries))
return false;
writer.incrementState();
- case 27:
+ case 25:
if (!writer.writeBoolean("last", last))
return false;
writer.incrementState();
- case 28:
+ case 26:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 29:
+ case 27:
if (!writer.writeUuid("nearNodeId", nearNodeId))
return false;
writer.incrementState();
- case 30:
+ case 28:
if (!writer.writeCollection("nearWrites", nearWrites, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 31:
+ case 29:
if (!writer.writeMessage("nearXidVer", nearXidVer))
return false;
writer.incrementState();
- case 32:
+ case 30:
if (!writer.writeCollection("ownedKeys", ownedKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 33:
+ case 31:
if (!writer.writeCollection("ownedVals", ownedVals, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 34:
+ case 32:
if (!writer.writeBitSet("preloadKeys", preloadKeys))
return false;
writer.incrementState();
- case 35:
+ case 33:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 36:
+ case 34:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 37:
+ case 35:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -431,7 +427,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
return false;
switch (reader.state()) {
- case 25:
+ case 23:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -439,7 +435,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 26:
+ case 24:
invalidateNearEntries = reader.readBitSet("invalidateNearEntries");
if (!reader.isLastRead())
@@ -447,7 +443,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 27:
+ case 25:
last = reader.readBoolean("last");
if (!reader.isLastRead())
@@ -455,7 +451,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 28:
+ case 26:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -463,7 +459,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 29:
+ case 27:
nearNodeId = reader.readUuid("nearNodeId");
if (!reader.isLastRead())
@@ -471,7 +467,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 30:
+ case 28:
nearWrites = reader.readCollection("nearWrites", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -479,7 +475,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 31:
+ case 29:
nearXidVer = reader.readMessage("nearXidVer");
if (!reader.isLastRead())
@@ -487,7 +483,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 32:
+ case 30:
ownedKeys = reader.readCollection("ownedKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -495,7 +491,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 33:
+ case 31:
ownedVals = reader.readCollection("ownedVals", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -503,7 +499,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 34:
+ case 32:
preloadKeys = reader.readBitSet("preloadKeys");
if (!reader.isLastRead())
@@ -511,7 +507,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 35:
+ case 33:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -519,7 +515,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 36:
+ case 34:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -527,7 +523,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 37:
+ case 35:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -547,6 +543,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 38;
+ return 36;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
index 30464a5..0a69910 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
@@ -77,7 +77,6 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
* @param timeout Timeout.
* @param ctx Cache context.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
* @param nearXidVer Near transaction ID.
* @param txNodes Transaction nodes mapping.
*/
@@ -97,14 +96,13 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
boolean invalidate,
long timeout,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
GridCacheVersion nearXidVer,
Map<UUID, Collection<UUID>> txNodes,
@Nullable UUID subjId,
int taskNameHash
) {
super(ctx, nodeId, rmtThreadId, xidVer, commitVer, sys, plc, concurrency, isolation, invalidate, timeout,
- txSize, grpLockKey, subjId, taskNameHash);
+ txSize, subjId, taskNameHash);
assert nearNodeId != null;
assert rmtFutId != null;
@@ -139,7 +137,6 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
* @param timeout Timeout.
* @param ctx Cache context.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if transaction is group-lock.
*/
public GridDhtTxRemote(
GridCacheSharedContext ctx,
@@ -158,12 +155,11 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
boolean invalidate,
long timeout,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
@Nullable UUID subjId,
int taskNameHash
) {
super(ctx, nodeId, rmtThreadId, xidVer, commitVer, sys, plc, concurrency, isolation, invalidate, timeout,
- txSize, grpLockKey, subjId, taskNameHash);
+ txSize, subjId, taskNameHash);
assert nearNodeId != null;
assert rmtFutId != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index e905cd5..e6a4eaf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -754,8 +754,6 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
mappedKeys.size(),
inTx() ? tx.size() : mappedKeys.size(),
inTx() && tx.syncCommit(),
- inTx() ? tx.groupLockKey() : null,
- inTx() && tx.partitionLock(),
inTx() ? tx.subjectId() : null,
inTx() ? tx.taskNameHash() : 0,
read ? accessTtl : -1L,
@@ -1090,10 +1088,6 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
// If primary node left the grid before lock acquisition, fail the whole future.
throw newTopologyException(null, primary.id());
- if (inTx() && tx.groupLock() && !primary.isLocal())
- throw new IgniteCheckedException("Failed to start group lock transaction (local node is not primary for " +
- " key) [key=" + key + ", primaryNodeId=" + primary.id() + ']');
-
if (mapping == null || !primary.id().equals(mapping.node().id()))
mapping = new GridNearLockMapping(primary, key);
else
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 25bd76b..0ffb4e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -890,8 +890,6 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B
mappedKeys.size(),
inTx() ? tx.size() : mappedKeys.size(),
inTx() && tx.syncCommit(),
- inTx() ? tx.groupLockKey() : null,
- inTx() && tx.partitionLock(),
inTx() ? tx.subjectId() : null,
inTx() ? tx.taskNameHash() : 0,
read ? accessTtl : -1L,
@@ -1188,10 +1186,6 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B
// If primary node left the grid before lock acquisition, fail the whole future.
throw newTopologyException(null, primary.id());
- if (inTx() && tx.groupLock() && !primary.isLocal())
- throw new IgniteCheckedException("Failed to start group lock transaction (local node is not primary for " +
- " key) [key=" + key + ", primaryNodeId=" + primary.id() + ']');
-
if (mapping == null || !primary.id().equals(mapping.node().id()))
mapping = new GridNearLockMapping(primary, key);
else
[20/50] [abbrv] incubator-ignite git commit: GG-7190
Posted by sb...@apache.org.
GG-7190
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/489323b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/489323b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/489323b0
Branch: refs/heads/ignite-37
Commit: 489323b0175f6eba897caf3f40f4f0fcb970df19
Parents: 04774b5f
Author: avinogradov <av...@gridgain.com>
Authored: Mon May 18 12:54:41 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon May 18 12:54:41 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/489323b0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 5738778..7fa0a03 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -64,6 +64,7 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTest(new TestSuite(GridCacheNearMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCacheAtomicNearMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCacheNearReadersSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearReaderPreloadSelfTest.class));
suite.addTest(new TestSuite(GridCacheAtomicNearReadersSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedAffinitySelfTest.class));
suite.addTest(new TestSuite(GridCacheRendezvousAffinityFunctionExcludeNeighborsSelfTest.class));
[22/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-timeout' into ignite-sprint-5
Posted by sb...@apache.org.
Merge branch 'ignite-timeout' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/15d55b1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/15d55b1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/15d55b1a
Branch: refs/heads/ignite-37
Commit: 15d55b1a5fcaee7c91f450426bc537f3dffd77cf
Parents: 36805cc df25d35
Author: nikolay tikhonov <nt...@gridgain.com>
Authored: Mon May 18 14:49:20 2015 +0300
Committer: nikolay tikhonov <nt...@gridgain.com>
Committed: Mon May 18 14:49:20 2015 +0300
----------------------------------------------------------------------
.../spi/discovery/tcp/TcpDiscoverySpiAdapter.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[17/50] [abbrv] incubator-ignite git commit: # added test
Posted by sb...@apache.org.
# added test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2149639d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2149639d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2149639d
Branch: refs/heads/ignite-37
Commit: 2149639dd360ad6f180e16d23dbe878b05cc730a
Parents: a27a35d
Author: sboikov <se...@inria.fr>
Authored: Sat May 16 06:59:51 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Sat May 16 06:59:51 2015 +0300
----------------------------------------------------------------------
.../near/IgniteCacheNearOnlyTxTest.java | 52 +++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2149639d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java
index 06a4bfc..88e7f03 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.transactions.*;
@@ -77,7 +78,7 @@ public class IgniteCacheNearOnlyTxTest extends IgniteCacheAbstractTest {
ignite1.createNearCache(null, new NearCacheConfiguration<>());
- GridTestUtils.runMultiThreaded(new Callable<Object>() {
+ GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
@Override public Object call() throws Exception {
IgniteCache cache = ignite1.cache(null);
@@ -137,4 +138,53 @@ public class IgniteCacheNearOnlyTxTest extends IgniteCacheAbstractTest {
}
}, 5, "put-thread");
}
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testConcurrentTx() throws Exception {
+ final Ignite ignite1 = ignite(1);
+
+ assertTrue(ignite1.configuration().isClientMode());
+
+ ignite1.createNearCache(null, new NearCacheConfiguration<>());
+
+ IgniteInternalFuture<?> fut1 = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgniteCache cache = ignite1.cache(null);
+
+ int key = 1;
+
+ for (int i = 0; i < 100; i++)
+ cache.put(key, 1);
+
+ return null;
+ }
+ }, 5, "put1-thread");
+
+ IgniteInternalFuture<?> fut2 = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgniteCache cache = ignite1.cache(null);
+
+ int key = 1;
+
+ IgniteTransactions txs = ignite1.transactions();
+
+ for (int i = 0; i < 100; i++) {
+ try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ cache.get(key);
+
+ cache.put(key, 1);
+
+ tx.commit();
+ }
+ }
+
+ return null;
+ }
+ }, 5, "put2-thread");
+
+ fut1.get();
+ fut2.get();
+ }
}
[50/50] [abbrv] incubator-ignite git commit: ignite-37 Improve
offheap metrics for cache
Posted by sb...@apache.org.
ignite-37 Improve offheap metrics for cache
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b445ac59
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b445ac59
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b445ac59
Branch: refs/heads/ignite-37
Commit: b445ac5964bfa409d57aaf05547fc4e908b986a8
Parents: 51d32fc
Author: agura <ag...@gridgain.com>
Authored: Thu Apr 30 20:53:53 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Thu May 21 16:41:00 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/cache/CacheMetrics.java | 187 +++++++--
.../internal/managers/GridManagerAdapter.java | 59 +--
.../swapspace/GridSwapSpaceManager.java | 147 ++++---
.../processors/cache/CacheMetricsImpl.java | 305 +++++++++++++-
.../cache/CacheMetricsMXBeanImpl.java | 100 +++++
.../processors/cache/CacheMetricsSnapshot.java | 380 +++++++++++++----
.../processors/cache/GridCacheSwapManager.java | 152 +++----
.../offheap/GridOffHeapProcessor.java | 105 +++--
.../ignite/mxbean/CacheMetricsMXBean.java | 80 ++++
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 35 +-
.../org/apache/ignite/spi/IgniteSpiContext.java | 47 ---
.../spi/swapspace/file/FileSwapSpaceSpi.java | 8 +-
.../swapspace/GridSwapSpaceManagerSelfTest.java | 44 +-
...CacheLocalOffHeapAndSwapMetricsSelfTest.java | 412 +++++++++++++++++++
.../testframework/GridSpiTestContext.java | 25 +-
.../IgniteCacheMetricsSelfTestSuite.java | 1 +
16 files changed, 1616 insertions(+), 471 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
index 0d87326..799aace 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
@@ -30,21 +30,21 @@ public interface CacheMetrics {
/**
* The number of get requests that were satisfied by the cache.
*
- * @return the number of hits
+ * @return The number of hits.
*/
public long getCacheHits();
/**
* This is a measure of cache efficiency.
*
- * @return the percentage of successful hits, as a decimal e.g 75.
+ * @return The percentage of successful hits, as a decimal e.g 75.
*/
public float getCacheHitPercentage();
/**
* A miss is a get request that is not satisfied.
*
- * @return the number of misses
+ * @return The number of misses.
*/
public long getCacheMisses();
@@ -52,7 +52,7 @@ public interface CacheMetrics {
* Returns the percentage of cache accesses that did not find a requested entry
* in the cache.
*
- * @return the percentage of accesses that failed to find anything
+ * @return The percentage of accesses that failed to find anything.
*/
public float getCacheMissPercentage();
@@ -60,14 +60,14 @@ public interface CacheMetrics {
* The total number of requests to the cache. This will be equal to the sum of
* the hits and misses.
*
- * @return the number of gets
+ * @return The number of gets.
*/
public long getCacheGets();
/**
* The total number of puts to the cache.
*
- * @return the number of puts
+ * @return The number of puts.
*/
public long getCachePuts();
@@ -75,7 +75,7 @@ public interface CacheMetrics {
* The total number of removals from the cache. This does not include evictions,
* where the cache itself initiates the removal to make space.
*
- * @return the number of removals
+ * @return The number of removals.
*/
public long getCacheRemovals();
@@ -84,28 +84,28 @@ public interface CacheMetrics {
* initiated by the cache itself to free up space. An eviction is not treated as
* a removal and does not appear in the removal counts.
*
- * @return the number of evictions
+ * @return The number of evictions.
*/
public long getCacheEvictions();
/**
* The mean time to execute gets.
*
- * @return the time in µs
+ * @return The time in µs.
*/
public float getAverageGetTime();
/**
* The mean time to execute puts.
*
- * @return the time in µs
+ * @return The time in µs.
*/
public float getAveragePutTime();
/**
* The mean time to execute removes.
*
- * @return the time in µs
+ * @return The time in µs.
*/
public float getAverageRemoveTime();
@@ -113,7 +113,7 @@ public interface CacheMetrics {
/**
* The mean time to execute tx commit.
*
- * @return the time in µs
+ * @return The time in µs.
*/
public float getAverageTxCommitTime();
@@ -124,7 +124,6 @@ public interface CacheMetrics {
*/
public float getAverageTxRollbackTime();
-
/**
* Gets total number of transaction commits.
*
@@ -154,6 +153,62 @@ public interface CacheMetrics {
public long getOverflowSize();
/**
+ * The total number of get requests to the off-heap memory.
+ *
+ * @return The number of gets.
+ */
+ public long getOffHeapGets();
+
+ /**
+ * The total number of put requests to the off-heap memory.
+ *
+ * @return The number of puts.
+ */
+ public long getOffHeapPuts();
+
+ /**
+ * The total number of removals from the off-heap memory. This does not include evictions.
+ *
+ * @return The number of removals.
+ */
+ public long getOffHeapRemovals();
+
+ /**
+ * The total number of evictions from the off-heap memory.
+ *
+ * @return The number of evictions.
+ */
+ public long getOffHeapEvictions();
+
+ /**
+ * The number of get requests that were satisfied by the off-heap memory.
+ *
+ * @return The off-heap hits number.
+ */
+ public long getOffHeapHits();
+
+ /**
+ * Gets the percentage of hits on off-heap memory.
+ *
+ * @return The percentage of hits on off-heap memory.
+ */
+ public float getOffHeapHitPercentage();
+
+ /**
+ * A miss is a get request that is not satisfied by off-heap memory.
+ *
+ * @return The off-heap misses number.
+ */
+ public long getOffHeapMisses();
+
+ /**
+ * Gets the percentage of misses on off-heap memory.
+ *
+ * @return The percentage of misses on off-heap memory.
+ */
+ public float getOffHeapMissPercentage();
+
+ /**
* Gets number of entries stored in off-heap memory.
*
* @return Number of entries stored in off-heap memory.
@@ -161,6 +216,20 @@ public interface CacheMetrics {
public long getOffHeapEntriesCount();
/**
+ * Gets number of primary entries stored in off-heap memory.
+ *
+ * @return Number of primary entries stored in off-heap memory.
+ */
+ public long getOffHeapPrimaryEntriesCount();
+
+ /**
+ * Gets number of backup entries stored in off-heap memory.
+ *
+ * @return Number of backup entries stored in off-heap memory.
+ */
+ public long getOffHeapBackupEntriesCount();
+
+ /**
* Gets memory size allocated in off-heap.
*
* @return Memory size allocated in off-heap.
@@ -168,6 +237,76 @@ public interface CacheMetrics {
public long getOffHeapAllocatedSize();
/**
+ * Gets off-heap memory maximum size.
+ *
+ * @return Off-heap memory maximum size.
+ */
+ public long getOffHeapMaxSize();
+
+ /**
+ * The total number of get requests to the swap.
+ *
+ * @return The number of gets.
+ */
+ public long getSwapGets();
+
+ /**
+ * The total number of put requests to the swap.
+ *
+ * @return The number of puts.
+ */
+ public long getSwapPuts();
+
+ /**
+ * The total number of removals from the swap.
+ *
+ * @return The number of removals.
+ */
+ public long getSwapRemovals();
+
+ /**
+ * The number of get requests that were satisfied by the swap.
+ *
+ * @return The swap hits number.
+ */
+ public long getSwapHits();
+
+ /**
+ * A miss is a get request that is not satisfied by swap.
+ *
+ * @return The swap misses number.
+ */
+ public long getSwapMisses();
+
+ /**
+ * Gets number of entries stored in swap.
+ *
+ * @return Number of entries stored in swap.
+ */
+ public long getSwapEntriesCount();
+
+ /**
+ * Gets size of swap.
+ *
+ * @return Size of swap.
+ */
+ public long getSwapSize();
+
+ /**
+ * Gets the percentage of hits on swap.
+ *
+ * @return The percentage of hits on swap.
+ */
+ public float getSwapHitPercentage();
+
+ /**
+ * Gets the percentage of misses on swap.
+ *
+ * @return The percentage of misses on swap.
+ */
+ public float getSwapMissPercentage();
+
+ /**
* Gets number of non-{@code null} values in the cache.
*
* @return Number of non-{@code null} values in the cache.
@@ -184,7 +323,7 @@ public interface CacheMetrics {
/**
* Returns {@code true} if this cache is empty.
*
- * @return {@code true} if this cache is empty.
+ * @return {@code True} if this cache is empty.
*/
public boolean isEmpty();
@@ -294,7 +433,7 @@ public interface CacheMetrics {
public int getTxDhtRolledbackVersionsSize();
/**
- * Returns {@code True} if write-behind is enabled.
+ * Returns {@code true} if write-behind is enabled.
*
* @return {@code True} if write-behind is enabled.
*/
@@ -372,16 +511,16 @@ public interface CacheMetrics {
/**
* Determines the required type of keys for this {@link Cache}, if any.
*
- * @return the fully qualified class name of the key type,
- * or "java.lang.Object" if the type is undefined.
+ * @return The fully qualified class name of the key type,
+ * or {@code "java.lang.Object"} if the type is undefined.
*/
public String getKeyType();
/**
* Determines the required type of values for this {@link Cache}, if any.
*
- * @return the fully qualified class name of the value type,
- * or "java.lang.Object" if the type is undefined.
+ * @return The fully qualified class name of the value type,
+ * or {@code "java.lang.Object"} if the type is undefined.
*/
public String getValueType();
@@ -407,7 +546,7 @@ public interface CacheMetrics {
* <p>
* The default value is {@code true}.
*
- * @return true if the cache is store by value
+ * @return {@code True} if the cache is store by value.
*/
public boolean isStoreByValue();
@@ -416,7 +555,7 @@ public interface CacheMetrics {
* <p>
* The default value is {@code false}.
*
- * @return true if statistics collection is enabled
+ * @return {@code True} if statistics collection is enabled.
*/
public boolean isStatisticsEnabled();
@@ -425,7 +564,7 @@ public interface CacheMetrics {
* <p>
* The default value is {@code false}.
*
- * @return true if management is enabled
+ * @return {@code true} if management is enabled.
*/
public boolean isManagementEnabled();
@@ -434,7 +573,7 @@ public interface CacheMetrics {
* <p>
* The default value is {@code false}
*
- * @return {@code true} when a {@link Cache} is in
+ * @return {@code True} when a {@link Cache} is in
* "read-through" mode.
* @see CacheLoader
*/
@@ -448,7 +587,7 @@ public interface CacheMetrics {
* <p>
* The default value is {@code false}
*
- * @return {@code true} when a {@link Cache} is in "write-through" mode.
+ * @return {@code True} when a {@link Cache} is in "write-through" mode.
* @see CacheWriter
*/
public boolean isWriteThrough();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
index c93c059..1eb7143 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
@@ -23,7 +23,6 @@ import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.managers.eventstorage.*;
-import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -31,7 +30,7 @@ import org.apache.ignite.lang.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.plugin.security.*;
import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.swapspace.*;
+
import org.jetbrains.annotations.*;
import javax.cache.expiry.*;
@@ -439,46 +438,10 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan
return ctx.cache().cache(cacheName).containsKey(key);
}
- @Override public void writeToSwap(String spaceName, Object key, @Nullable Object val,
- @Nullable ClassLoader ldr) {
- assert ctx.swap().enabled();
-
- try {
- ctx.swap().write(spaceName, key, val, ldr);
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
- }
-
- @SuppressWarnings({"unchecked"})
- @Nullable @Override public <T> T readFromSwap(String spaceName, SwapKey key,
- @Nullable ClassLoader ldr) {
- try {
- assert ctx.swap().enabled();
-
- return ctx.swap().readValue(spaceName, key, ldr);
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
- }
-
@Override public int partition(String cacheName, Object key) {
return ctx.cache().cache(cacheName).affinity().partition(key);
}
- @Override public void removeFromSwap(String spaceName, Object key, @Nullable ClassLoader ldr) {
- try {
- assert ctx.swap().enabled();
-
- ctx.swap().remove(spaceName, key, null, ldr);
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
- }
-
@Override public IgniteNodeValidationResult validateNode(ClusterNode node) {
for (GridComponent comp : ctx) {
IgniteNodeValidationResult err = comp.validateNode(node);
@@ -508,26 +471,6 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan
}
}
- @SuppressWarnings("unchecked")
- @Nullable @Override public <V> V readValueFromOffheapAndSwap(@Nullable String spaceName,
- Object key, @Nullable ClassLoader ldr) {
- try {
- IgniteInternalCache<Object, V> cache = ctx.cache().cache(spaceName);
-
- GridCacheContext cctx = cache.context();
-
- if (cctx.isNear())
- cctx = cctx.near().dht().context();
-
- GridCacheSwapEntry e = cctx.swap().read(cctx.toCacheKeyObject(key), true, true);
-
- return e != null ? CU.<V>value(e.value(), cctx, true) : null;
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
- }
-
@Override public MessageFormatter messageFormatter() {
return ctx.io().formatter();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
index e62e43f..cf8747d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.managers.*;
+import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -138,20 +139,28 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
* Reads value from swap.
*
* @param spaceName Space name.
+ * @param part Partition.
* @param key Key.
- * @param ldr Class loader (optional).
+ * @param cctx Cache context.
* @return Value.
* @throws IgniteCheckedException If failed.
*/
- @Nullable public byte[] read(@Nullable String spaceName, SwapKey key, @Nullable ClassLoader ldr)
+ @Nullable public byte[] read(@Nullable String spaceName, int part, KeyCacheObject key, GridCacheContext cctx)
throws IgniteCheckedException {
assert key != null;
try {
- return getSpi().read(spaceName, key, context(ldr));
+ byte[] bytes = getSpi().read(spaceName, new SwapKey(key.value(cctx.cacheObjectContext(), false), part,
+ key.valueBytes(cctx.cacheObjectContext())), context(cctx.deploy().globalLoader()));
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapRead(bytes != null);
+
+ return bytes;
}
catch (IgniteSpiException e) {
- throw new IgniteCheckedException("Failed to read from swap space [space=" + spaceName + ", key=" + key + ']', e);
+ throw new IgniteCheckedException("Failed to read from swap space [space=" + spaceName +
+ ", key=" + key + ']', e);
}
}
@@ -159,35 +168,43 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
* Reads value from swap.
*
* @param spaceName Space name.
- * @param key Swap key.
- * @param ldr Class loader (optional).
+ * @param part Partition.
+ * @param key Key.
+ * @param cctx Cache context.
* @return Value.
* @throws IgniteCheckedException If failed.
*/
@SuppressWarnings({"unchecked"})
- @Nullable public <T> T readValue(@Nullable String spaceName, SwapKey key, @Nullable ClassLoader ldr)
+ @Nullable public <T> T readValue(@Nullable String spaceName, int part, KeyCacheObject key, GridCacheContext cctx)
throws IgniteCheckedException {
assert key != null;
- return unmarshal(read(spaceName, key, ldr), ldr);
+ return unmarshal(read(spaceName, part, key, cctx), cctx.deploy().globalLoader());
}
/**
* Writes value to swap.
*
* @param spaceName Space name.
+ * @param part Partition.
* @param key Key.
* @param val Value.
- * @param ldr Class loader (optional).
+ * @param cctx Cache context.
* @throws IgniteCheckedException If failed.
*/
- public void write(@Nullable String spaceName, SwapKey key, byte[] val, @Nullable ClassLoader ldr)
+ public void write(@Nullable String spaceName, int part, KeyCacheObject key, byte[] val, GridCacheContext cctx)
throws IgniteCheckedException {
assert key != null;
assert val != null;
try {
- getSpi().store(spaceName, key, val, context(ldr));
+ SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false), part,
+ key.valueBytes(cctx.cacheObjectContext()));
+
+ getSpi().store(spaceName, swapKey, val, context(cctx.deploy().globalLoader()));
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapWrite();
}
catch (IgniteSpiException e) {
throw new IgniteCheckedException("Failed to write to swap space [space=" + spaceName + ", key=" + key +
@@ -199,51 +216,81 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
* Writes batch to swap.
*
* @param spaceName Space name.
- * @param batch Swapped entries.
- * @param ldr Class loader (optional).
+ * @param swapped Swapped entries.
+ * @param cctx Cache context.
* @throws IgniteCheckedException If failed.
*/
- public <K, V> void writeAll(String spaceName, Map<SwapKey, byte[]> batch,
- @Nullable ClassLoader ldr) throws IgniteCheckedException {
- getSpi().storeAll(spaceName, batch, context(ldr));
+ public void writeAll(String spaceName, Iterable<GridCacheBatchSwapEntry> swapped, GridCacheContext cctx)
+ throws IgniteCheckedException {
+ Map<SwapKey, byte[]> batch = new LinkedHashMap<>();
+
+ int cnt = 0;
+
+ for (GridCacheBatchSwapEntry entry : swapped) {
+ SwapKey swapKey = new SwapKey(entry.key().value(cctx.cacheObjectContext(), false),
+ entry.partition(),
+ entry.key().valueBytes(cctx.cacheObjectContext()));
+
+ batch.put(swapKey, entry.marshal());
+
+ cnt++;
+ }
+
+ getSpi().storeAll(spaceName, batch, context(cctx.deploy().globalLoader()));
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapWrite(cnt);
}
/**
* Writes value to swap.
*
* @param spaceName Space name.
+ * @param part Partition.
* @param key Key.
* @param val Value.
- * @param ldr Class loader (optional).
- * @throws IgniteCheckedException If failed.
- */
- public void write(@Nullable String spaceName, Object key, @Nullable Object val, @Nullable ClassLoader ldr)
- throws IgniteCheckedException {
+ * @param cctx Cache context.
+ * */
+ public void write(@Nullable String spaceName, int part, KeyCacheObject key, @Nullable Object val,
+ GridCacheContext cctx) throws IgniteCheckedException {
assert key != null;
- write(spaceName, new SwapKey(key), marshal(val), ldr);
+ write(spaceName, part, key, marshal(val), cctx);
}
/**
* Removes value from swap.
*
* @param spaceName Space name.
+ * @param part Partition.
* @param key Key.
+ * @param cctx Cache context.
* @param c Optional closure that takes removed value and executes after actual
* removing. If there was no value in storage the closure is executed given
* {@code null} value as parameter.
- * @param ldr Class loader (optional).
* @throws IgniteCheckedException If failed.
*/
- public void remove(@Nullable String spaceName, SwapKey key, @Nullable IgniteInClosure<byte[]> c,
- @Nullable ClassLoader ldr) throws IgniteCheckedException {
+ public void remove(@Nullable String spaceName, int part, KeyCacheObject key,
+ final GridCacheContext cctx, @Nullable final IgniteInClosure<byte[]> c) throws IgniteCheckedException {
assert key != null;
try {
- getSpi().remove(spaceName, key, c, context(ldr));
+ SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false), part,
+ key.valueBytes(cctx.cacheObjectContext()));
+
+ getSpi().remove(spaceName, swapKey, new IgniteInClosure<byte[]>() {
+ @Override public void apply(byte[] bytes) {
+ if (c != null)
+ c.apply(bytes);
+
+ if (bytes != null && cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapRemove();
+ }
+ }, context(cctx.deploy().globalLoader()));
}
catch (IgniteSpiException e) {
- throw new IgniteCheckedException("Failed to remove from swap space [space=" + spaceName + ", key=" + key + ']', e);
+ throw new IgniteCheckedException("Failed to remove from swap space [space=" + spaceName +
+ ", key=" + key + ']', e);
}
}
@@ -251,19 +298,32 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
* Removes value from swap.
*
* @param spaceName Space name.
- * @param keys Collection of keys.
+ * @param keys Keys.
+ * @param cctx Cache context.
* @param c Optional closure that takes removed value and executes after actual
* removing. If there was no value in storage the closure is executed given
* {@code null} value as parameter.
- * @param ldr Class loader (optional).
* @throws IgniteCheckedException If failed.
*/
- public void removeAll(@Nullable String spaceName, Collection<SwapKey> keys,
- IgniteBiInClosure<SwapKey, byte[]> c, @Nullable ClassLoader ldr) throws IgniteCheckedException {
+ public void removeAll(@Nullable String spaceName, Collection<KeyCacheObject> keys, GridCacheContext cctx,
+ IgniteBiInClosure<SwapKey, byte[]> c) throws IgniteCheckedException {
assert keys != null;
+ Collection<SwapKey> swapKeys = new ArrayList<>(keys.size());
+
+ for (KeyCacheObject key : keys) {
+ SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
+ cctx.affinity().partition(key),
+ key.valueBytes(cctx.cacheObjectContext()));
+
+ swapKeys.add(swapKey);
+ }
+
try {
- getSpi().removeAll(spaceName, keys, c, context(ldr));
+ getSpi().removeAll(spaceName, swapKeys, c, context(cctx.deploy().globalLoader()));
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapRemove();
}
catch (IgniteSpiException e) {
throw new IgniteCheckedException("Failed to remove from swap space [space=" + spaceName + ", " +
@@ -272,24 +332,6 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
}
/**
- * Removes value from swap.
- *
- * @param spaceName Space name.
- * @param key Key.
- * @param c Optional closure that takes removed value and executes after actual
- * removing. If there was no value in storage the closure is executed given
- * {@code null} value as parameter.
- * @param ldr Class loader (optional).
- * @throws IgniteCheckedException If failed.
- */
- public void remove(@Nullable String spaceName, Object key, @Nullable IgniteInClosure<byte[]> c,
- @Nullable ClassLoader ldr) throws IgniteCheckedException {
- assert key != null;
-
- remove(spaceName, new SwapKey(key), c, ldr);
- }
-
- /**
* Gets size in bytes for swap space.
*
* @param spaceName Space name.
@@ -356,7 +398,7 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
*
* @param spaceName Space name.
* @return Iterator over space entries or {@code null} if space is unknown.
- * @throws org.apache.ignite.spi.IgniteSpiException If failed.
+ * @throws IgniteSpiException If failed.
*/
@Nullable public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawIterator(@Nullable String spaceName)
throws IgniteCheckedException {
@@ -397,7 +439,7 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
* @param spaceName Space name.
* @param ldr Class loader.
* @return Iterator over space entries or {@code null} if space is unknown.
- * @throws org.apache.ignite.spi.IgniteSpiException If failed.
+ * @throws IgniteSpiException If failed.
*/
@Nullable public <K> GridCloseableIterator<K> keysIterator(@Nullable String spaceName,
@Nullable ClassLoader ldr) throws IgniteCheckedException {
@@ -417,7 +459,6 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
* @return Unmarshalled value.
* @throws IgniteCheckedException If failed.
*/
- @SuppressWarnings({"unchecked"})
private <T> T unmarshal(byte[] swapBytes, @Nullable ClassLoader ldr) throws IgniteCheckedException {
if (swapBytes == null)
return null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
index 560de97..3dcda3c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
@@ -25,6 +25,8 @@ import org.apache.ignite.internal.util.typedef.internal.*;
import java.util.concurrent.atomic.*;
+import static org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion.*;
+
/**
* Adapter for cache metrics.
*/
@@ -63,7 +65,7 @@ public class CacheMetricsImpl implements CacheMetrics {
private AtomicLong getTimeNanos = new AtomicLong();
/** Remove time taken nanos. */
- private AtomicLong removeTimeNanos = new AtomicLong();
+ private AtomicLong rmvTimeNanos = new AtomicLong();
/** Commit transaction time taken nanos. */
private AtomicLong commitTimeNanos = new AtomicLong();
@@ -71,6 +73,39 @@ public class CacheMetricsImpl implements CacheMetrics {
/** Commit transaction time taken nanos. */
private AtomicLong rollbackTimeNanos = new AtomicLong();
+ /** Number of reads from off-heap memory. */
+ private AtomicLong offHeapGets = new AtomicLong();
+
+ /** Number of writes to off-heap memory. */
+ private AtomicLong offHeapPuts = new AtomicLong();
+
+ /** Number of removed entries from off-heap memory. */
+ private AtomicLong offHeapRemoves = new AtomicLong();
+
+ /** Number of evictions from off-heap memory. */
+ private AtomicLong offHeapEvicts = new AtomicLong();
+
+ /** Number of off-heap hits. */
+ private AtomicLong offHeapHits = new AtomicLong();
+
+ /** Number of off-heap misses. */
+ private AtomicLong offHeapMisses = new AtomicLong();
+
+ /** Number of reads from swap. */
+ private AtomicLong swapGets = new AtomicLong();
+
+ /** Number of writes to swap. */
+ private AtomicLong swapPuts = new AtomicLong();
+
+ /** Number of removed entries from swap. */
+ private AtomicLong swapRemoves = new AtomicLong();
+
+ /** Number of swap hits. */
+ private AtomicLong swapHits = new AtomicLong();
+
+ /** Number of swap misses. */
+ private AtomicLong swapMisses = new AtomicLong();
+
/** Cache metrics. */
@GridToStringExclude
private transient CacheMetricsImpl delegate;
@@ -126,16 +161,160 @@ public class CacheMetricsImpl implements CacheMetrics {
}
/** {@inheritDoc} */
+ @Override public long getOffHeapGets() {
+ return offHeapGets.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPuts() {
+ return offHeapPuts.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapRemovals() {
+ return offHeapRemoves.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapEvictions() {
+ return offHeapEvicts.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapHits() {
+ return offHeapHits.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapHitPercentage() {
+ long hits0 = offHeapHits.get();
+ long gets0 = offHeapGets.get();
+
+ if (hits0 == 0)
+ return 0;
+
+ return (float) hits0 / gets0 * 100.0f;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapMisses() {
+ return offHeapMisses.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapMissPercentage() {
+ long misses0 = offHeapMisses.get();
+ long reads0 = offHeapGets.get();
+
+ if (misses0 == 0)
+ return 0;
+
+ return (float) misses0 / reads0 * 100.0f;
+ }
+
+ /** {@inheritDoc} */
@Override public long getOffHeapEntriesCount() {
return cctx.cache().offHeapEntriesCount();
}
/** {@inheritDoc} */
+ @Override public long getOffHeapPrimaryEntriesCount() {
+ try {
+ return cctx.swap().offheapEntriesCount(true, false, NONE);
+ }
+ catch (IgniteCheckedException e) {
+ return 0;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapBackupEntriesCount() {
+ try {
+ return cctx.swap().offheapEntriesCount(false, true, NONE);
+ }
+ catch (IgniteCheckedException e) {
+ return 0;
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public long getOffHeapAllocatedSize() {
return cctx.cache().offHeapAllocatedSize();
}
/** {@inheritDoc} */
+ @Override public long getOffHeapMaxSize() {
+ return cctx.config().getOffHeapMaxMemory();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapGets() {
+ return swapGets.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapPuts() {
+ return swapPuts.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapRemovals() {
+ return swapRemoves.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapHits() {
+ return swapHits.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapMisses() {
+ return swapMisses.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapEntriesCount() {
+ try {
+ return cctx.cache().swapKeys();
+ }
+ catch (IgniteCheckedException e) {
+ return 0;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapSize() {
+ try {
+ return cctx.cache().swapSize();
+ }
+ catch (IgniteCheckedException e) {
+ return 0;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapHitPercentage() {
+ long hits0 = swapHits.get();
+ long gets0 = swapGets.get();
+
+ if (hits0 == 0)
+ return 0;
+
+ return (float) hits0 / gets0 * 100.0f;
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapMissPercentage() {
+ long misses0 = swapMisses.get();
+ long reads0 = swapGets.get();
+
+ if (misses0 == 0)
+ return 0;
+
+ return (float) misses0 / reads0 * 100.0f;
+ }
+
+ /** {@inheritDoc} */
@Override public int getSize() {
return cctx.cache().size();
}
@@ -317,11 +496,24 @@ public class CacheMetricsImpl implements CacheMetrics {
txCommits.set(0);
txRollbacks.set(0);
putTimeNanos.set(0);
- removeTimeNanos.set(0);
+ rmvTimeNanos.set(0);
getTimeNanos.set(0);
commitTimeNanos.set(0);
rollbackTimeNanos.set(0);
+ offHeapGets.set(0);
+ offHeapPuts.set(0);
+ offHeapRemoves.set(0);
+ offHeapHits.set(0);
+ offHeapMisses.set(0);
+ offHeapEvicts.set(0);
+
+ swapGets.set(0);
+ swapPuts.set(0);
+ swapRemoves.set(0);
+ swapHits.set(0);
+ swapMisses.set(0);
+
if (delegate != null)
delegate.clear();
}
@@ -402,7 +594,7 @@ public class CacheMetricsImpl implements CacheMetrics {
/** {@inheritDoc} */
@Override public float getAverageRemoveTime() {
- long timeNanos = removeTimeNanos.get();
+ long timeNanos = rmvTimeNanos.get();
long removesCnt = rmCnt.get();
if (timeNanos == 0 || removesCnt == 0)
@@ -483,7 +675,6 @@ public class CacheMetricsImpl implements CacheMetrics {
delegate.onTxRollback(duration);
}
-
/**
* Increments the get time accumulator.
*
@@ -514,7 +705,7 @@ public class CacheMetricsImpl implements CacheMetrics {
* @param duration the time taken in nanoseconds.
*/
public void addRemoveTimeNanos(long duration) {
- removeTimeNanos.addAndGet(duration);
+ rmvTimeNanos.addAndGet(duration);
if (delegate != null)
delegate.addRemoveTimeNanos(duration);
@@ -526,7 +717,7 @@ public class CacheMetricsImpl implements CacheMetrics {
* @param duration the time taken in nanoseconds.
*/
public void addRemoveAndGetTimeNanos(long duration) {
- removeTimeNanos.addAndGet(duration);
+ rmvTimeNanos.addAndGet(duration);
getTimeNanos.addAndGet(duration);
if (delegate != null)
@@ -581,6 +772,108 @@ public class CacheMetricsImpl implements CacheMetrics {
return cctx.config().isManagementEnabled();
}
+ /**
+ * Off-heap read callback.
+ *
+ * @param hit Hit or miss flag.
+ */
+ public void onOffHeapRead(boolean hit) {
+ offHeapGets.incrementAndGet();
+
+ if (hit)
+ offHeapHits.incrementAndGet();
+ else
+ offHeapMisses.incrementAndGet();
+
+ if (delegate != null)
+ delegate.onOffHeapRead(hit);
+ }
+
+ /**
+ * Off-heap write callback.
+ */
+ public void onOffHeapWrite() {
+ offHeapPuts.incrementAndGet();
+
+ if (delegate != null)
+ delegate.onOffHeapWrite();
+ }
+
+ /**
+ * Off-heap remove callback.
+ */
+ public void onOffHeapRemove() {
+ offHeapRemoves.incrementAndGet();
+
+ if (delegate != null)
+ delegate.onOffHeapRemove();
+ }
+
+ /**
+ * Off-heap evict callback.
+ */
+ public void onOffHeapEvict() {
+ offHeapEvicts.incrementAndGet();
+
+ if (delegate != null)
+ delegate.onOffHeapRemove();
+ }
+
+ /**
+ * Swap read callback.
+ *
+ * @param hit Hit or miss flag.
+ */
+ public void onSwapRead(boolean hit) {
+ swapGets.incrementAndGet();
+
+ if (hit)
+ swapHits.incrementAndGet();
+ else
+ swapMisses.incrementAndGet();
+
+ if (delegate != null)
+ delegate.onSwapRead(hit);
+ }
+
+ /**
+ * Swap write callback.
+ */
+ public void onSwapWrite() {
+ onSwapWrite(1);
+ }
+
+ /**
+ * Swap write callback.
+ *
+ * @param cnt Amount of entries.
+ */
+ public void onSwapWrite(int cnt) {
+ swapPuts.addAndGet(cnt);
+
+ if (delegate != null)
+ delegate.onSwapWrite(cnt);
+ }
+
+ /**
+ * Swap remove callback.
+ */
+ public void onSwapRemove() {
+ onSwapRemove(1);
+ }
+
+ /**
+ * Swap remove callback.
+ *
+ * @param cnt Amount of entries.
+ */
+ public void onSwapRemove(int cnt) {
+ swapRemoves.addAndGet(cnt);
+
+ if (delegate != null)
+ delegate.onSwapRemove(cnt);
+ }
+
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(CacheMetricsImpl.class, this);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
index e9d547c..966027a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
@@ -49,16 +49,116 @@ class CacheMetricsMXBeanImpl implements CacheMetricsMXBean {
}
/** {@inheritDoc} */
+ @Override public long getOffHeapGets() {
+ return cache.metrics0().getOffHeapGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPuts() {
+ return cache.metrics0().getOffHeapPuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapRemovals() {
+ return cache.metrics0().getOffHeapRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapEvictions() {
+ return cache.metrics0().getOffHeapEvictions();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapHits() {
+ return cache.metrics0().getOffHeapHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapHitPercentage() {
+ return cache.metrics0().getOffHeapHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapMisses() {
+ return cache.metrics0().getOffHeapMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapMissPercentage() {
+ return cache.metrics0().getOffHeapMissPercentage();
+ }
+
+ /** {@inheritDoc} */
@Override public long getOffHeapEntriesCount() {
return cache.metrics0().getOffHeapEntriesCount();
}
/** {@inheritDoc} */
+ @Override public long getOffHeapPrimaryEntriesCount() {
+ return cache.metrics0().getOffHeapPrimaryEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapBackupEntriesCount() {
+ return cache.metrics0().getOffHeapBackupEntriesCount();
+ }
+
+ /** {@inheritDoc} */
@Override public long getOffHeapAllocatedSize() {
return cache.metrics0().getOffHeapAllocatedSize();
}
/** {@inheritDoc} */
+ @Override public long getOffHeapMaxSize() {
+ return cache.metrics0().getOffHeapMaxSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapGets() {
+ return cache.metrics0().getSwapGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapPuts() {
+ return cache.metrics0().getSwapPuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapRemovals() {
+ return cache.metrics0().getSwapRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapHits() {
+ return cache.metrics0().getSwapHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapMisses() {
+ return cache.metrics0().getSwapMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapHitPercentage() {
+ return cache.metrics0().getSwapHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapMissPercentage() {
+ return cache.metrics0().getSwapMissPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapEntriesCount() {
+ return cache.metrics0().getSwapEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapSize() {
+ return cache.metrics0().getSwapSize();
+ }
+
+ /** {@inheritDoc} */
@Override public int getSize() {
return cache.metrics0().getSize();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
index 4fe152a..cf16d9d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
@@ -61,7 +61,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
private float getAvgTimeNanos = 0;
/** Remove time taken nanos. */
- private float removeAvgTimeNanos = 0;
+ private float rmvAvgTimeNanos = 0;
/** Commit transaction time taken nanos. */
private float commitAvgTimeNanos = 0;
@@ -75,12 +75,60 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** Number of entries that was swapped to disk. */
private long overflowSize;
+ /** Number of reads from off-heap. */
+ private long offHeapGets;
+
+ /** Number of writes to off-heap. */
+ private long offHeapPuts;
+
+ /** Number of removed entries from off-heap. */
+ private long offHeapRemoves;
+
+ /** Number of evictions from off-heap. */
+ private long offHeapEvicts;
+
+ /** Off-heap hits number. */
+ private long offHeapHits;
+
+ /** Off-heap misses number. */
+ private long offHeapMisses;
+
/** Number of entries stored in off-heap memory. */
- private long offHeapEntriesCount;
+ private long offHeapEntriesCnt;
+
+ /** Number of primary entries stored in off-heap memory. */
+ private long offHeapPrimaryEntriesCnt;
+
+ /** Number of backup entries stored in off-heap memory. */
+ private long offHeapBackupEntriesCnt;
/** Memory size allocated in off-heap. */
private long offHeapAllocatedSize;
+ /** Off-heap memory maximum size*/
+ private long offHeapMaxSize;
+
+ /** Number of reads from swap. */
+ private long swapGets;
+
+ /** Number of writes to swap. */
+ private long swapPuts;
+
+ /** Number of removed entries from swap. */
+ private long swapRemoves;
+
+ /** Number of entries stored in swap. */
+ private long swapEntriesCnt;
+
+ /** Swap hits number. */
+ private long swapHits;
+
+ /** Swap misses number. */
+ private long swapMisses;
+
+ /** Swap size. */
+ private long swapSize;
+
/** Number of non-{@code null} values in the cache. */
private int size;
@@ -91,7 +139,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
private boolean isEmpty;
/** Gets current size of evict queue used to batch up evictions. */
- private int dhtEvictQueueCurrentSize;
+ private int dhtEvictQueueCurrSize;
/** Transaction per-thread map size. */
private int txThreadMapSize;
@@ -106,7 +154,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
private int txPrepareQueueSize;
/** Start version counts map size. */
- private int txStartVersionCountsSize;
+ private int txStartVerCountsSize;
/** Number of cached committed transaction IDs. */
private int txCommittedVersionsSize;
@@ -127,7 +175,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
private int txDhtPrepareQueueSize;
/** DHT start version counts map size. */
- private int txDhtStartVersionCountsSize;
+ private int txDhtStartVerCountsSize;
/** Number of cached committed DHT transaction IDs. */
private int txDhtCommittedVersionsSize;
@@ -142,34 +190,34 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
private int writeBehindFlushSize;
/** Count of worker threads. */
- private int writeBehindFlushThreadCount;
+ private int writeBehindFlushThreadCnt;
/** Flush frequency in milliseconds. */
- private long writeBehindFlushFrequency;
+ private long writeBehindFlushFreq;
/** Maximum size of batch. */
private int writeBehindStoreBatchSize;
/** Count of cache overflow events since start. */
- private int writeBehindTotalCriticalOverflowCount;
+ private int writeBehindTotalCriticalOverflowCnt;
/** Count of cache overflow events since start. */
- private int writeBehindCriticalOverflowCount;
+ private int writeBehindCriticalOverflowCnt;
/** Count of entries in store-retry state. */
- private int writeBehindErrorRetryCount;
+ private int writeBehindErrorRetryCnt;
/** Total count of entries in cache store internal buffer. */
- private int writeBehindBufferSize;
+ private int writeBehindBufSize;
/** */
private String keyType;
/** */
- private String valueType;
+ private String valType;
/** */
- private boolean isStoreByValue;
+ private boolean isStoreByVal;
/** */
private boolean isStatisticsEnabled;
@@ -207,45 +255,64 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
putAvgTimeNanos = m.getAveragePutTime();
getAvgTimeNanos = m.getAverageGetTime();
- removeAvgTimeNanos = m.getAverageRemoveTime();
+ rmvAvgTimeNanos = m.getAverageRemoveTime();
commitAvgTimeNanos = m.getAverageTxCommitTime();
rollbackAvgTimeNanos = m.getAverageTxRollbackTime();
cacheName = m.name();
overflowSize = m.getOverflowSize();
- offHeapEntriesCount = m.getOffHeapEntriesCount();
+
+ offHeapGets = m.getOffHeapGets();
+ offHeapPuts = m.getOffHeapPuts();
+ offHeapRemoves = m.getOffHeapRemovals();
+ offHeapEvicts = m.getOffHeapEvictions();
+ offHeapHits = m.getOffHeapHits();
+ offHeapMisses = m.getOffHeapMisses();
+ offHeapEntriesCnt = m.getOffHeapEntriesCount();
+ offHeapPrimaryEntriesCnt = m.getOffHeapPrimaryEntriesCount();
+ offHeapBackupEntriesCnt = m.getOffHeapBackupEntriesCount();
offHeapAllocatedSize = m.getOffHeapAllocatedSize();
+ offHeapMaxSize = m.getOffHeapMaxSize();
+
+ swapGets = m.getSwapGets();
+ swapPuts = m.getSwapPuts();
+ swapRemoves = m.getSwapRemovals();
+ swapHits = m.getSwapHits();
+ swapMisses = m.getSwapMisses();
+ swapEntriesCnt = m.getSwapEntriesCount();
+ swapSize = m.getSwapSize();
+
size = m.getSize();
keySize = m.getKeySize();
isEmpty = m.isEmpty();
- dhtEvictQueueCurrentSize = m.getDhtEvictQueueCurrentSize();
+ dhtEvictQueueCurrSize = m.getDhtEvictQueueCurrentSize();
txThreadMapSize = m.getTxThreadMapSize();
txXidMapSize = m.getTxXidMapSize();
txCommitQueueSize = m.getTxCommitQueueSize();
txPrepareQueueSize = m.getTxPrepareQueueSize();
- txStartVersionCountsSize = m.getTxStartVersionCountsSize();
+ txStartVerCountsSize = m.getTxStartVersionCountsSize();
txCommittedVersionsSize = m.getTxCommittedVersionsSize();
txRolledbackVersionsSize = m.getTxRolledbackVersionsSize();
txDhtThreadMapSize = m.getTxDhtThreadMapSize();
txDhtXidMapSize = m.getTxDhtXidMapSize();
txDhtCommitQueueSize = m.getTxDhtCommitQueueSize();
txDhtPrepareQueueSize = m.getTxDhtPrepareQueueSize();
- txDhtStartVersionCountsSize = m.getTxDhtStartVersionCountsSize();
+ txDhtStartVerCountsSize = m.getTxDhtStartVersionCountsSize();
txDhtCommittedVersionsSize = m.getTxDhtCommittedVersionsSize();
txDhtRolledbackVersionsSize = m.getTxDhtRolledbackVersionsSize();
isWriteBehindEnabled = m.isWriteBehindEnabled();
writeBehindFlushSize = m.getWriteBehindFlushSize();
- writeBehindFlushThreadCount = m.getWriteBehindFlushThreadCount();
- writeBehindFlushFrequency = m.getWriteBehindFlushFrequency();
+ writeBehindFlushThreadCnt = m.getWriteBehindFlushThreadCount();
+ writeBehindFlushFreq = m.getWriteBehindFlushFrequency();
writeBehindStoreBatchSize = m.getWriteBehindStoreBatchSize();
- writeBehindTotalCriticalOverflowCount = m.getWriteBehindTotalCriticalOverflowCount();
- writeBehindCriticalOverflowCount = m.getWriteBehindCriticalOverflowCount();
- writeBehindErrorRetryCount = m.getWriteBehindErrorRetryCount();
- writeBehindBufferSize = m.getWriteBehindBufferSize();
+ writeBehindTotalCriticalOverflowCnt = m.getWriteBehindTotalCriticalOverflowCount();
+ writeBehindCriticalOverflowCnt = m.getWriteBehindCriticalOverflowCount();
+ writeBehindErrorRetryCnt = m.getWriteBehindErrorRetryCount();
+ writeBehindBufSize = m.getWriteBehindBufferSize();
keyType = m.getKeyType();
- valueType = m.getValueType();
- isStoreByValue = m.isStoreByValue();
+ valType = m.getValueType();
+ isStoreByVal = m.isStoreByValue();
isStatisticsEnabled = m.isStatisticsEnabled();
isManagementEnabled = m.isManagementEnabled();
isReadThrough = m.isReadThrough();
@@ -263,21 +330,23 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
isEmpty = loc.isEmpty();
isWriteBehindEnabled = loc.isWriteBehindEnabled();
writeBehindFlushSize = loc.getWriteBehindFlushSize();
- writeBehindFlushThreadCount = loc.getWriteBehindFlushThreadCount();
- writeBehindFlushFrequency = loc.getWriteBehindFlushFrequency();
+ writeBehindFlushThreadCnt = loc.getWriteBehindFlushThreadCount();
+ writeBehindFlushFreq = loc.getWriteBehindFlushFrequency();
writeBehindStoreBatchSize = loc.getWriteBehindStoreBatchSize();
- writeBehindBufferSize = loc.getWriteBehindBufferSize();
+ writeBehindBufSize = loc.getWriteBehindBufferSize();
size = loc.getSize();
keySize = loc.getKeySize();
keyType = loc.getKeyType();
- valueType = loc.getValueType();
- isStoreByValue = loc.isStoreByValue();
+ valType = loc.getValueType();
+ isStoreByVal = loc.isStoreByValue();
isStatisticsEnabled = loc.isStatisticsEnabled();
isManagementEnabled = loc.isManagementEnabled();
isReadThrough = loc.isReadThrough();
isWriteThrough = loc.isWriteThrough();
+ offHeapMaxSize = loc.getOffHeapMaxSize();
+
for (CacheMetrics e : metrics) {
reads += e.getCacheGets();
puts += e.getCachePuts();
@@ -290,7 +359,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
putAvgTimeNanos += e.getAveragePutTime();
getAvgTimeNanos += e.getAverageGetTime();
- removeAvgTimeNanos += e.getAverageRemoveTime();
+ rmvAvgTimeNanos += e.getAverageRemoveTime();
commitAvgTimeNanos += e.getAverageTxCommitTime();
rollbackAvgTimeNanos += e.getAverageTxRollbackTime();
@@ -299,19 +368,35 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
else
overflowSize = -1;
- offHeapEntriesCount += e.getOffHeapEntriesCount();
+ offHeapGets += e.getOffHeapGets();
+ offHeapPuts += e.getOffHeapPuts();
+ offHeapRemoves += e.getOffHeapRemovals();
+ offHeapEvicts += e.getOffHeapEvictions();
+ offHeapHits += e.getOffHeapHits();
+ offHeapMisses += e.getOffHeapMisses();
+ offHeapEntriesCnt += e.getOffHeapEntriesCount();
+ offHeapPrimaryEntriesCnt += e.getOffHeapPrimaryEntriesCount();
+ offHeapBackupEntriesCnt += e.getOffHeapBackupEntriesCount();
offHeapAllocatedSize += e.getOffHeapAllocatedSize();
+ swapGets += e.getSwapGets();
+ swapPuts += e.getSwapPuts();
+ swapRemoves += e.getSwapRemovals();
+ swapHits += e.getSwapHits();
+ swapMisses += e.getSwapMisses();
+ swapEntriesCnt += e.getSwapEntriesCount();
+ swapSize += e.getSwapSize();
+
if (e.getDhtEvictQueueCurrentSize() > -1)
- dhtEvictQueueCurrentSize += e.getDhtEvictQueueCurrentSize();
+ dhtEvictQueueCurrSize += e.getDhtEvictQueueCurrentSize();
else
- dhtEvictQueueCurrentSize = -1;
+ dhtEvictQueueCurrSize = -1;
txThreadMapSize += e.getTxThreadMapSize();
txXidMapSize += e.getTxXidMapSize();
txCommitQueueSize += e.getTxCommitQueueSize();
txPrepareQueueSize += e.getTxPrepareQueueSize();
- txStartVersionCountsSize += e.getTxStartVersionCountsSize();
+ txStartVerCountsSize += e.getTxStartVersionCountsSize();
txCommittedVersionsSize += e.getTxCommittedVersionsSize();
txRolledbackVersionsSize += e.getTxRolledbackVersionsSize();
@@ -336,9 +421,9 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
txDhtPrepareQueueSize = -1;
if (e.getTxDhtStartVersionCountsSize() > -1)
- txDhtStartVersionCountsSize += e.getTxDhtStartVersionCountsSize();
+ txDhtStartVerCountsSize += e.getTxDhtStartVersionCountsSize();
else
- txDhtStartVersionCountsSize = -1;
+ txDhtStartVerCountsSize = -1;
if (e.getTxDhtCommittedVersionsSize() > -1)
txDhtCommittedVersionsSize += e.getTxDhtCommittedVersionsSize();
@@ -351,19 +436,19 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
txDhtRolledbackVersionsSize = -1;
if (e.getWriteBehindTotalCriticalOverflowCount() > -1)
- writeBehindTotalCriticalOverflowCount += e.getWriteBehindTotalCriticalOverflowCount();
+ writeBehindTotalCriticalOverflowCnt += e.getWriteBehindTotalCriticalOverflowCount();
else
- writeBehindTotalCriticalOverflowCount = -1;
+ writeBehindTotalCriticalOverflowCnt = -1;
if (e.getWriteBehindCriticalOverflowCount() > -1)
- writeBehindCriticalOverflowCount += e.getWriteBehindCriticalOverflowCount();
+ writeBehindCriticalOverflowCnt += e.getWriteBehindCriticalOverflowCount();
else
- writeBehindCriticalOverflowCount = -1;
+ writeBehindCriticalOverflowCnt = -1;
if (e.getWriteBehindErrorRetryCount() > -1)
- writeBehindErrorRetryCount += e.getWriteBehindErrorRetryCount();
+ writeBehindErrorRetryCnt += e.getWriteBehindErrorRetryCount();
else
- writeBehindErrorRetryCount = -1;
+ writeBehindErrorRetryCnt = -1;
}
int size = metrics.size();
@@ -371,7 +456,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
if (size > 1) {
putAvgTimeNanos /= size;
getAvgTimeNanos /= size;
- removeAvgTimeNanos /= size;
+ rmvAvgTimeNanos /= size;
commitAvgTimeNanos /= size;
rollbackAvgTimeNanos /= size;
}
@@ -435,7 +520,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** {@inheritDoc} */
@Override public float getAverageRemoveTime() {
- return removeAvgTimeNanos;
+ return rmvAvgTimeNanos;
}
/** {@inheritDoc} */
@@ -469,8 +554,63 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
}
/** {@inheritDoc} */
+ @Override public long getOffHeapGets() {
+ return offHeapGets;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPuts() {
+ return offHeapPuts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapRemovals() {
+ return offHeapRemoves;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapEvictions() {
+ return offHeapEvicts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapHits() {
+ return offHeapHits;
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapHitPercentage() {
+ if (offHeapHits == 0 || offHeapGets == 0)
+ return 0;
+
+ return (float) offHeapHits / offHeapGets * 100.0f;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapMisses() {
+ return offHeapMisses;
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapMissPercentage() {
+ if (offHeapMisses == 0 || offHeapGets == 0)
+ return 0;
+
+ return (float) offHeapMisses / offHeapGets * 100.0f;
+ }
+ /** {@inheritDoc} */
@Override public long getOffHeapEntriesCount() {
- return offHeapEntriesCount;
+ return offHeapEntriesCnt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPrimaryEntriesCount() {
+ return offHeapPrimaryEntriesCnt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapBackupEntriesCount() {
+ return offHeapBackupEntriesCnt;
}
/** {@inheritDoc} */
@@ -479,6 +619,62 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
}
/** {@inheritDoc} */
+ @Override public long getOffHeapMaxSize() {
+ return offHeapMaxSize;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapGets() {
+ return swapGets;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapPuts() {
+ return swapPuts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapRemovals() {
+ return swapRemoves;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapHits() {
+ return swapHits;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapMisses() {
+ return swapMisses;
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapHitPercentage() {
+ if (swapHits == 0 || swapGets == 0)
+ return 0;
+
+ return (float) swapHits / swapGets * 100.0f;
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapMissPercentage() {
+ if (swapMisses == 0 || swapGets == 0)
+ return 0;
+
+ return (float) swapMisses / swapGets * 100.0f;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapEntriesCount() {
+ return swapEntriesCnt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapSize() {
+ return swapSize;
+ }
+
+ /** {@inheritDoc} */
@Override public int getSize() {
return size;
}
@@ -495,7 +691,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** {@inheritDoc} */
@Override public int getDhtEvictQueueCurrentSize() {
- return dhtEvictQueueCurrentSize;
+ return dhtEvictQueueCurrSize;
}
/** {@inheritDoc} */
@@ -520,7 +716,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** {@inheritDoc} */
@Override public int getTxStartVersionCountsSize() {
- return txStartVersionCountsSize;
+ return txStartVerCountsSize;
}
/** {@inheritDoc} */
@@ -555,7 +751,7 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** {@inheritDoc} */
@Override public int getTxDhtStartVersionCountsSize() {
- return txDhtStartVersionCountsSize;
+ return txDhtStartVerCountsSize;
}
/** {@inheritDoc} */
@@ -580,12 +776,12 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** {@inheritDoc} */
@Override public int getWriteBehindFlushThreadCount() {
- return writeBehindFlushThreadCount;
+ return writeBehindFlushThreadCnt;
}
/** {@inheritDoc} */
@Override public long getWriteBehindFlushFrequency() {
- return writeBehindFlushFrequency;
+ return writeBehindFlushFreq;
}
/** {@inheritDoc} */
@@ -595,22 +791,22 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** {@inheritDoc} */
@Override public int getWriteBehindTotalCriticalOverflowCount() {
- return writeBehindTotalCriticalOverflowCount;
+ return writeBehindTotalCriticalOverflowCnt;
}
/** {@inheritDoc} */
@Override public int getWriteBehindCriticalOverflowCount() {
- return writeBehindCriticalOverflowCount;
+ return writeBehindCriticalOverflowCnt;
}
/** {@inheritDoc} */
@Override public int getWriteBehindErrorRetryCount() {
- return writeBehindErrorRetryCount;
+ return writeBehindErrorRetryCnt;
}
/** {@inheritDoc} */
@Override public int getWriteBehindBufferSize() {
- return writeBehindBufferSize;
+ return writeBehindBufSize;
}
/** {@inheritDoc} */
@@ -620,12 +816,12 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
/** {@inheritDoc} */
@Override public String getValueType() {
- return valueType;
+ return valType;
}
/** {@inheritDoc} */
@Override public boolean isStoreByValue() {
- return isStoreByValue;
+ return isStoreByVal;
}
/** {@inheritDoc} */
@@ -666,31 +862,49 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
out.writeFloat(putAvgTimeNanos);
out.writeFloat(getAvgTimeNanos);
- out.writeFloat(removeAvgTimeNanos);
+ out.writeFloat(rmvAvgTimeNanos);
out.writeFloat(commitAvgTimeNanos);
out.writeFloat(rollbackAvgTimeNanos);
out.writeLong(overflowSize);
- out.writeLong(offHeapEntriesCount);
+ out.writeLong(offHeapGets);
+ out.writeLong(offHeapPuts);
+ out.writeLong(offHeapRemoves);
+ out.writeLong(offHeapEvicts);
+ out.writeLong(offHeapHits);
+ out.writeLong(offHeapMisses);
+ out.writeLong(offHeapEntriesCnt);
+ out.writeLong(offHeapPrimaryEntriesCnt);
+ out.writeLong(offHeapBackupEntriesCnt);
out.writeLong(offHeapAllocatedSize);
- out.writeInt(dhtEvictQueueCurrentSize);
+ out.writeLong(offHeapMaxSize);
+
+ out.writeLong(swapGets);
+ out.writeLong(swapPuts);
+ out.writeLong(swapRemoves);
+ out.writeLong(swapHits);
+ out.writeLong(swapMisses);
+ out.writeLong(swapEntriesCnt);
+ out.writeLong(swapSize);
+
+ out.writeInt(dhtEvictQueueCurrSize);
out.writeInt(txThreadMapSize);
out.writeInt(txXidMapSize);
out.writeInt(txCommitQueueSize);
out.writeInt(txPrepareQueueSize);
- out.writeInt(txStartVersionCountsSize);
+ out.writeInt(txStartVerCountsSize);
out.writeInt(txCommittedVersionsSize);
out.writeInt(txRolledbackVersionsSize);
out.writeInt(txDhtThreadMapSize);
out.writeInt(txDhtXidMapSize);
out.writeInt(txDhtCommitQueueSize);
out.writeInt(txDhtPrepareQueueSize);
- out.writeInt(txDhtStartVersionCountsSize);
+ out.writeInt(txDhtStartVerCountsSize);
out.writeInt(txDhtCommittedVersionsSize);
out.writeInt(txDhtRolledbackVersionsSize);
- out.writeInt(writeBehindTotalCriticalOverflowCount);
- out.writeInt(writeBehindCriticalOverflowCount);
- out.writeInt(writeBehindErrorRetryCount);
+ out.writeInt(writeBehindTotalCriticalOverflowCnt);
+ out.writeInt(writeBehindCriticalOverflowCnt);
+ out.writeInt(writeBehindErrorRetryCnt);
}
/** {@inheritDoc} */
@@ -706,30 +920,48 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable {
putAvgTimeNanos = in.readFloat();
getAvgTimeNanos = in.readFloat();
- removeAvgTimeNanos = in.readFloat();
+ rmvAvgTimeNanos = in.readFloat();
commitAvgTimeNanos = in.readFloat();
rollbackAvgTimeNanos = in.readFloat();
overflowSize = in.readLong();
- offHeapEntriesCount = in.readLong();
+ offHeapGets = in.readLong();
+ offHeapPuts = in.readLong();
+ offHeapRemoves = in.readLong();
+ offHeapEvicts = in.readLong();
+ offHeapHits = in.readLong();
+ offHeapMisses = in.readLong();
+ offHeapEntriesCnt = in.readLong();
+ offHeapPrimaryEntriesCnt = in.readLong();
+ offHeapBackupEntriesCnt = in.readLong();
offHeapAllocatedSize = in.readLong();
- dhtEvictQueueCurrentSize = in.readInt();
+ offHeapMaxSize = in.readLong();
+
+ swapGets = in.readLong();
+ swapPuts = in.readLong();
+ swapRemoves = in.readLong();
+ swapHits = in.readLong();
+ swapMisses = in.readLong();
+ swapEntriesCnt = in.readLong();
+ swapSize = in.readLong();
+
+ dhtEvictQueueCurrSize = in.readInt();
txThreadMapSize = in.readInt();
txXidMapSize = in.readInt();
txCommitQueueSize = in.readInt();
txPrepareQueueSize = in.readInt();
- txStartVersionCountsSize = in.readInt();
+ txStartVerCountsSize = in.readInt();
txCommittedVersionsSize = in.readInt();
txRolledbackVersionsSize = in.readInt();
txDhtThreadMapSize = in.readInt();
txDhtXidMapSize = in.readInt();
txDhtCommitQueueSize = in.readInt();
txDhtPrepareQueueSize = in.readInt();
- txDhtStartVersionCountsSize = in.readInt();
+ txDhtStartVerCountsSize = in.readInt();
txDhtCommittedVersionsSize = in.readInt();
txDhtRolledbackVersionsSize = in.readInt();
- writeBehindTotalCriticalOverflowCount = in.readInt();
- writeBehindCriticalOverflowCount = in.readInt();
- writeBehindErrorRetryCount = in.readInt();
+ writeBehindTotalCriticalOverflowCnt = in.readInt();
+ writeBehindCriticalOverflowCnt = in.readInt();
+ writeBehindErrorRetryCnt = in.readInt();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index eb82218..f442f03 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -121,6 +121,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
warnFirstEvict();
writeToSwap(part, cctx.toCacheKeyObject(kb), vb);
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapEvict();
}
catch (IgniteCheckedException e) {
log.error("Failed to unmarshal off-heap entry [part=" + part + ", hash=" + hash + ']', e);
@@ -395,8 +398,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Reconstituted swap entry or {@code null} if entry is obsolete.
* @throws IgniteCheckedException If failed.
*/
- @Nullable private <X extends GridCacheSwapEntry> X swapEntry(X e) throws IgniteCheckedException
- {
+ @Nullable private <X extends GridCacheSwapEntry> X swapEntry(X e) throws IgniteCheckedException {
assert e != null;
checkIteratorQueue();
@@ -425,16 +427,13 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
// First check off-heap store.
- if (offheapEnabled)
- if (offheap.contains(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext())))
- return true;
+ if (offheapEnabled && offheap.contains(spaceName, part, key, cctx))
+ return true;
if (swapEnabled) {
assert key != null;
- byte[] valBytes = swapMgr.read(spaceName,
- new SwapKey(key.value(cctx.cacheObjectContext(), false), part, key.valueBytes(cctx.cacheObjectContext())),
- cctx.deploy().globalLoader());
+ byte[] valBytes = swapMgr.read(spaceName, part, key, cctx);
return valBytes != null;
}
@@ -444,7 +443,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
* @param key Key to read.
- * @param keyBytes Key bytes.
* @param part Key partition.
* @param entryLocked {@code True} if cache entry is locked.
* @param readOffheap Read offheap flag.
@@ -454,7 +452,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
*/
@SuppressWarnings({"unchecked"})
@Nullable private GridCacheSwapEntry read(KeyCacheObject key,
- byte[] keyBytes,
int part,
boolean entryLocked,
boolean readOffheap,
@@ -479,7 +476,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// First check off-heap store.
if (readOffheap && offheapEnabled) {
- byte[] bytes = offheap.get(spaceName, part, key, keyBytes);
+ byte[] bytes = offheap.get(spaceName, part, key, cctx);
if (bytes != null)
return swapEntry(unmarshalSwapEntry(bytes));
@@ -490,9 +487,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
assert key != null;
- byte[] bytes = swapMgr.read(spaceName,
- new SwapKey(key.value(cctx.cacheObjectContext(), false), part, keyBytes),
- cctx.deploy().globalLoader());
+ byte[] bytes = swapMgr.read(spaceName, part, key, cctx);
if (bytes == null && lsnr != null)
return lsnr.entry;
@@ -522,7 +517,10 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// First try removing from offheap.
if (offheapEnabled) {
- byte[] entryBytes = offheap.remove(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ byte[] entryBytes = offheap.remove(spaceName, part, key, cctx);
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRead(entryBytes != null);
if (entryBytes != null) {
GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
@@ -567,8 +565,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Value from swap or {@code null}.
* @throws IgniteCheckedException If failed.
*/
- @Nullable private GridCacheSwapEntry readAndRemoveSwap(final KeyCacheObject key,
- final int part)
+ @Nullable private GridCacheSwapEntry readAndRemoveSwap(final KeyCacheObject key, final int part)
throws IgniteCheckedException {
if (!swapEnabled)
return null;
@@ -576,12 +573,11 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
final GridTuple<GridCacheSwapEntry> t = F.t1();
final GridTuple<IgniteCheckedException> err = F.t1();
- SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
- part,
- key.valueBytes(cctx.cacheObjectContext()));
-
- swapMgr.remove(spaceName, swapKey, new CI1<byte[]>() {
+ swapMgr.remove(spaceName, part, key, cctx, new CI1<byte[]>() {
@Override public void apply(byte[] rmv) {
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapRead(rmv != null);
+
if (rmv != null) {
try {
GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(rmv));
@@ -624,7 +620,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
}
}
- }, cctx.deploy().globalLoader());
+ });
if (err.get() != null)
throw err.get();
@@ -649,12 +645,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
if (!offheapEnabled && !swapEnabled)
return null;
- return read(entry.key(),
- entry.key().valueBytes(cctx.cacheObjectContext()),
- entry.partition(),
- locked,
- readOffheap,
- readSwap);
+ return read(entry.key(), entry.partition(), locked, readOffheap, readSwap);
}
/**
@@ -670,8 +661,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- IgniteBiTuple<Long, Integer> ptr =
- offheap.valuePointer(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ IgniteBiTuple<Long, Integer> ptr = offheap.valuePointer(spaceName, part, key, cctx);
if (ptr != null) {
assert ptr.get1() != null;
@@ -700,7 +690,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- return read(key, key.valueBytes(cctx.cacheObjectContext()), part, false, readOffheap, readSwap);
+ return read(key, part, false, readOffheap, readSwap);
}
/**
@@ -729,7 +719,8 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
final GridCacheQueryManager qryMgr = cctx.queries();
- Collection<SwapKey> unprocessedKeys = null;
+ Collection<KeyCacheObject> unprocessedKeys = null;
+
final Collection<GridCacheBatchSwapEntry> res = new ArrayList<>(keys.size());
// First try removing from offheap.
@@ -738,7 +729,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
byte[] entryBytes =
- offheap.remove(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ offheap.remove(spaceName, part, key, cctx);
if (entryBytes != null) {
GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
@@ -775,11 +766,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
if (unprocessedKeys == null)
unprocessedKeys = new ArrayList<>(keys.size());
- SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
- cctx.affinity().partition(key),
- key.valueBytes(cctx.cacheObjectContext()));
-
- unprocessedKeys.add(swapKey);
+ unprocessedKeys.add(key);
}
}
@@ -789,13 +776,8 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
else {
unprocessedKeys = new ArrayList<>(keys.size());
- for (KeyCacheObject key : keys) {
- SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
- cctx.affinity().partition(key),
- key.valueBytes(cctx.cacheObjectContext()));
-
- unprocessedKeys.add(swapKey);
- }
+ for (KeyCacheObject key : keys)
+ unprocessedKeys.add(key);
}
assert swapEnabled;
@@ -804,9 +786,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// Swap is enabled.
final GridTuple<IgniteCheckedException> err = F.t1();
- swapMgr.removeAll(spaceName,
- unprocessedKeys,
- new IgniteBiInClosure<SwapKey, byte[]>() {
+ swapMgr.removeAll(spaceName, unprocessedKeys, cctx, new IgniteBiInClosure<SwapKey, byte[]>() {
@Override public void apply(SwapKey swapKey, byte[] rmv) {
if (rmv != null) {
try {
@@ -859,8 +839,8 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
}
}
- },
- cctx.deploy().globalLoader());
+ }
+ );
if (err.get() != null)
throw err.get();
@@ -880,7 +860,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- return offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ return offheap.removex(spaceName, part, key, cctx);
}
/**
@@ -904,7 +884,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- offheap.enableEviction(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ offheap.enableEviction(spaceName, part, key, cctx);
}
/**
@@ -942,10 +922,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// First try offheap.
if (offheapEnabled) {
- byte[] val = offheap.remove(spaceName,
- part,
- key.value(cctx.cacheObjectContext(), false),
- key.valueBytes(cctx.cacheObjectContext()));
+ byte[] val = offheap.remove(spaceName, part, key, cctx);
if (val != null) {
if (c != null)
@@ -955,16 +932,8 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
}
- if (swapEnabled) {
- SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
- part,
- key.valueBytes(cctx.cacheObjectContext()));
-
- swapMgr.remove(spaceName,
- swapKey,
- c,
- cctx.deploy().globalLoader());
- }
+ if (swapEnabled)
+ swapMgr.remove(spaceName, part, key, cctx, c);
}
/**
@@ -1004,13 +973,8 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
keyClsLdrId,
valClsLdrId);
- if (offheapEnabled) {
- offheap.put(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()), entry.marshal());
-
- if (cctx.events().isRecordable(EVT_CACHE_OBJECT_TO_OFFHEAP))
- cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid)null, null,
- EVT_CACHE_OBJECT_TO_OFFHEAP, null, false, null, true, null, null, null);
- }
+ if (offheapEnabled)
+ offheap.put(spaceName, part, key, entry.marshal(), cctx);
else if (swapEnabled)
writeToSwap(part, key, entry.marshal());
@@ -1035,32 +999,14 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
if (offheapEnabled) {
for (GridCacheBatchSwapEntry swapEntry : swapped) {
- offheap.put(spaceName,
- swapEntry.partition(),
- swapEntry.key(),
- swapEntry.key().valueBytes(cctx.cacheObjectContext()),
- swapEntry.marshal());
-
- if (cctx.events().isRecordable(EVT_CACHE_OBJECT_TO_OFFHEAP))
- cctx.events().addEvent(swapEntry.partition(), swapEntry.key(), cctx.nodeId(),
- (IgniteUuid)null, null, EVT_CACHE_OBJECT_TO_OFFHEAP, null, false, null, true, null, null, null);
+ offheap.put(spaceName, swapEntry.partition(), swapEntry.key(), swapEntry.marshal(), cctx);
if (qryMgr != null)
qryMgr.onSwap(swapEntry.key());
}
}
else {
- Map<SwapKey, byte[]> batch = new LinkedHashMap<>();
-
- for (GridCacheBatchSwapEntry entry : swapped) {
- SwapKey swapKey = new SwapKey(entry.key().value(cctx.cacheObjectContext(), false),
- entry.partition(),
- entry.key().valueBytes(cctx.cacheObjectContext()));
-
- batch.put(swapKey, entry.marshal());
- }
-
- swapMgr.writeAll(spaceName, batch, cctx.deploy().globalLoader());
+ swapMgr.writeAll(spaceName, swapped, cctx);
if (cctx.events().isRecordable(EVT_CACHE_OBJECT_SWAPPED)) {
for (GridCacheBatchSwapEntry batchSwapEntry : swapped) {
@@ -1082,17 +1028,10 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @param entry Entry bytes.
* @throws IgniteCheckedException If failed.
*/
- private void writeToSwap(int part,
- KeyCacheObject key,
- byte[] entry)
- throws IgniteCheckedException
- {
+ private void writeToSwap(int part, KeyCacheObject key, byte[] entry) throws IgniteCheckedException {
checkIteratorQueue();
- swapMgr.write(spaceName,
- new SwapKey(key.value(cctx.cacheObjectContext(), false), part, key.valueBytes(cctx.cacheObjectContext())),
- entry,
- cctx.deploy().globalLoader());
+ swapMgr.write(spaceName, part, key, entry, cctx);
if (cctx.events().isRecordable(EVT_CACHE_OBJECT_SWAPPED))
cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid) null, null,
@@ -1274,7 +1213,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ offheap.removex(spaceName, part, key, cctx);
}
else
it.removeX();
@@ -1432,6 +1371,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
return it.hasNext();
}
+ @SuppressWarnings("unchecked")
@Override protected void onRemove() throws IgniteCheckedException {
if (cur == null)
throw new IllegalStateException("Method next() has not yet been called, or the remove() method " +
@@ -1616,7 +1556,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ offheap.removex(spaceName, part, key, cctx);
}
@Override protected void onClose() throws IgniteCheckedException {
@@ -1646,7 +1586,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ offheap.removex(spaceName, part, key, cctx);
}
};
}
[19/50] [abbrv] incubator-ignite git commit: Changed default timeout:
SocketWrite - 200 AckTimeout - 50 HeartbeatFrequency -100 NetworkTimeout -
5000
Posted by sb...@apache.org.
Changed default timeout:
SocketWrite - 200
AckTimeout - 50
HeartbeatFrequency -100
NetworkTimeout - 5000
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/df25d350
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/df25d350
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/df25d350
Branch: refs/heads/ignite-37
Commit: df25d35067beb8d5f40c97139eac0c06310b6666
Parents: c3dde57
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon May 18 11:41:41 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon May 18 11:41:41 2015 +0300
----------------------------------------------------------------------
.../spi/discovery/tcp/TcpDiscoverySpiAdapter.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/df25d350/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
index b7e3cd5..802da02 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
@@ -54,17 +54,17 @@ abstract class TcpDiscoverySpiAdapter extends IgniteSpiAdapter implements Discov
/** Default socket operations timeout in milliseconds (value is <tt>200ms</tt>). */
public static final long DFLT_SOCK_TIMEOUT = 200;
- /** Default timeout for receiving message acknowledgement in milliseconds (value is <tt>200ms</tt>). */
- public static final long DFLT_ACK_TIMEOUT = 200;
+ /** Default timeout for receiving message acknowledgement in milliseconds (value is <tt>50ms</tt>). */
+ public static final long DFLT_ACK_TIMEOUT = 50;
- /** Default network timeout in milliseconds (value is <tt>200ms</tt>). */
- public static final long DFLT_NETWORK_TIMEOUT = 200;
+ /** Default network timeout in milliseconds (value is <tt>5000ms</tt>). */
+ public static final long DFLT_NETWORK_TIMEOUT = 5000;
/** Default value for thread priority (value is <tt>10</tt>). */
public static final int DFLT_THREAD_PRI = 10;
- /** Default heartbeat messages issuing frequency (value is <tt>300ms</tt>). */
- public static final long DFLT_HEARTBEAT_FREQ = 300;
+ /** Default heartbeat messages issuing frequency (value is <tt>100ms</tt>). */
+ public static final long DFLT_HEARTBEAT_FREQ = 100;
/** Default size of topology snapshots history. */
public static final int DFLT_TOP_HISTORY_SIZE = 1000;
[12/50] [abbrv] incubator-ignite git commit: # removed cleaning of
IpFinder by coordinator on topology changes.
Posted by sb...@apache.org.
# removed cleaning of IpFinder by coordinator on topology changes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ee408190
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ee408190
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ee408190
Branch: refs/heads/ignite-37
Commit: ee40819088fe3724ad7e7cad66d501d7db237102
Parents: 7fa8abc
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri May 15 17:53:28 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 15 17:53:28 2015 +0300
----------------------------------------------------------------------
.../spi/discovery/tcp/TcpDiscoverySpi.java | 26 --------------------
1 file changed, 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee408190/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 1dea37a..ed0e9dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -3952,18 +3952,6 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
long topVer;
if (locNodeCoord) {
- if (!msg.client() && ipFinder.isShared()) {
- try {
- ipFinder.unregisterAddresses(leftNode.socketAddresses());
- }
- catch (IgniteSpiException e) {
- if (log.isDebugEnabled())
- log.debug("Failed to unregister left node address: " + leftNode);
-
- onException("Failed to unregister left node address: " + leftNode, e);
- }
- }
-
topVer = ring.incrementTopologyVersion();
msg.topologyVersion(topVer);
@@ -4131,20 +4119,6 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
long topVer;
if (locNodeCoord) {
- if (!node.isClient() && ipFinder.isShared()) {
- try {
- ipFinder.unregisterAddresses(node.socketAddresses());
- }
- catch (IgniteSpiException e) {
- if (log.isDebugEnabled())
- log.debug("Failed to unregister failed node address [node=" + node +
- ", err=" + e.getMessage() + ']');
-
- onException("Failed to unregister failed node address [node=" + node +
- ", err=" + e.getMessage() + ']', e);
- }
- }
-
topVer = ring.incrementTopologyVersion();
msg.topologyVersion(topVer);
[07/50] [abbrv] incubator-ignite git commit: ignite-430 review
Posted by sb...@apache.org.
ignite-430 review
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fe78d42c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fe78d42c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fe78d42c
Branch: refs/heads/ignite-37
Commit: fe78d42cfe77626b7250875e0c3f608b27dc9367
Parents: 7ee8517
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu May 14 16:36:06 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri May 15 03:44:37 2015 +0300
----------------------------------------------------------------------
.../socket/WordsSocketStreamerClient.java | 86 --------------
.../socket/ZWordsSocketStreamerClient.java | 81 --------------
.../socket/ZWordsSocketStreamerServer.java | 111 -------------------
.../examples/streaming/socket/package-info.java | 21 ----
.../streaming/wordcount/QueryWords.java | 6 +
.../streaming/wordcount/StreamWords.java | 6 +
.../socket/WordsSocketStreamerClient.java | 82 ++++++++++++++
.../socket/WordsSocketStreamerServer.java | 111 +++++++++++++++++++
.../wordcount/socket/package-info.java | 21 ++++
9 files changed, 226 insertions(+), 299 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.java
deleted file mode 100644
index c5ec079..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/WordsSocketStreamerClient.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.examples.streaming.socket;
-
-import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.wordcount.*;
-import org.apache.ignite.stream.socket.*;
-
-import java.io.*;
-import java.net.*;
-
-/**
- * Sends words to socket server based on {@link SocketStreamer} using message size based protocol.
- * <p>
- * To start the example, you should:
- * <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
- * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
- * <li>Start querying popular words using {@link QueryWords}.</li>
- * </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
- */
-public class WordsSocketStreamerClient {
- /** Port. */
- private static final int PORT = 5555;
-
- /**
- * @param args Args.
- */
- public static void main(String[] args) throws IOException {
- InetAddress addr = InetAddress.getLocalHost();
-
- try (Socket sock = new Socket(addr, PORT);
- OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
-
- System.out.println("Words streaming started.");
-
- while (true) {
- try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
- LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
- for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
- for (String word : line.split(" ")) {
- if (!word.isEmpty()) {
- // Stream words into Ignite through socket.
- try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bos)) {
-
- // Write message
- out.writeObject(word);
-
- byte[] arr = bos.toByteArray();
-
- // Write message length
- oos.write(arr.length >>> 24);
- oos.write(arr.length >>> 16);
- oos.write(arr.length >>> 8);
- oos.write(arr.length);
-
- oos.write(arr);
- }
- }
- }
- }
- }
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java
deleted file mode 100644
index c17ccdc..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerClient.java
+++ /dev/null
@@ -1,81 +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.examples.streaming.socket;
-
-import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.wordcount.*;
-import org.apache.ignite.stream.socket.*;
-
-import java.io.*;
-import java.net.*;
-
-/**
- * Sends words to socket server based on {@link SocketStreamer} using message delimiter based protocol.
- * Example illustrates usage of TCP socket streamer in case of non-Java clients.
- * In this example words are zero-terminated strings.
- * <p>
- * To start the example, you should:
- * <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start socket server using {@link ZWordsSocketStreamerServer}.</li>
- * <li>Start a few socket clients using {@link ZWordsSocketStreamerClient}.</li>
- * <li>Start querying popular words using {@link QueryWords}.</li>
- * </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
- */
-public class ZWordsSocketStreamerClient {
- /** Port. */
- private static final int PORT = 5555;
-
- /** Delimiter. */
- private static final byte[] DELIM = new byte[] {0};
-
- /**
- * @param args Args.
- */
- public static void main(String[] args) throws IOException {
- InetAddress addr = InetAddress.getLocalHost();
-
- try (Socket sock = new Socket(addr, PORT);
- OutputStream oos = new BufferedOutputStream(sock.getOutputStream())) {
-
- System.out.println("Words streaming started.");
-
- while (true) {
- try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
- LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
- for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
- for (String word : line.split(" ")) {
- if (!word.isEmpty()) {
- // Stream words into Ignite through socket.
- byte[] arr = word.getBytes("ASCII");
-
- // Write message
- oos.write(arr);
-
- // Write message delimiter
- oos.write(DELIM);
- }
- }
- }
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java
deleted file mode 100644
index a0ef9da..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/ZWordsSocketStreamerServer.java
+++ /dev/null
@@ -1,111 +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.examples.streaming.socket;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.examples.*;
-import org.apache.ignite.examples.streaming.wordcount.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.stream.*;
-import org.apache.ignite.stream.socket.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * Receives words through socket using {@link SocketStreamer} and message delimiter based protocol
- * and streams them into Ignite cache. Example illustrates usage of TCP socket streamer in case of non-Java clients.
- * In this example words are zero-terminated strings.
- * <p>
- * To start the example, you should:
- * <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
- * <li>Start socket server using {@link ZWordsSocketStreamerServer}.</li>
- * <li>Start a few socket clients using {@link ZWordsSocketStreamerClient}.</li>
- * <li>Start querying popular words using {@link QueryWords}.</li>
- * </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
- */
-public class ZWordsSocketStreamerServer {
- /** Port. */
- private static final int PORT = 5555;
-
- /** Delimiter. */
- private static final byte[] DELIM = new byte[] {0};
-
- /**
- * @param args Args.
- */
- public static void main(String[] args) throws InterruptedException, IOException {
- // Mark this cluster member as client.
- Ignition.setClientMode(true);
-
- Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
-
- if (!ExamplesUtils.hasServerNodes(ignite)) {
- ignite.close();
-
- return;
- }
-
- // The cache is configured with sliding window holding 1 second of the streaming data.
- IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
-
- IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
-
- InetAddress addr = InetAddress.getLocalHost();
-
- // Configure socket streamer
- SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
-
- sockStmr.setAddr(addr);
-
- sockStmr.setPort(PORT);
-
- sockStmr.setDelimiter(DELIM);
-
- sockStmr.setIgnite(ignite);
-
- sockStmr.setStreamer(stmr);
-
- // Converter from zero-terminated string to Java strings.
- sockStmr.setConverter(new SocketMessageConverter<String>() {
- @Override public String convert(byte[] msg) {
- try {
- return new String(msg, "ASCII");
- }
- catch (UnsupportedEncodingException e) {
- throw new IgniteException(e);
- }
- }
- });
-
- sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
- @Override public Map.Entry<AffinityUuid, String> extract(String word) {
- // By using AffinityUuid we ensure that identical
- // words are processed on the same cluster node.
- return new IgniteBiTuple<>(new AffinityUuid(word), word);
- }
- });
-
- sockStmr.start();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
deleted file mode 100644
index c516ab4..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/socket/package-info.java
+++ /dev/null
@@ -1,21 +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.
- */
-
-/**
- * Contains {@link org.apache.ignite.stream.socket.SocketStreamer} usage examples.
- */
-package org.apache.ignite.examples.streaming.socket;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
index 149aa79..faf8b51 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
@@ -36,6 +36,12 @@ import java.util.*;
* You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class QueryWords {
+ /**
+ * Schedules words query execution.
+ *
+ * @param args Command line arguments (none required).
+ * @throws Exception If failed.
+ */
public static void main(String[] args) throws Exception {
// Mark this cluster member as client.
Ignition.setClientMode(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
index cc3c0cb..26be178 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
@@ -35,6 +35,12 @@ import java.io.*;
* You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class StreamWords {
+ /**
+ * Starts words streaming.
+ *
+ * @param args Command line arguments (none required).
+ * @throws Exception If failed.
+ */
public static void main(String[] args) throws Exception {
// Mark this cluster member as client.
Ignition.setClientMode(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
new file mode 100644
index 0000000..ea3beaa
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
@@ -0,0 +1,82 @@
+/*
+ * 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.examples.streaming.wordcount.socket;
+
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+
+/**
+ * Sends words to socket server based on {@link SocketStreamer} using message delimiter based protocol.
+ * Example illustrates usage of TCP socket streamer in case of non-Java clients.
+ * In this example words are zero-terminated strings.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class WordsSocketStreamerClient {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0};
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws IOException {
+ InetAddress addr = InetAddress.getLocalHost();
+
+ try (
+ Socket sock = new Socket(addr, PORT);
+ OutputStream oos = new BufferedOutputStream(sock.getOutputStream())
+ ) {
+ System.out.println("Words streaming started.");
+
+ while (true) {
+ try (InputStream in = StreamWords.class.getResourceAsStream("../wordcount/alice-in-wonderland.txt");
+ LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
+ for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
+ for (String word : line.split(" ")) {
+ if (!word.isEmpty()) {
+ // Stream words into Ignite through socket.
+ byte[] arr = word.getBytes("ASCII");
+
+ // Write message
+ oos.write(arr);
+
+ // Write message delimiter
+ oos.write(DELIM);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
new file mode 100644
index 0000000..259c925
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
@@ -0,0 +1,111 @@
+/*
+ * 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.examples.streaming.wordcount.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.stream.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * Receives words through socket using {@link SocketStreamer} and message delimiter based protocol
+ * and streams them into Ignite cache. Example illustrates usage of TCP socket streamer in case of non-Java clients.
+ * In this example words are zero-terminated strings.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ * <p>
+ * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
+ */
+public class WordsSocketStreamerServer {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0};
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws InterruptedException, IOException {
+ // Mark this cluster member as client.
+ Ignition.setClientMode(true);
+
+ Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
+
+ if (!ExamplesUtils.hasServerNodes(ignite)) {
+ ignite.close();
+
+ return;
+ }
+
+ // The cache is configured with sliding window holding 1 second of the streaming data.
+ IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+
+ IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
+
+ InetAddress addr = InetAddress.getLocalHost();
+
+ // Configure socket streamer
+ SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
+
+ sockStmr.setAddr(addr);
+
+ sockStmr.setPort(PORT);
+
+ sockStmr.setDelimiter(DELIM);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ // Converter from zero-terminated string to Java strings.
+ sockStmr.setConverter(new SocketMessageConverter<String>() {
+ @Override public String convert(byte[] msg) {
+ try {
+ return new String(msg, "ASCII");
+ }
+ catch (UnsupportedEncodingException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
+ @Override public Map.Entry<AffinityUuid, String> extract(String word) {
+ // By using AffinityUuid we ensure that identical
+ // words are processed on the same cluster node.
+ return new IgniteBiTuple<>(new AffinityUuid(word), word);
+ }
+ });
+
+ sockStmr.start();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe78d42c/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java
new file mode 100644
index 0000000..048299f
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * Contains {@link org.apache.ignite.stream.socket.SocketStreamer} usage examples.
+ */
+package org.apache.ignite.examples.streaming.wordcount.socket;
[44/50] [abbrv] incubator-ignite git commit: # Adjusted version in
ignite.properties.
Posted by sb...@apache.org.
# Adjusted version in ignite.properties.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/29bffe61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/29bffe61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/29bffe61
Branch: refs/heads/ignite-37
Commit: 29bffe61a20fa6bac4c05d26bff35f6ac05f3e75
Parents: 3100dcc
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu May 21 13:24:21 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu May 21 13:24:21 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/resources/ignite.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/29bffe61/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 61c6583..f53dec6 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.0.7
+ignite.version=1.0.7-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
[47/50] [abbrv] incubator-ignite git commit: # ignite-456: fix slurp
runner
Posted by sb...@apache.org.
# ignite-456: fix slurp runner
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/51ae1a36
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/51ae1a36
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/51ae1a36
Branch: refs/heads/ignite-37
Commit: 51ae1a36674d6ea00de401c04cfef607c77f00cc
Parents: 0bc36a9
Author: null <null>
Authored: Thu May 21 14:17:19 2015 +0300
Committer: null <null>
Committed: Thu May 21 14:17:19 2015 +0300
----------------------------------------------------------------------
dev-tools/build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51ae1a36/dev-tools/build.gradle
----------------------------------------------------------------------
diff --git a/dev-tools/build.gradle b/dev-tools/build.gradle
index 10f9b64..5b089e8 100644
--- a/dev-tools/build.gradle
+++ b/dev-tools/build.gradle
@@ -36,7 +36,7 @@ task help {
}
task slurp(dependsOn: 'classes', type: JavaExec) {
- args(project.buildDir)
+ args(project.buildDir, "slurp")
main = 'jiraslurp'
classpath = sourceSets.main.runtimeClasspath
}
[49/50] [abbrv] incubator-ignite git commit: ignite-37 Improve
offheap metrics for cache
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
index a99c4c0..c044ffb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.offheap;
import org.apache.ignite.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.*;
+import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.offheap.*;
@@ -32,6 +33,8 @@ import org.jsr166.*;
import java.util.*;
+import static org.apache.ignite.events.EventType.*;
+
/**
* Manages offheap memory caches.
*/
@@ -97,13 +100,15 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* Ensures that we have {@code keyBytes}.
*
* @param key Key.
- * @param keyBytes Optional key bytes.
- * @return Key bytes
+ * @param cctx Cache context.
+ * @return Key bytes.
* @throws IgniteCheckedException If failed.
*/
- private byte[] keyBytes(Object key, @Nullable byte[] keyBytes) throws IgniteCheckedException {
+ private byte[] keyBytes(KeyCacheObject key, GridCacheContext cctx) throws IgniteCheckedException {
assert key != null;
+ byte[] keyBytes = key.valueBytes(cctx.cacheObjectContext());
+
return keyBytes != null ? keyBytes : marsh.marshal(key);
}
@@ -126,15 +131,20 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
- * @return {@code true} If offheap space contains value for the given key.
+ * @param cctx Cache context.
+ * @return {@code True} If offheap space contains value for the given key.
* @throws IgniteCheckedException If failed.
*/
- public boolean contains(@Nullable String spaceName, int part, Object key, byte[] keyBytes)
+ public boolean contains(@Nullable String spaceName, int part, KeyCacheObject key, GridCacheContext cctx)
throws IgniteCheckedException {
GridOffHeapPartitionedMap m = offheap(spaceName);
- return m != null && m.contains(part, U.hash(key), keyBytes(key, keyBytes));
+ boolean hit = m != null && m.contains(part, U.hash(key), keyBytes(key, cctx));
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRead(hit);
+
+ return hit;
}
/**
@@ -143,15 +153,20 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
+ * @param cctx Cache context.
* @return Value bytes.
* @throws IgniteCheckedException If failed.
*/
- @Nullable public byte[] get(@Nullable String spaceName, int part, Object key, byte[] keyBytes)
+ @Nullable public byte[] get(@Nullable String spaceName, int part, KeyCacheObject key, GridCacheContext cctx)
throws IgniteCheckedException {
GridOffHeapPartitionedMap m = offheap(spaceName);
- return m == null ? null : m.get(part, U.hash(key), keyBytes(key, keyBytes));
+ byte[] bytes = m == null ? null : m.get(part, U.hash(key), keyBytes(key, cctx));
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRead(bytes != null);
+
+ return bytes;
}
/**
@@ -162,15 +177,15 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
+ * @param cctx Cache context.
* @return Tuple where first value is pointer and second is value size.
* @throws IgniteCheckedException If failed.
*/
- @Nullable public IgniteBiTuple<Long, Integer> valuePointer(@Nullable String spaceName, int part, Object key,
- byte[] keyBytes) throws IgniteCheckedException {
+ @Nullable public IgniteBiTuple<Long, Integer> valuePointer(@Nullable String spaceName, int part, KeyCacheObject key,
+ GridCacheContext cctx) throws IgniteCheckedException {
GridOffHeapPartitionedMap m = offheap(spaceName);
- return m == null ? null : m.valuePointer(part, U.hash(key), keyBytes(key, keyBytes));
+ return m == null ? null : m.valuePointer(part, U.hash(key), keyBytes(key, cctx));
}
/**
@@ -179,15 +194,15 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
+ * @param cctx Cache context.
* @throws IgniteCheckedException If failed.
*/
- public void enableEviction(@Nullable String spaceName, int part, Object key, byte[] keyBytes)
+ public void enableEviction(@Nullable String spaceName, int part, KeyCacheObject key, GridCacheContext cctx)
throws IgniteCheckedException {
GridOffHeapPartitionedMap m = offheap(spaceName);
if (m != null)
- m.enableEviction(part, U.hash(key), keyBytes(key, keyBytes));
+ m.enableEviction(part, U.hash(key), keyBytes(key, cctx));
}
/**
@@ -196,14 +211,13 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
- * @param ldr Class loader.
- * @return Value bytes.
+ * @param cctx Cache context.
+ * @param ldr Class loader. @return Value bytes.
* @throws IgniteCheckedException If failed.
*/
- @Nullable public <T> T getValue(@Nullable String spaceName, int part, Object key, byte[] keyBytes,
- @Nullable ClassLoader ldr) throws IgniteCheckedException {
- byte[] valBytes = get(spaceName, part, key, keyBytes);
+ @Nullable public <T> T getValue(@Nullable String spaceName, int part, KeyCacheObject key,
+ GridCacheContext cctx, @Nullable ClassLoader ldr) throws IgniteCheckedException {
+ byte[] valBytes = get(spaceName, part, key, cctx);
if (valBytes == null)
return null;
@@ -217,14 +231,23 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
+ * @param cctx Cache context.
* @return Value bytes.
* @throws IgniteCheckedException If failed.
*/
- @Nullable public byte[] remove(@Nullable String spaceName, int part, Object key, byte[] keyBytes) throws IgniteCheckedException {
+ @Nullable public byte[] remove(@Nullable String spaceName, int part, KeyCacheObject key, GridCacheContext cctx)
+ throws IgniteCheckedException {
GridOffHeapPartitionedMap m = offheap(spaceName);
- return m == null ? null : m.remove(part, U.hash(key), keyBytes(key, keyBytes));
+ if (m == null)
+ return null;
+
+ byte[] bytes = m.remove(part, U.hash(key), keyBytes(key, cctx));
+
+ if(bytes != null && cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRemove();
+
+ return bytes;
}
/**
@@ -233,11 +256,11 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
* @param valBytes Value bytes.
+ * @param cctx Cache context.
* @throws IgniteCheckedException If failed.
*/
- public void put(@Nullable String spaceName, int part, Object key, byte[] keyBytes, byte[] valBytes)
+ public void put(@Nullable String spaceName, int part, KeyCacheObject key, byte[] valBytes, GridCacheContext cctx)
throws IgniteCheckedException {
GridOffHeapPartitionedMap m = offheap(spaceName);
@@ -245,7 +268,14 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
throw new IgniteCheckedException("Failed to write data to off-heap space, no space registered for name: " +
spaceName);
- m.put(part, U.hash(key), keyBytes(key, keyBytes), valBytes);
+ m.put(part, U.hash(key), keyBytes(key, cctx), valBytes);
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapWrite();
+
+ if (cctx.events().isRecordable(EVT_CACHE_OBJECT_TO_OFFHEAP))
+ cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid)null, null,
+ EVT_CACHE_OBJECT_TO_OFFHEAP, null, false, null, true, null, null, null);
}
/**
@@ -254,14 +284,23 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
* @param spaceName Space name.
* @param part Partition.
* @param key Key.
- * @param keyBytes Key bytes.
- * @return {@code true} If succeeded.
+ * @param cctx Cache context.
+ * @return {@code True} If succeeded.
* @throws IgniteCheckedException If failed.
*/
- public boolean removex(@Nullable String spaceName, int part, Object key, byte[] keyBytes) throws IgniteCheckedException {
+ public boolean removex(@Nullable String spaceName, int part, KeyCacheObject key, GridCacheContext cctx)
+ throws IgniteCheckedException {
GridOffHeapPartitionedMap m = offheap(spaceName);
- return m != null && m.removex(part, U.hash(key), keyBytes(key, keyBytes));
+ if (m == null)
+ return false;
+
+ boolean rmv = m.removex(part, U.hash(key), keyBytes(key, cctx));
+
+ if(rmv && cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRemove();
+
+ return rmv;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
index 2ad07b5..5cdc72f 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
@@ -100,14 +100,94 @@ public interface CacheMetricsMXBean extends CacheStatisticsMXBean, CacheMXBean,
public long getOverflowSize();
/** {@inheritDoc} */
+ @MXBeanDescription("Number of gets from off-heap memory.")
+ public long getOffHeapGets();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of puts to off-heap memory.")
+ public long getOffHeapPuts();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of removed entries from off-heap memory.")
+ public long getOffHeapRemovals();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of evictions from off-heap memory.")
+ public long getOffHeapEvictions();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of hits on off-heap memory.")
+ public long getOffHeapHits();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Percentage of hits on off-heap memory.")
+ public float getOffHeapHitPercentage();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of misses on off-heap memory.")
+ public long getOffHeapMisses();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Percentage of misses on off-heap memory.")
+ public float getOffHeapMissPercentage();
+
+ /** {@inheritDoc} */
@MXBeanDescription("Number of entries stored in off-heap memory.")
public long getOffHeapEntriesCount();
/** {@inheritDoc} */
+ @MXBeanDescription("Number of primary entries stored in off-heap memory.")
+ public long getOffHeapPrimaryEntriesCount();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of backup stored in off-heap memory.")
+ public long getOffHeapBackupEntriesCount();
+
+ /** {@inheritDoc} */
@MXBeanDescription("Memory size allocated in off-heap.")
public long getOffHeapAllocatedSize();
/** {@inheritDoc} */
+ @MXBeanDescription("Off-heap memory maximum size.")
+ public long getOffHeapMaxSize();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of gets from swap.")
+ public long getSwapGets();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of puts to swap.")
+ public long getSwapPuts();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of removed entries from swap.")
+ public long getSwapRemovals();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of hits on swap.")
+ public long getSwapHits();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of misses on swap.")
+ public long getSwapMisses();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Percentage of hits on swap.")
+ public float getSwapHitPercentage();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Percentage of misses on swap.")
+ public float getSwapMissPercentage();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Number of entries stored in swap.")
+ public long getSwapEntriesCount();
+
+ /** {@inheritDoc} */
+ @MXBeanDescription("Size of swap.")
+ public long getSwapSize();
+
+ /** {@inheritDoc} */
@MXBeanDescription("Number of non-null values in the cache.")
public int getSize();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
index 871512c..b13cc97 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
@@ -29,7 +29,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.plugin.security.*;
import org.apache.ignite.resources.*;
-import org.apache.ignite.spi.swapspace.*;
+
import org.jetbrains.annotations.*;
import javax.management.*;
@@ -453,19 +453,20 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
boolean isSpiConsistent = false;
- String tipStr = " (fix configuration or set " + "-D" + IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system property)";
+ String tipStr = " (fix configuration or set " +
+ "-D" + IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system property)";
if (rmtCls == null) {
if (!optional && starting)
- throw new IgniteSpiException("Remote SPI with the same name is not configured" + tipStr + " [name=" + name +
- ", loc=" + locCls + ']');
+ throw new IgniteSpiException("Remote SPI with the same name is not configured" + tipStr +
+ " [name=" + name + ", loc=" + locCls + ']');
sb.a(format(">>> Remote SPI with the same name is not configured: " + name, locCls));
}
else if (!locCls.equals(rmtCls)) {
if (!optional && starting)
- throw new IgniteSpiException("Remote SPI with the same name is of different type" + tipStr + " [name=" + name +
- ", loc=" + locCls + ", rmt=" + rmtCls + ']');
+ throw new IgniteSpiException("Remote SPI with the same name is of different type" + tipStr +
+ " [name=" + name + ", loc=" + locCls + ", rmt=" + rmtCls + ']');
sb.a(format(">>> Remote SPI with the same name is of different type: " + name, locCls, rmtCls));
}
@@ -627,27 +628,11 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
}
/** {@inheritDoc} */
- @Override public void writeToSwap(String spaceName, Object key, @Nullable Object val,
- @Nullable ClassLoader ldr) {
- /* No-op. */
- }
-
- /** {@inheritDoc} */
- @Override public <T> T readFromSwap(String spaceName, SwapKey key, @Nullable ClassLoader ldr) {
- return null;
- }
-
- /** {@inheritDoc} */
@Override public int partition(String cacheName, Object key) {
return -1;
}
/** {@inheritDoc} */
- @Override public void removeFromSwap(String spaceName, Object key, @Nullable ClassLoader ldr) {
- // No-op.
- }
-
- /** {@inheritDoc} */
@Override public Collection<ClusterNode> nodes() {
return locNode == null ? Collections.<ClusterNode>emptyList() : Collections.singletonList(locNode);
}
@@ -713,12 +698,6 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
}
/** {@inheritDoc} */
- @Nullable @Override public <T> T readValueFromOffheapAndSwap(@Nullable String spaceName, Object key,
- @Nullable ClassLoader ldr) {
- return null;
- }
-
- /** {@inheritDoc} */
@Override public MessageFormatter messageFormatter() {
return msgFormatter;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
index 6852b6d..55f46e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.managers.eventstorage.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.plugin.security.*;
-import org.apache.ignite.spi.swapspace.*;
import org.jetbrains.annotations.*;
import javax.cache.*;
@@ -253,30 +252,6 @@ public interface IgniteSpiContext {
public <K> boolean containsKey(String cacheName, K key);
/**
- * Writes object to swap.
- *
- * @param spaceName Swap space name.
- * @param key Key.
- * @param val Value.
- * @param ldr Class loader (optional).
- * @throws IgniteException If any exception occurs.
- */
- public void writeToSwap(String spaceName, Object key, @Nullable Object val, @Nullable ClassLoader ldr)
- throws IgniteException;
-
- /**
- * Reads object from swap.
- *
- * @param spaceName Swap space name.
- * @param key Key.
- * @param ldr Class loader (optional).
- * @return Swapped value.
- * @throws IgniteException If any exception occurs.
- */
- @Nullable public <T> T readFromSwap(String spaceName, SwapKey key, @Nullable ClassLoader ldr)
- throws IgniteException;
-
- /**
* Calculates partition number for given key.
*
* @param cacheName Cache name.
@@ -286,16 +261,6 @@ public interface IgniteSpiContext {
public int partition(String cacheName, Object key);
/**
- * Removes object from swap.
- *
- * @param spaceName Swap space name.
- * @param key Key.
- * @param ldr Class loader (optional).
- * @throws IgniteException If any exception occurs.
- */
- public void removeFromSwap(String spaceName, Object key, @Nullable ClassLoader ldr) throws IgniteException;
-
- /**
* Validates that new node can join grid topology, this method is called on coordinator
* node before new node joins topology.
*
@@ -322,18 +287,6 @@ public interface IgniteSpiContext {
public SecuritySubject authenticatedSubject(UUID subjId) throws IgniteException;
/**
- * Reads swapped cache value from off-heap and swap.
- *
- * @param spaceName Off-heap space name.
- * @param key Key.
- * @param ldr Class loader for unmarshalling.
- * @return Value.
- * @throws IgniteException If any exception occurs.
- */
- @Nullable public <T> T readValueFromOffheapAndSwap(@Nullable String spaceName, Object key,
- @Nullable ClassLoader ldr) throws IgniteException;
-
- /**
* Gets message formatter.
*
* @return Message formatter.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
index e7db285..7a88426 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
@@ -387,15 +387,13 @@ public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi,
Space space = space(spaceName, false);
- if (space == null)
- return;
-
- byte[] val = space.remove(key, c != null);
+ byte[] val = space == null ? null : space.remove(key, c != null);
if (c != null)
c.apply(val);
- notifyListener(EVT_SWAP_SPACE_DATA_REMOVED, spaceName);
+ if (space != null)
+ notifyListener(EVT_SWAP_SPACE_DATA_REMOVED, spaceName);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/test/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManagerSelfTest.java
index 043311e..27e0fea 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManagerSelfTest.java
@@ -21,10 +21,11 @@ import org.apache.ignite.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.spi.swapspace.*;
+import org.apache.ignite.marshaller.*;
import org.apache.ignite.spi.swapspace.file.*;
import org.apache.ignite.testframework.junits.common.*;
@@ -40,7 +41,10 @@ import static org.apache.ignite.events.EventType.*;
@GridCommonTest(group = "Kernal Self")
public class GridSwapSpaceManagerSelfTest extends GridCommonAbstractTest {
/** */
- private static final String spaceName = "swapspace_mgr";
+ private static final String SPACE_NAME = "swapspace_mgr";
+
+ /** Partition. */
+ private static final int PART = Integer.MAX_VALUE;
/**
*
@@ -64,7 +68,7 @@ public class GridSwapSpaceManagerSelfTest extends GridCommonAbstractTest {
* @param ignite Grid instance.
* @return Swap space manager.
*/
- private GridSwapSpaceManager getSwapSpaceManager(Ignite ignite) {
+ private static GridSwapSpaceManager getSwapSpaceManager(Ignite ignite) {
assert ignite != null;
return ((IgniteKernal) ignite).context().swap();
@@ -89,7 +93,7 @@ public class GridSwapSpaceManagerSelfTest extends GridCommonAbstractTest {
SwapSpaceEvent e = (SwapSpaceEvent) evt;
- assert spaceName.equals(e.space());
+ assert SPACE_NAME.equals(e.space());
assert ignite.cluster().localNode().id().equals(e.node().id());
switch (evt.type()) {
@@ -123,41 +127,55 @@ public class GridSwapSpaceManagerSelfTest extends GridCommonAbstractTest {
GridSwapSpaceManager mgr = getSwapSpaceManager(ignite);
+ ignite.getOrCreateCache((String)null);
+
+ GridKernalContext ctx = ((IgniteKernal)ignite).context();
+
+ GridCacheContext cctx = ((IgniteCacheProxy)ignite.cache(null)).context();
+
+ Marshaller marsh = ctx.config().getMarshaller();
+
assert mgr != null;
// Empty data space.
- assertEquals(0, mgr.swapSize(spaceName));
+ assertEquals(0, mgr.swapSize(SPACE_NAME));
+
+ String key1 = "key1";
+
+ String key2 = "key2";
+
+ KeyCacheObject ckey1 = new KeyCacheObjectImpl(key1, marsh.marshal(key1));
- SwapKey key = new SwapKey("key1");
+ KeyCacheObject ckey2 = new KeyCacheObjectImpl(key2, marsh.marshal(key2));
String val = "value";
- mgr.write(spaceName, key, val.getBytes(), null);
+ mgr.write(SPACE_NAME, PART, ckey1, marsh.marshal(val), cctx);
- mgr.write(spaceName, new SwapKey("key2"), val.getBytes(), null);
+ mgr.write(SPACE_NAME, PART, ckey2, marsh.marshal(val), cctx);
assert storeCnt.await(10, SECONDS);
- byte[] arr = mgr.read(spaceName, key, null);
+ byte[] arr = mgr.read(SPACE_NAME, PART, ckey1, cctx);
assert arr != null;
- assert val.equals(new String(arr));
+ assert val.equals(marsh.unmarshal(arr, cctx.deploy().globalLoader()));
final GridTuple<Boolean> b = F.t(false);
- mgr.remove(spaceName, key, new CI1<byte[]>() {
+ mgr.remove(SPACE_NAME, PART, ckey1, cctx, new CI1<byte[]>() {
@Override public void apply(byte[] rmv) {
b.set(rmv != null);
}
- }, null);
+ });
assert b.get();
assert rmvCnt.await(10, SECONDS);
assert readCnt.await(10, SECONDS);
- mgr.clear(spaceName);
+ mgr.clear(SPACE_NAME);
assert clearCnt.await(10, SECONDS) : "Count: " + clearCnt.getCount();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
new file mode 100644
index 0000000..3d44600
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
@@ -0,0 +1,412 @@
+/*
+ * 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.local;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.eviction.fifo.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.swapspace.file.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ *
+ */
+public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractTest {
+ /** Grid count. */
+ private static final int GRID_CNT = 1;
+
+ /** Keys count. */
+ private static final int KEYS_CNT = 1000;
+
+ /** Max size. */
+ private static final int MAX_SIZE = 100;
+
+ /** Entry size. */
+ private static final int ENTRY_SIZE = 86; // Calculated as allocated size divided on entries count.
+
+ /** Offheap max count. */
+ private static final int OFFHEAP_MAX_CNT = KEYS_CNT / 2;
+
+ /** Offheap max size. */
+ private static final int OFFHEAP_MAX_SIZE = ENTRY_SIZE * OFFHEAP_MAX_CNT;
+
+ /** Cache. */
+ private IgniteCache<Integer, Integer> cache;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+
+ return cfg;
+ }
+
+ /**
+ * @param offHeapSize Max off-heap size.
+ * @param swapEnabled Swap enabled.
+ */
+ private void createCache(int offHeapSize, boolean swapEnabled) {
+ CacheConfiguration ccfg = defaultCacheConfiguration();
+
+ ccfg.setStatisticsEnabled(true);
+
+ ccfg.setCacheMode(CacheMode.LOCAL);
+ ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+ ccfg.setMemoryMode(CacheMemoryMode.ONHEAP_TIERED);
+
+ ccfg.setOffHeapMaxMemory(offHeapSize);
+ ccfg.setSwapEnabled(swapEnabled);
+
+ ccfg.setEvictionPolicy(new FifoEvictionPolicy(MAX_SIZE));
+
+ cache = grid(0).getOrCreateCache(ccfg);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ startGrids(GRID_CNT);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ if (cache != null)
+ cache.close();
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testOffHeapMetrics() throws Exception {
+ createCache(0, false);
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.put(i, i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapGets());
+ assertEquals(0, cache.metrics().getOffHeapHits());
+ assertEquals(0f, cache.metrics().getOffHeapHitPercentage());
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
+ assertEquals(100f, cache.metrics().getOffHeapMissPercentage());
+ assertEquals(0, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(0, cache.metrics().getOffHeapEvictions());
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapEntriesCount());
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.get(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapGets());
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapHits());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(0, cache.metrics().getOffHeapEvictions());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapEntriesCount());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+
+ for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
+ cache.get(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapGets());
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapHits());
+ assertEquals(100 / 3.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
+ assertEquals(100 - (100 / 3.0), cache.metrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(0, cache.metrics().getOffHeapEvictions());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapEntriesCount());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.remove(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getOffHeapGets());
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getOffHeapHits());
+ assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
+ cache.metrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
+ assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE),
+ cache.metrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(0, cache.metrics().getOffHeapEvictions());
+ assertEquals(0, cache.metrics().getOffHeapEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testSwapMetrics() throws Exception {
+ createCache(-1, true);
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.put(i, i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapGets());
+ assertEquals(0, cache.metrics().getSwapHits());
+ assertEquals(0f, cache.metrics().getSwapHitPercentage());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
+ assertEquals(100f, cache.metrics().getSwapMissPercentage());
+ assertEquals(0, cache.metrics().getSwapRemovals());
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapEntriesCount());
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.get(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 2, cache.metrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getSwapEntriesCount());
+
+ for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
+ cache.get(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 3, cache.metrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
+ assertEquals(100 / 3.0, cache.metrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+ assertEquals(100 - (100 / 3.0), cache.metrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getSwapEntriesCount());
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.remove(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getSwapGets());
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getSwapHits());
+ assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
+ cache.metrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+ assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE),
+ cache.metrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getSwapRemovals());
+
+ assertEquals(0, cache.metrics().getSwapEntriesCount());
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testOffHeapAndSwapMetrics() throws Exception {
+ createCache(OFFHEAP_MAX_SIZE, true);
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.put(i, i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapGets());
+ assertEquals(0, cache.metrics().getOffHeapHits());
+ assertEquals(0f, cache.metrics().getOffHeapHitPercentage());
+ assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
+ assertEquals(100f, cache.metrics().getOffHeapMissPercentage());
+ assertEquals(0, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+
+ assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapGets());
+ assertEquals(0, cache.metrics().getSwapHits());
+ assertEquals(0f, cache.metrics().getSwapHitPercentage());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
+ assertEquals(100f, cache.metrics().getSwapMissPercentage());
+ assertEquals(0, cache.metrics().getSwapRemovals());
+
+ assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapEntriesCount());
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.get(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapGets());
+ assertEquals(0, cache.metrics().getOffHeapHits());
+ assertEquals(0.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
+ assertEquals(100.0, cache.metrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(0, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+
+ assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 2, cache.metrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapEntriesCount());
+
+ for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
+ cache.get(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapGets());
+ assertEquals(0, cache.metrics().getOffHeapHits());
+ assertEquals(0.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapMisses());
+ assertEquals(100.0, cache.metrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(0, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+
+ assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 3, cache.metrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
+ assertEquals(100 / 3.0, cache.metrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+ assertEquals(100 - (100 / 3.0), cache.metrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapEntriesCount());
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.remove(i);
+
+ printStat();
+
+ assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getOffHeapGets());
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapHits());
+ assertEquals(100 * OFFHEAP_MAX_CNT / (KEYS_CNT * 4.0 - MAX_SIZE),
+ cache.metrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE, cache.metrics().getOffHeapMisses());
+ assertEquals(100 * (KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
+ cache.metrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapRemovals());
+
+ assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
+ assertEquals(0, cache.metrics().getOffHeapEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+
+ assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapGets());
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapHits());
+ assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE - OFFHEAP_MAX_CNT) / (KEYS_CNT * 4.0 - MAX_SIZE - OFFHEAP_MAX_CNT),
+ cache.metrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+ assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE - OFFHEAP_MAX_CNT),
+ cache.metrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapRemovals());
+
+ assertEquals(0, cache.metrics().getSwapEntriesCount());
+ }
+
+ /**
+ * Prints stats.
+ */
+ protected void printStat() {
+ System.out.println("!!! -------------------------------------------------------");
+ System.out.println("!!! Puts: cache = " + cache.metrics().getCachePuts() +
+ ", offheap = " + cache.metrics().getOffHeapPuts() +
+ ", swap = " + cache.metrics().getSwapPuts());
+ System.out.println("!!! Gets: cache = " + cache.metrics().getCacheGets() +
+ ", offheap = " + cache.metrics().getOffHeapGets() +
+ ", swap = " + cache.metrics().getSwapGets());
+ System.out.println("!!! Removes: cache = " + cache.metrics().getCacheRemovals() +
+ ", offheap = " + cache.metrics().getOffHeapRemovals() +
+ ", swap = " + cache.metrics().getSwapRemovals());
+ System.out.println("!!! Evictions: cache = " + cache.metrics().getCacheEvictions() +
+ ", offheap = " + cache.metrics().getOffHeapEvictions() +
+ ", swap = none" );
+ System.out.println("!!! Hits: cache = " + cache.metrics().getCacheHits() +
+ ", offheap = " + cache.metrics().getOffHeapHits() +
+ ", swap = " + cache.metrics().getSwapHits());
+ System.out.println("!!! Hit(%): cache = " + cache.metrics().getCacheHitPercentage() +
+ ", offheap = " + cache.metrics().getOffHeapHitPercentage() +
+ ", swap = " + cache.metrics().getSwapHitPercentage());
+ System.out.println("!!! Misses: cache = " + cache.metrics().getCacheMisses() +
+ ", offheap = " + cache.metrics().getOffHeapMisses() +
+ ", swap = " + cache.metrics().getSwapMisses());
+ System.out.println("!!! Miss(%): cache = " + cache.metrics().getCacheMissPercentage() +
+ ", offheap = " + cache.metrics().getOffHeapMissPercentage() +
+ ", swap = " + cache.metrics().getSwapMissPercentage());
+ System.out.println("!!! Entries: cache = " + cache.metrics().getSize() +
+ ", offheap = " + cache.metrics().getOffHeapEntriesCount() +
+ ", swap = " + cache.metrics().getSwapEntriesCount());
+ System.out.println("!!! Size: cache = none" +
+ ", offheap = " + cache.metrics().getOffHeapAllocatedSize() +
+ ", swap = " + cache.metrics().getSwapSize());
+ System.out.println();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
index bc04f90..5867fb8 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
@@ -29,7 +29,7 @@ import org.apache.ignite.lang.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.plugin.security.*;
import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.swapspace.*;
+
import org.jetbrains.annotations.*;
import java.io.*;
@@ -447,28 +447,11 @@ public class GridSpiTestContext implements IgniteSpiContext {
}
/** {@inheritDoc} */
- @Override public void writeToSwap(String spaceName, Object key, @Nullable Object val,
- @Nullable ClassLoader ldr) {
- /* No-op. */
- }
-
- /** {@inheritDoc} */
- @Override public <T> T readFromSwap(String spaceName, SwapKey key, @Nullable ClassLoader ldr) {
- return null;
- }
-
- /** {@inheritDoc} */
@Override public int partition(String cacheName, Object key) {
return -1;
}
/** {@inheritDoc} */
- @Override public void removeFromSwap(String spaceName, Object key,
- @Nullable ClassLoader ldr) {
- // No-op.
- }
-
- /** {@inheritDoc} */
@Nullable @Override public IgniteNodeValidationResult validateNode(ClusterNode node) {
return null;
}
@@ -484,12 +467,6 @@ public class GridSpiTestContext implements IgniteSpiContext {
}
/** {@inheritDoc} */
- @Nullable @Override public <T> T readValueFromOffheapAndSwap(@Nullable String spaceName, Object key,
- @Nullable ClassLoader ldr) {
- return null;
- }
-
- /** {@inheritDoc} */
@Override public MessageFormatter messageFormatter() {
if (formatter == null) {
formatter = new MessageFormatter() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b445ac59/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMetricsSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMetricsSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMetricsSelfTestSuite.java
index 1adf55f..9a0e5fc 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMetricsSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMetricsSelfTestSuite.java
@@ -39,6 +39,7 @@ public class IgniteCacheMetricsSelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheReplicatedMetricsSelfTest.class);
suite.addTestSuite(GridCachePartitionedMetricsSelfTest.class);
suite.addTestSuite(GridCachePartitionedHitsAndMissesSelfTest.class);
+ suite.addTestSuite(CacheLocalOffHeapAndSwapMetricsSelfTest.class);
// Atomic cache.
suite.addTestSuite(GridCacheAtomicLocalMetricsSelfTest.class);
[46/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0bc36a97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0bc36a97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0bc36a97
Branch: refs/heads/ignite-37
Commit: 0bc36a975299dcdf56444590c8f4f106baf78bec
Parents: 4a23c2c 29bffe6
Author: null <null>
Authored: Thu May 21 13:56:59 2015 +0300
Committer: null <null>
Committed: Thu May 21 13:56:59 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/java/META-INF/LICENSE | 238 +++++++++++++++++++
modules/core/src/main/java/META-INF/NOTICE | 12 +
.../core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
parent/pom.xml | 1 -
pom.xml | 39 ++-
35 files changed, 309 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
[14/50] [abbrv] incubator-ignite git commit: #ignite-797: Remove
'groupLock' logic from cache code.
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
index 1ba4bfe..e71dd65 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
-import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -105,8 +104,6 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
* @param keyCnt Number of keys.
* @param txSize Expected transaction size.
* @param syncCommit Synchronous commit flag.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
- * @param partLock If partition is locked.
* @param subjId Subject ID.
* @param taskNameHash Task name hash code.
* @param accessTtl TTL for read operation.
@@ -130,8 +127,6 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
int keyCnt,
int txSize,
boolean syncCommit,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock,
@Nullable UUID subjId,
int taskNameHash,
long accessTtl,
@@ -151,8 +146,6 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
timeout,
keyCnt,
txSize,
- grpLockKey,
- partLock,
skipStore);
assert topVer.compareTo(AffinityTopologyVersion.ZERO) > 0;
@@ -356,79 +349,79 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
}
switch (writer.state()) {
- case 23:
+ case 21:
if (!writer.writeLong("accessTtl", accessTtl))
return false;
writer.incrementState();
- case 24:
+ case 22:
if (!writer.writeObjectArray("dhtVers", dhtVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 25:
+ case 23:
if (!writer.writeObjectArray("filter", filter, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 26:
+ case 24:
if (!writer.writeBoolean("hasTransforms", hasTransforms))
return false;
writer.incrementState();
- case 27:
+ case 25:
if (!writer.writeBoolean("implicitSingleTx", implicitSingleTx))
return false;
writer.incrementState();
- case 28:
+ case 26:
if (!writer.writeBoolean("implicitTx", implicitTx))
return false;
writer.incrementState();
- case 29:
+ case 27:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 30:
+ case 28:
if (!writer.writeBoolean("onePhaseCommit", onePhaseCommit))
return false;
writer.incrementState();
- case 31:
+ case 29:
if (!writer.writeBoolean("retVal", retVal))
return false;
writer.incrementState();
- case 32:
+ case 30:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 33:
+ case 31:
if (!writer.writeBoolean("syncCommit", syncCommit))
return false;
writer.incrementState();
- case 34:
+ case 32:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 35:
+ case 33:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -450,7 +443,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
return false;
switch (reader.state()) {
- case 23:
+ case 21:
accessTtl = reader.readLong("accessTtl");
if (!reader.isLastRead())
@@ -458,7 +451,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 24:
+ case 22:
dhtVers = reader.readObjectArray("dhtVers", MessageCollectionItemType.MSG, GridCacheVersion.class);
if (!reader.isLastRead())
@@ -466,7 +459,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 25:
+ case 23:
filter = reader.readObjectArray("filter", MessageCollectionItemType.MSG, CacheEntryPredicate.class);
if (!reader.isLastRead())
@@ -474,7 +467,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 26:
+ case 24:
hasTransforms = reader.readBoolean("hasTransforms");
if (!reader.isLastRead())
@@ -482,7 +475,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 27:
+ case 25:
implicitSingleTx = reader.readBoolean("implicitSingleTx");
if (!reader.isLastRead())
@@ -490,7 +483,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 28:
+ case 26:
implicitTx = reader.readBoolean("implicitTx");
if (!reader.isLastRead())
@@ -498,7 +491,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 29:
+ case 27:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -506,7 +499,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 30:
+ case 28:
onePhaseCommit = reader.readBoolean("onePhaseCommit");
if (!reader.isLastRead())
@@ -514,7 +507,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 31:
+ case 29:
retVal = reader.readBoolean("retVal");
if (!reader.isLastRead())
@@ -522,7 +515,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 32:
+ case 30:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -530,7 +523,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 33:
+ case 31:
syncCommit = reader.readBoolean("syncCommit");
if (!reader.isLastRead())
@@ -538,7 +531,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 34:
+ case 32:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -546,7 +539,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 35:
+ case 33:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -566,7 +559,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 36;
+ return 34;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 51c7ccd..4f74303 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -493,8 +493,6 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd
tx,
tx.optimistic() && tx.serializable() ? m.reads() : null,
m.writes(),
- tx.groupLockKey(),
- tx.partitionLock(),
m.near(),
txMapping.transactionNodes(),
m.last(),
@@ -548,9 +546,6 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd
});
}
else {
- assert !tx.groupLock() : "Got group lock transaction that is mapped on remote node [tx=" + tx +
- ", nodeId=" + n.id() + ']';
-
try {
cctx.io().send(n, req, tx.ioPolicy());
}
@@ -590,10 +585,6 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd
", primary=" + U.toShortString(primary) + ", topVer=" + topVer + ']');
}
- if (tx.groupLock() && !primary.isLocal())
- throw new IgniteCheckedException("Failed to prepare group lock transaction (local node is not primary for " +
- " key)[key=" + entry.key() + ", primaryNodeId=" + primary.id() + ']');
-
// Must re-initialize cached entry while holding topology lock.
if (cacheCtx.isNear())
entry.cached(cacheCtx.nearTx().entryExx(entry.key(), topVer));
@@ -603,10 +594,8 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd
entry.cached(cacheCtx.local().entryEx(entry.key(), topVer));
if (cacheCtx.isNear() || cacheCtx.isLocal()) {
- if (waitLock && entry.explicitVersion() == null) {
- if (!tx.groupLock() || tx.groupLockKey().equals(entry.txKey()))
- lockKeys.add(entry.txKey());
- }
+ if (waitLock && entry.explicitVersion() == null)
+ lockKeys.add(entry.txKey());
}
if (cur == null || !cur.node().id().equals(primary.id()) || cur.near() != cacheCtx.isNear()) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index 998df9e..bce62c1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -178,8 +178,6 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
tx,
m.reads(),
m.writes(),
- /*grp lock key*/null,
- /*part lock*/false,
m.near(),
txMapping.transactionNodes(),
true,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index 581c7e0..df7a65f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -301,14 +301,10 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
req.isInvalidate(),
req.timeout(),
req.txSize(),
- req.groupLockKey(),
req.subjectId(),
req.taskNameHash()
);
- if (req.groupLock())
- tx.groupLockKey(txKey);
-
tx = ctx.tm().onCreated(null, tx);
if (tx == null || !ctx.tm().onStarted(tx))
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
index 7b0b811..b44f821 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
@@ -97,7 +97,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
@Nullable UUID subjId,
int taskNameHash) {
super(xidVer, futId, null, threadId, commit, invalidate, sys, plc, syncCommit, syncRollback, baseVer,
- committedVers, rolledbackVers, txSize, null);
+ committedVers, rolledbackVers, txSize);
this.explicitLock = explicitLock;
this.storeEnabled = storeEnabled;
@@ -170,37 +170,37 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
}
switch (writer.state()) {
- case 20:
+ case 19:
if (!writer.writeBoolean("explicitLock", explicitLock))
return false;
writer.incrementState();
- case 21:
+ case 20:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeBoolean("storeEnabled", storeEnabled))
return false;
writer.incrementState();
- case 23:
+ case 22:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 25:
+ case 24:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -222,7 +222,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
return false;
switch (reader.state()) {
- case 20:
+ case 19:
explicitLock = reader.readBoolean("explicitLock");
if (!reader.isLastRead())
@@ -230,7 +230,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 21:
+ case 20:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -238,7 +238,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 22:
+ case 21:
storeEnabled = reader.readBoolean("storeEnabled");
if (!reader.isLastRead())
@@ -246,7 +246,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 23:
+ case 22:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -254,7 +254,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 24:
+ case 23:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -262,7 +262,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 25:
+ case 24:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -282,7 +282,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 26;
+ return 25;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index 50d3f3e..5c426ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -102,8 +102,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
* @param timeout Timeout.
* @param storeEnabled Store enabled flag.
* @param txSize Transaction size.
- * @param grpLockKey Group lock key if this is a group lock transaction.
- * @param partLock {@code True} if this is a group-lock transaction and the whole partition should be locked.
* @param subjId Subject ID.
* @param taskNameHash Task name hash code.
*/
@@ -118,8 +116,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
long timeout,
boolean storeEnabled,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock,
@Nullable UUID subjId,
int taskNameHash
) {
@@ -137,8 +133,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
false,
storeEnabled,
txSize,
- grpLockKey,
- partLock,
subjId,
taskNameHash);
@@ -272,9 +266,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
/** {@inheritDoc} */
@Override public Collection<IgniteTxEntry> optimisticLockEntries() {
- if (groupLock())
- return super.optimisticLockEntries();
-
return optimisticLockEntries;
}
@@ -416,13 +407,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
}
}
- /** {@inheritDoc} */
- @Override protected void addGroupTxMapping(Collection<IgniteTxKey> keys) {
- super.addGroupTxMapping(keys);
-
- addKeyMapping(cctx.localNode(), keys);
- }
-
/**
* Adds key mapping to dht mapping.
*
@@ -562,9 +546,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
Collection<GridCacheVersion> committedVers,
Collection<GridCacheVersion> rolledbackVers)
{
- Collection<IgniteTxEntry> entries = groupLock() ?
- Collections.singletonList(groupLockEntry()) :
- F.concat(false, mapping.reads(), mapping.writes());
+ Collection<IgniteTxEntry> entries = F.concat(false, mapping.reads(), mapping.writes());
for (IgniteTxEntry txEntry : entries) {
while (true) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index f0587ac..a08637d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
@@ -88,8 +88,6 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
* @param tx Transaction.
* @param reads Read entries.
* @param writes Write entries.
- * @param grpLockKey Group lock key if preparing group-lock transaction.
- * @param partLock {@code True} if preparing group-lock transaction with partition lock.
* @param near {@code True} if mapping is for near caches.
* @param txNodes Transaction nodes mapping.
* @param last {@code True} if this last prepare request for node.
@@ -103,8 +101,6 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
IgniteInternalTx tx,
Collection<IgniteTxEntry> reads,
Collection<IgniteTxEntry> writes,
- IgniteTxKey grpLockKey,
- boolean partLock,
boolean near,
Map<UUID, Collection<UUID>> txNodes,
boolean last,
@@ -116,7 +112,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
@Nullable UUID subjId,
int taskNameHash
) {
- super(tx, reads, writes, grpLockKey, partLock, txNodes, onePhaseCommit);
+ super(tx, reads, writes, txNodes, onePhaseCommit);
assert futId != null;
@@ -270,67 +266,67 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
}
switch (writer.state()) {
- case 25:
+ case 23:
if (!writer.writeBoolean("explicitLock", explicitLock))
return false;
writer.incrementState();
- case 26:
+ case 24:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 27:
+ case 25:
if (!writer.writeBoolean("implicitSingle", implicitSingle))
return false;
writer.incrementState();
- case 28:
+ case 26:
if (!writer.writeBoolean("last", last))
return false;
writer.incrementState();
- case 29:
+ case 27:
if (!writer.writeCollection("lastBackups", lastBackups, MessageCollectionItemType.UUID))
return false;
writer.incrementState();
- case 30:
+ case 28:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 31:
+ case 29:
if (!writer.writeBoolean("near", near))
return false;
writer.incrementState();
- case 32:
+ case 30:
if (!writer.writeBoolean("retVal", retVal))
return false;
writer.incrementState();
- case 33:
+ case 31:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 34:
+ case 32:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 35:
+ case 33:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -352,7 +348,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
return false;
switch (reader.state()) {
- case 25:
+ case 23:
explicitLock = reader.readBoolean("explicitLock");
if (!reader.isLastRead())
@@ -360,7 +356,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 26:
+ case 24:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -368,7 +364,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 27:
+ case 25:
implicitSingle = reader.readBoolean("implicitSingle");
if (!reader.isLastRead())
@@ -376,7 +372,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 28:
+ case 26:
last = reader.readBoolean("last");
if (!reader.isLastRead())
@@ -384,7 +380,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 29:
+ case 27:
lastBackups = reader.readCollection("lastBackups", MessageCollectionItemType.UUID);
if (!reader.isLastRead())
@@ -392,7 +388,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 30:
+ case 28:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -400,7 +396,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 31:
+ case 29:
near = reader.readBoolean("near");
if (!reader.isLastRead())
@@ -408,7 +404,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 32:
+ case 30:
retVal = reader.readBoolean("retVal");
if (!reader.isLastRead())
@@ -416,7 +412,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 33:
+ case 31:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -424,7 +420,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 34:
+ case 32:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -432,7 +428,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 35:
+ case 33:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -452,7 +448,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 36;
+ return 34;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
index b6b6017..49283cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
@@ -51,9 +51,6 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
/** Owned versions. */
private Map<IgniteTxKey, GridCacheVersion> owned;
- /** Group lock flag. */
- private boolean grpLock;
-
/**
* Empty constructor required for {@link Externalizable}.
*/
@@ -78,7 +75,6 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
* @param writeEntries Write entries.
* @param ctx Cache registry.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
* @throws IgniteCheckedException If unmarshalling failed.
*/
public GridNearTxRemote(
@@ -97,12 +93,11 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
long timeout,
Collection<IgniteTxEntry> writeEntries,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
@Nullable UUID subjId,
int taskNameHash
) throws IgniteCheckedException {
super(ctx, nodeId, rmtThreadId, xidVer, commitVer, sys, plc, concurrency, isolation, invalidate, timeout,
- txSize, grpLockKey, subjId, taskNameHash);
+ txSize, subjId, taskNameHash);
assert nearNodeId != null;
@@ -138,7 +133,6 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
* @param timeout Timeout.
* @param ctx Cache registry.
* @param txSize Expected transaction size.
- * @param grpLockKey Collection of group lock keys if this is a group-lock transaction.
*/
public GridNearTxRemote(
GridCacheSharedContext ctx,
@@ -155,12 +149,11 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
boolean invalidate,
long timeout,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
@Nullable UUID subjId,
int taskNameHash
) {
super(ctx, nodeId, rmtThreadId, xidVer, commitVer, sys, plc, concurrency, isolation, invalidate, timeout,
- txSize, grpLockKey, subjId, taskNameHash);
+ txSize, subjId, taskNameHash);
assert nearNodeId != null;
@@ -192,19 +185,6 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
}
/**
- * Marks near local transaction as group lock. Note that near remote transaction may be
- * marked as group lock even if it does not contain any locked key.
- */
- public void markGroupLock() {
- grpLock = true;
- }
-
- /** {@inheritDoc} */
- @Override public boolean groupLock() {
- return grpLock || super.groupLock();
- }
-
- /**
* @return Near transaction ID.
*/
@Override public GridCacheVersion nearXidVersion() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
index 2bed843..5f877ec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
@@ -284,16 +284,6 @@ public interface IgniteInternalTx extends AutoCloseable, GridTimeoutObject {
public boolean empty();
/**
- * @return {@code True} if transaction group-locked.
- */
- public boolean groupLock();
-
- /**
- * @return Group lock key if {@link #groupLock()} is {@code true}.
- */
- @Nullable public IgniteTxKey groupLockKey();
-
- /**
* @return {@code True} if preparing flag was set with this call.
*/
public boolean markPreparing();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
index 044c3d7..99907e4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
@@ -160,9 +160,7 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactionsEx {
isolation,
timeout,
true,
- txSize,
- /** group lock keys */null,
- /** partition lock */false
+ txSize
);
assert tx != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 64cc77f..eb8825e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -179,9 +179,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
/** */
protected int txSize;
- /** Group lock key, if any. */
- protected IgniteTxKey grpLockKey;
-
/** */
@GridToStringExclude
private AtomicReference<GridFutureAdapter<IgniteInternalTx>> finFut = new AtomicReference<>();
@@ -233,7 +230,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
* @param isolation Isolation.
* @param timeout Timeout.
* @param txSize Transaction size.
- * @param grpLockKey Group lock key if this is group-lock transaction.
*/
protected IgniteTxAdapter(
GridCacheSharedContext<?, ?> cctx,
@@ -249,7 +245,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
boolean invalidate,
boolean storeEnabled,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
@Nullable UUID subjId,
int taskNameHash
) {
@@ -269,7 +264,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
this.invalidate = invalidate;
this.storeEnabled = storeEnabled;
this.txSize = txSize;
- this.grpLockKey = grpLockKey;
this.subjId = subjId;
this.taskNameHash = taskNameHash;
@@ -294,7 +288,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
* @param isolation Isolation.
* @param timeout Timeout.
* @param txSize Transaction size.
- * @param grpLockKey Group lock key if this is group-lock transaction.
*/
protected IgniteTxAdapter(
GridCacheSharedContext<?, ?> cctx,
@@ -308,7 +301,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
TransactionIsolation isolation,
long timeout,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
@Nullable UUID subjId,
int taskNameHash
) {
@@ -323,7 +315,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
this.isolation = isolation;
this.timeout = timeout;
this.txSize = txSize;
- this.grpLockKey = grpLockKey;
this.subjId = subjId;
this.taskNameHash = taskNameHash;
@@ -387,30 +378,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
/** {@inheritDoc} */
@Override public Collection<IgniteTxEntry> optimisticLockEntries() {
- if (!groupLock())
- return writeEntries();
- else {
- if (!F.isEmpty(invalidParts)) {
- assert invalidParts.size() == 1 : "Only one partition expected for group lock transaction " +
- "[tx=" + this + ", invalidParts=" + invalidParts + ']';
- assert groupLockEntry() == null : "Group lock key should be rejected " +
- "[tx=" + this + ", groupLockEntry=" + groupLockEntry() + ']';
- assert F.isEmpty(writeMap()) : "All entries should be rejected for group lock transaction " +
- "[tx=" + this + ", writes=" + writeMap() + ']';
-
- return Collections.emptyList();
- }
-
- IgniteTxEntry grpLockEntry = groupLockEntry();
-
- assert grpLockEntry != null || (near() && !local()):
- "Group lock entry was not enlisted into transaction [tx=" + this +
- ", grpLockKey=" + groupLockKey() + ']';
-
- return grpLockEntry == null ?
- Collections.<IgniteTxEntry>emptyList() :
- Collections.singletonList(grpLockEntry);
- }
+ return writeEntries();
}
/** {@inheritDoc} */
@@ -482,16 +450,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
cctx.tm().uncommitTx(this);
}
- /**
- * This method uses unchecked assignment to cast group lock key entry to transaction generic signature.
- *
- * @return Group lock tx entry.
- */
- @SuppressWarnings("unchecked")
- public IgniteTxEntry groupLockEntry() {
- return this.entry(groupLockKey());
- }
-
/** {@inheritDoc} */
@Override public UUID otherNodeId() {
return null;
@@ -603,16 +561,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
public abstract boolean isStarted();
/** {@inheritDoc} */
- @Override public boolean groupLock() {
- return grpLockKey != null;
- }
-
- /** {@inheritDoc} */
- @Override public IgniteTxKey groupLockKey() {
- return grpLockKey;
- }
-
- /** {@inheritDoc} */
@Override public int size() {
return txSize;
}
@@ -798,9 +746,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
GridCacheVersion explicit = txEntry == null ? null : txEntry.explicitVersion();
- assert !txEntry.groupLockEntry() || groupLock() : "Can not have group-locked tx entries in " +
- "non-group-lock transactions [txEntry=" + txEntry + ", tx=" + this + ']';
-
return local() && !cacheCtx.isDht() ?
entry.lockedByThread(threadId()) || (explicit != null && entry.lockedBy(explicit)) :
// If candidate is not there, then lock was explicit.
@@ -817,9 +762,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
GridCacheVersion explicit = txEntry == null ? null : txEntry.explicitVersion();
- assert !txEntry.groupLockEntry() || groupLock() : "Can not have group-locked tx entries in " +
- "non-group-lock transactions [txEntry=" + txEntry + ", tx=" + this + ']';
-
return local() && !cacheCtx.isDht() ?
entry.lockedByThreadUnsafe(threadId()) || (explicit != null && entry.lockedByUnsafe(explicit)) :
// If candidate is not there, then lock was explicit.
@@ -1554,7 +1496,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
/** {@inheritDoc} */
@Override public String toString() {
return GridToStringBuilder.toString(IgniteTxAdapter.class, this,
- "duration", (U.currentTimeMillis() - startTime) + "ms", "grpLock", groupLock(),
+ "duration", (U.currentTimeMillis() - startTime) + "ms",
"onePhaseCommit", onePhaseCommit);
}
@@ -1779,16 +1721,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
}
/** {@inheritDoc} */
- @Override public boolean groupLock() {
- return false;
- }
-
- /** {@inheritDoc} */
- @Nullable @Override public IgniteTxKey groupLockKey() {
- throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
- }
-
- /** {@inheritDoc} */
@Override public boolean markPreparing() {
throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 0d7aeaf..247d350 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -137,9 +137,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
@GridDirectTransient
private boolean locMapped;
- /** Group lock entry flag. */
- private boolean grpLock;
-
/** Expiry policy. */
@GridDirectTransient
private ExpiryPolicy expiryPlc;
@@ -277,22 +274,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
}
/**
- * @return {@code True} if this entry was added in group lock transaction and
- * this is not a group lock entry.
- */
- public boolean groupLockEntry() {
- return grpLock;
- }
-
- /**
- * @param grpLock {@code True} if this entry was added in group lock transaction and
- * this is not a group lock entry.
- */
- public void groupLockEntry(boolean grpLock) {
- this.grpLock = grpLock;
- }
-
- /**
* @param ctx Context.
* @return Clean copy of this entry.
*/
@@ -311,7 +292,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
cp.ttl = ttl;
cp.conflictExpireTime = conflictExpireTime;
cp.explicitVer = explicitVer;
- cp.grpLock = grpLock;
cp.conflictVer = conflictVer;
cp.expiryPlc = expiryPlc;
cp.flags = flags;
@@ -851,30 +831,24 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
writer.incrementState();
case 7:
- if (!writer.writeBoolean("grpLock", grpLock))
- return false;
-
- writer.incrementState();
-
- case 8:
if (!writer.writeMessage("key", key))
return false;
writer.incrementState();
- case 9:
+ case 8:
if (!writer.writeByteArray("transformClosBytes", transformClosBytes))
return false;
writer.incrementState();
- case 10:
+ case 9:
if (!writer.writeLong("ttl", ttl))
return false;
writer.incrementState();
- case 11:
+ case 10:
if (!writer.writeMessage("val", val))
return false;
@@ -950,14 +924,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
reader.incrementState();
case 7:
- grpLock = reader.readBoolean("grpLock");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 8:
key = reader.readMessage("key");
if (!reader.isLastRead())
@@ -965,7 +931,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
reader.incrementState();
- case 9:
+ case 8:
transformClosBytes = reader.readByteArray("transformClosBytes");
if (!reader.isLastRead())
@@ -973,7 +939,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
reader.incrementState();
- case 10:
+ case 9:
ttl = reader.readLong("ttl");
if (!reader.isLastRead())
@@ -981,7 +947,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
reader.incrementState();
- case 11:
+ case 10:
val = reader.readMessage("val");
if (!reader.isLastRead())
@@ -1001,7 +967,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 12;
+ return 11;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 826f392..f466bf2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -271,8 +271,6 @@ public class IgniteTxHandler {
req.isInvalidate(),
false,
req.txSize(),
- req.groupLockKey(),
- req.partitionLock(),
req.transactionNodes(),
req.subjectId(),
req.taskNameHash()
@@ -554,8 +552,6 @@ public class IgniteTxHandler {
req.isInvalidate(),
req.storeEnabled(),
req.txSize(),
- req.groupLockKey(),
- false,
null,
req.subjectId(),
req.taskNameHash()));
@@ -1002,7 +998,6 @@ public class IgniteTxHandler {
req.isInvalidate(),
req.timeout(),
req.writes() != null ? Math.max(req.writes().size(), req.txSize()) : req.txSize(),
- req.groupLockKey(),
req.nearXidVersion(),
req.transactionNodes(),
req.subjectId(),
@@ -1136,7 +1131,6 @@ public class IgniteTxHandler {
req.timeout(),
req.nearWrites(),
req.txSize(),
- req.groupLockKey(),
req.subjectId(),
req.taskNameHash()
);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 7e9095c..609108f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -86,9 +86,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
/** Base for completed versions. */
private GridCacheVersion completedBase;
- /** Flag indicating partition lock in group lock transaction. */
- private boolean partLock;
-
/** Flag indicating that transformed values should be sent to remote nodes. */
private boolean sndTransformedVals;
@@ -123,8 +120,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
* @param isolation Isolation.
* @param timeout Timeout.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
- * @param partLock {@code True} if this is a group-lock transaction and lock is acquired for whole partition.
*/
protected IgniteTxLocalAdapter(
GridCacheSharedContext cctx,
@@ -139,17 +134,11 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
boolean invalidate,
boolean storeEnabled,
int txSize,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock,
@Nullable UUID subjId,
int taskNameHash
) {
super(cctx, xidVer, implicit, implicitSingle, /*local*/true, sys, plc, concurrency, isolation, timeout,
- invalidate, storeEnabled, txSize, grpLockKey, subjId, taskNameHash);
-
- assert !partLock || grpLockKey != null;
-
- this.partLock = partLock;
+ invalidate, storeEnabled, txSize, subjId, taskNameHash);
minVer = xidVer;
}
@@ -182,11 +171,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
}
/** {@inheritDoc} */
- @Override public boolean partitionLock() {
- return partLock;
- }
-
- /** {@inheritDoc} */
@Override public Throwable commitError() {
return commitErr.get();
}
@@ -499,7 +483,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
CacheStoreManager store = store();
if (store != null && store.isWriteThrough() && storeEnabled() &&
- (!internal() || groupLock()) && (near() || store.isWriteToStoreFromDht())) {
+ !internal() && (near() || store.isWriteToStoreFromDht())) {
try {
if (writeEntries != null) {
Map<Object, IgniteBiTuple<Object, GridCacheVersion>> putMap = null;
@@ -679,9 +663,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
if (!empty || colocated())
cctx.tm().addCommittedTx(this);
- if (groupLock())
- addGroupTxMapping(writeSet());
-
if (!empty) {
batchStoreCommit(writeMap().values());
@@ -909,10 +890,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
log.debug("Ignoring READ entry when committing: " + txEntry);
}
else {
- assert !groupLock() || txEntry.groupLockEntry() || ownsLock(txEntry.cached()):
- "Transaction does not own lock for group lock entry during commit [tx=" +
- this + ", txEntry=" + txEntry + ']';
-
if (conflictCtx == null || !conflictCtx.isUseOld()) {
if (txEntry.ttl() != CU.TTL_NOT_CHANGED)
cached.updateTtl(null, txEntry.ttl());
@@ -927,7 +904,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
// we are not changing obsolete entries.
// (innerSet and innerRemove will throw an exception
// if an entry is obsolete).
- if (txEntry.op() != READ && !txEntry.groupLockEntry())
+ if (txEntry.op() != READ)
checkCommitLocks(cached);
// Break out of while loop.
@@ -996,7 +973,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
else {
CacheStoreManager store = store();
- if (store != null && (!internal() || groupLock())) {
+ if (store != null && !internal()) {
try {
store.sessionEnd(this, true);
}
@@ -1102,7 +1079,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
CacheStoreManager store = store();
if (store != null && (near() || store.isWriteToStoreFromDht())) {
- if (!internal() || groupLock())
+ if (!internal())
store.sessionEnd(this, false);
}
}
@@ -1152,8 +1129,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
cacheCtx.checkSecurity(SecurityPermission.CACHE_READ);
- groupLockSanityCheck(cacheCtx, keys);
-
boolean single = keysCnt == 1;
Collection<KeyCacheObject> lockKeys = null;
@@ -1185,7 +1160,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
cacheCtx.addResult(map, key, val, skipVals, keepCacheObjects, deserializePortable, false);
}
else {
- assert txEntry.op() == TRANSFORM || (groupLock() && !txEntry.groupLockEntry());
+ assert txEntry.op() == TRANSFORM;
while (true) {
try {
@@ -1263,7 +1238,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
CacheObject val = null;
- if (!pessimistic() || readCommitted() || groupLock() && !skipVals) {
+ if (!pessimistic() || readCommitted() && !skipVals) {
IgniteCacheExpiryPolicy accessPlc =
optimistic() ? accessPolicy(cacheCtx, txKey, expiryPlc) : null;
@@ -1311,8 +1286,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
null,
skipStore);
- if (groupLock())
- txEntry.groupLockEntry(true);
// As optimization, mark as checked immediately
// for non-pessimistic if value is not null.
@@ -1527,7 +1500,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
nextVer = cctx.versions().next(topologyVersion());
while (true) {
- assert txEntry != null || readCommitted() || groupLock() || skipVals;
+ assert txEntry != null || readCommitted() || skipVals;
GridCacheEntryEx e = txEntry == null ? entryEx(cacheCtx, txKey) : txEntry.cached();
@@ -1544,8 +1517,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
log.debug("Got removed entry in transaction getAll method " +
"(will try again): " + e);
- if (pessimistic() && !readCommitted() && !isRollbackOnly() &&
- (!groupLock() || F.eq(e.key(), groupLockKey()))) {
+ if (pessimistic() && !readCommitted() && !isRollbackOnly()) {
U.error(log, "Inconsistent transaction state (entry got removed while " +
"holding lock) [entry=" + e + ", tx=" + IgniteTxLocalAdapter.this + "]");
@@ -1563,7 +1535,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
// In pessimistic mode, we should always be able to set.
assert set || !pessimistic();
- if (readCommitted() || groupLock() || skipVals) {
+ if (readCommitted() || skipVals) {
cacheCtx.evicts().touch(e, topologyVersion());
if (visibleVal != null) {
@@ -1654,7 +1626,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
return new GridFinishedFuture<>(retMap);
// Handle locks.
- if (pessimistic() && !readCommitted() && !groupLock() && !skipVals) {
+ if (pessimistic() && !readCommitted() && !skipVals) {
if (expiryPlc == null)
expiryPlc = cacheCtx.expiry();
@@ -1811,7 +1783,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
}
}
else {
- assert optimistic() || readCommitted() || groupLock() || skipVals;
+ assert optimistic() || readCommitted() || skipVals;
final Collection<KeyCacheObject> redos = new ArrayList<>();
@@ -2036,8 +2008,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
if (invokeMap != null)
transform = true;
- groupLockSanityCheck(cacheCtx, keys);
-
for (Object key : keys) {
if (key == null) {
rollback();
@@ -2194,12 +2164,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
if (!implicit() && readCommitted() && !cacheCtx.offheapTiered())
cacheCtx.evicts().touch(entry, topologyVersion());
- if (groupLock() && !lockOnly)
- txEntry.groupLockEntry(true);
-
enlisted.add(cacheKey);
- if ((!pessimistic() && !implicit()) || (groupLock() && !lockOnly)) {
+ if (!pessimistic() && !implicit()) {
txEntry.markValid();
if (old == null) {
@@ -2644,7 +2611,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
null,
opCtx != null && opCtx.skipStore());
- if (pessimistic() && !groupLock()) {
+ if (pessimistic()) {
// Loose all skipped.
final Set<KeyCacheObject> loaded = loadFut.get();
@@ -2867,7 +2834,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
// Acquire locks only after having added operation to the write set.
// Otherwise, during rollback we will not know whether locks need
// to be rolled back.
- if (pessimistic() && !groupLock()) {
+ if (pessimistic()) {
// Loose all skipped.
final Collection<KeyCacheObject> passedKeys = F.view(enlisted, F0.notIn(loadFut.get()));
@@ -2985,108 +2952,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
}
/**
- * Adds key mapping to transaction.
- * @param keys Keys to add.
- */
- protected void addGroupTxMapping(Collection<IgniteTxKey> keys) {
- // No-op. This method is overriden in transactions that store key to remote node mapping
- // for commit.
- }
-
- /**
- * Checks that affinity keys are enlisted in group transaction on start.
- *
- * @param cacheCtx Cache context.
- * @param keys Keys to check.
- * @throws IgniteCheckedException If sanity check failed.
- */
- private <K> void groupLockSanityCheck(GridCacheContext cacheCtx, Iterable<? extends K> keys)
- throws IgniteCheckedException
- {
- if (groupLock() && cctx.kernalContext().config().isCacheSanityCheckEnabled()) {
- // Note that affinity is called without mapper on purpose.
- int affinityPart = cacheCtx.config().getAffinity().partition(grpLockKey.key());
-
- for (K key : keys) {
- if (partitionLock()) {
- int part = cacheCtx.affinity().partition(key);
-
- if (affinityPart != part)
- throw new IgniteCheckedException("Failed to enlist key into group-lock transaction (given " +
- "key does not belong to locked partition) [key=" + key + ", affinityPart=" + affinityPart +
- ", part=" + part + ", groupLockKey=" + grpLockKey + ']');
- }
- else {
- KeyCacheObject cacheKey =
- cacheCtx.toCacheKeyObject(cacheCtx.config().getAffinityMapper().affinityKey(key));
-
- IgniteTxKey affinityKey = cacheCtx.txKey(cacheKey);
-
- if (!grpLockKey.equals(affinityKey))
- throw new IgniteCheckedException("Failed to enlist key into group-lock transaction (affinity key was " +
- "not enlisted to transaction on start) [key=" + key + ", affinityKey=" + affinityKey +
- ", groupLockKey=" + grpLockKey + ']');
- }
- }
- }
- }
-
- /**
- * Performs keys locking for affinity-based group lock transactions.
- * @return Lock future.
- */
- @Override public <K> IgniteInternalFuture<?> groupLockAsync(GridCacheContext cacheCtx, Collection<K> keys) {
- assert groupLock();
-
- try {
- init();
-
- GridCacheReturn ret = new GridCacheReturn(localResult(), false);
-
- Collection<KeyCacheObject> enlisted = new ArrayList<>();
-
- Set<KeyCacheObject> skipped = enlistWrite(
- cacheCtx,
- keys,
- /** cached entry */null,
- /** expiry - leave unchanged */null,
- /** implicit */false,
- /** lookup map */null,
- /** invoke map */null,
- /** invoke arguments */null,
- /** retval */false,
- /** lock only */true,
- CU.empty0(),
- ret,
- enlisted,
- null,
- null,
- cacheCtx.skipStore()
- ).get();
-
- // No keys should be skipped with empty filter.
- assert F.isEmpty(skipped);
-
- // Lock group key in pessimistic mode only.
- return pessimistic() ?
- cacheCtx.cache().txLockAsync(enlisted,
- lockTimeout(),
- this,
- false,
- false,
- isolation,
- isInvalidate(),
- -1L) :
- new GridFinishedFuture<>();
- }
- catch (IgniteCheckedException e) {
- setRollbackOnly();
-
- return new GridFinishedFuture<Object>(e);
- }
- }
-
- /**
* Initializes read map.
*
* @return {@code True} if transaction was successfully started.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
index 61041e1..14562ab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
@@ -58,14 +58,9 @@ public interface IgniteTxLocalEx extends IgniteInternalTx {
public void userRollback() throws IgniteCheckedException;
/**
- * @return Group lock entry if this is a group-lock transaction.
- */
- @Nullable public IgniteTxEntry groupLockEntry();
-
- /**
* @param cacheCtx Cache context.
* @param keys Keys to get.
- * @param cached Cached entry if this method is called from entry wrapper.
+ * @param cached Cached entry if this method is called from entry wrapper
* Cached entry is passed if and only if there is only one key in collection of keys.
* @param deserializePortable Deserialize portable flag.
* @param skipVals Skip values flag.
@@ -144,20 +139,6 @@ public interface IgniteTxLocalEx extends IgniteInternalTx {
Map<KeyCacheObject, GridCacheVersion> drMap);
/**
- * Performs keys locking for affinity-based group lock transactions.
- *
- * @param cacheCtx Cache context.
- * @param keys Keys to lock.
- * @return Lock future.
- */
- public <K> IgniteInternalFuture<?> groupLockAsync(GridCacheContext cacheCtx, Collection<K> keys);
-
- /**
- * @return {@code True} if keys from the same partition are allowed to be enlisted in group-lock transaction.
- */
- public boolean partitionLock();
-
- /**
* @return Return value for
*/
public GridCacheReturn implicitSingleResult();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 2122602..8e95a5d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -347,8 +347,6 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
* @param isolation Isolation.
* @param timeout transaction timeout.
* @param txSize Expected transaction size.
- * @param grpLockKey Group lock key if this is a group-lock transaction.
- * @param partLock {@code True} if partition is locked.
* @return New transaction.
*/
public IgniteTxLocalAdapter newTx(
@@ -359,9 +357,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
TransactionIsolation isolation,
long timeout,
boolean storeEnabled,
- int txSize,
- @Nullable IgniteTxKey grpLockKey,
- boolean partLock) {
+ int txSize) {
assert sysCacheCtx == null || sysCacheCtx.systemTx();
UUID subjId = null; // TODO GG-9141 how to get subj ID?
@@ -379,8 +375,6 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
timeout,
storeEnabled,
txSize,
- grpLockKey,
- partLock,
subjId,
taskNameHash);
@@ -1207,13 +1201,10 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
cctx.kernalContext().dataStructures().onTxCommitted(tx);
// 4. Unlock write resources.
- if (tx.groupLock())
- unlockGroupLocks(tx);
- else
- unlockMultiple(tx, tx.writeEntries());
+ unlockMultiple(tx, tx.writeEntries());
// 5. For pessimistic transaction, unlock read resources if required.
- if (tx.pessimistic() && !tx.readCommitted() && !tx.groupLock())
+ if (tx.pessimistic() && !tx.readCommitted())
unlockMultiple(tx, tx.readEntries());
// 6. Notify evictions.
@@ -1441,7 +1432,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
* @param tx Transaction to notify evictions for.
*/
private void notifyEvitions(IgniteInternalTx tx) {
- if (tx.internal() && !tx.groupLock())
+ if (tx.internal())
return;
for (IgniteTxEntry txEntry : tx.allEntries())
@@ -1617,51 +1608,6 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
}
/**
- * Unlocks entries locked by group transaction.
- *
- * @param txx Transaction.
- */
- @SuppressWarnings("unchecked")
- private void unlockGroupLocks(IgniteInternalTx txx) {
- IgniteTxKey grpLockKey = txx.groupLockKey();
-
- assert grpLockKey != null;
-
- if (grpLockKey == null)
- return;
-
- IgniteTxEntry txEntry = txx.entry(grpLockKey);
-
- assert txEntry != null || (txx.near() && !txx.local());
-
- if (txEntry != null) {
- GridCacheContext cacheCtx = txEntry.context();
-
- // Group-locked entries must be locked.
- while (true) {
- try {
- GridCacheEntryEx entry = txEntry.cached();
-
- assert entry != null;
-
- entry.txUnlock(txx);
-
- break;
- }
- catch (GridCacheEntryRemovedException ignored) {
- if (log.isDebugEnabled())
- log.debug("Got removed entry in TM unlockGroupLocks(..) method (will retry): " + txEntry);
-
- GridCacheAdapter cache = cacheCtx.cache();
-
- // Renew cache entry.
- txEntry.cached(cache.entryEx(txEntry.key()));
- }
- }
- }
- }
-
- /**
* @param tx Owning transaction.
* @param entries Entries to unlock.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da5a2282/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
index 56bd676..9af29d6 100644
--- a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
+++ b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
@@ -85,9 +85,7 @@ public class CacheJtaManager extends CacheJtaManagerAdapter {
tCfg.getDefaultTxIsolation(),
tCfg.getDefaultTxTimeout(),
/*store enabled*/true,
- /*tx size*/0,
- /*group lock keys*/null,
- /*partition lock*/false
+ /*tx size*/0
);
}