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/07/06 10:49:40 UTC
[01/50] incubator-ignite git commit: # ignite-gg-10416 Fixed exclude
nested beans with missing classes.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-752 22ee6e858 -> 84d689758
# ignite-gg-10416 Fixed exclude nested beans with missing classes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e5fba8b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e5fba8b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e5fba8b3
Branch: refs/heads/ignite-752
Commit: e5fba8b3a04d982e9b4c1617be416a77880e78ef
Parents: 99b8284
Author: Andrey <an...@gridgain.com>
Authored: Thu Jun 18 16:23:40 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jun 18 16:23:40 2015 +0700
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5fba8b3/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
index 0c2e99e..3ff927a 100644
--- a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
+++ b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
@@ -40,6 +40,8 @@ public class IgniteSpringTestSuite extends TestSuite {
suite.addTest(IgniteResourceSelfTestSuite.suite());
+ suite.addTest(new TestSuite(IgniteStartExcludesConfigurationTest.class));
+
// Tests moved to this suite since they require Spring functionality.
suite.addTest(new TestSuite(GridP2PUserVersionChangeSelfTest.class));
[27/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-gg-10416
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10416
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ad3e6af4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ad3e6af4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ad3e6af4
Branch: refs/heads/ignite-752
Commit: ad3e6af49e9e86f49dd6092c29dc3de8946e0389
Parents: 7e82a68 d3783a1
Author: Andrey <an...@gridgain.com>
Authored: Thu Jul 2 09:50:59 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jul 2 09:50:59 2015 +0700
----------------------------------------------------------------------
assembly/dependencies-fabric.xml | 1 +
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 +-
.../ignite/compute/ComputeTaskSplitAdapter.java | 2 +-
.../configuration/CacheConfiguration.java | 105 +++----
.../configuration/NearCacheConfiguration.java | 10 +-
.../ignite/internal/GridKernalContextImpl.java | 2 +-
.../managers/communication/GridIoManager.java | 49 ++--
.../discovery/GridDiscoveryManager.java | 32 +-
.../cache/GridCacheDeploymentManager.java | 10 +-
.../processors/cache/GridCacheProcessor.java | 62 +++-
.../processors/cache/IgniteCacheFutureImpl.java | 42 +++
.../processors/cache/IgniteCacheProxy.java | 2 +-
.../processors/clock/GridClockServer.java | 21 +-
.../internal/util/future/IgniteFutureImpl.java | 18 +-
.../shmem/IpcSharedMemoryServerEndpoint.java | 10 +-
.../util/nio/GridNioMessageTracker.java | 23 +-
.../util/VisorClusterGroupEmptyException.java | 6 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 2 +-
.../TcpDiscoveryMulticastIpFinder.java | 74 ++++-
.../core/src/main/resources/ignite.properties | 2 +-
.../core/src/test/config/spark/spark-config.xml | 46 +++
modules/core/src/test/config/tests.properties | 6 +-
.../IgniteTopologyPrintFormatSelfTest.java | 289 +++++++++++++++++++
.../cache/GridCacheDaemonNodeStopSelfTest.java | 119 --------
.../IgniteDaemonNodeMarshallerCacheTest.java | 192 ++++++++++++
.../GridP2PContinuousDeploymentSelfTest.java | 2 -
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 +
.../testsuites/IgniteCacheTestSuite3.java | 1 -
.../testsuites/IgniteKernalSelfTestSuite.java | 1 +
modules/core/src/test/resources/helloworld.gar | Bin 6092 -> 0 bytes
modules/core/src/test/resources/helloworld1.gar | Bin 6092 -> 0 bytes
modules/core/src/test/resources/readme.txt | 6 -
modules/docker/Dockerfile | 55 ++++
modules/docker/README.txt | 11 +
modules/docker/build_users_libs.sh | 39 +++
modules/docker/download_ignite.sh | 49 ++++
modules/docker/execute.sh | 62 ++++
modules/docker/run.sh | 34 +++
modules/extdata/p2p/pom.xml | 4 +-
modules/extdata/uri/META-INF/ignite.xml | 38 +++
.../extdata/uri/modules/uri-dependency/pom.xml | 42 +++
.../deployment/uri/tasks/GarHelloWorldBean.java | 60 ++++
.../src/main/resources/gar-example.properties | 18 ++
modules/extdata/uri/pom.xml | 62 +++-
.../deployment/uri/tasks/GarHelloWorldTask.java | 81 ++++++
.../deployment/uri/tasks/gar-spring-bean.xml | 29 ++
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/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
.../ignite/schema/model/PojoDescriptor.java | 2 +
.../apache/ignite/schema/model/PojoField.java | 1 +
.../parser/dialect/OracleMetadataDialect.java | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
.../org/apache/ignite/spark/IgniteContext.scala | 50 +++-
.../org/apache/ignite/spark/IgniteRddSpec.scala | 18 ++
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 16 +-
.../GridTaskUriDeploymentDeadlockSelfTest.java | 13 +-
.../ignite/p2p/GridP2PDisabledSelfTest.java | 2 +-
modules/visor-console-2.10/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 | 14 +-
86 files changed, 1577 insertions(+), 325 deletions(-)
----------------------------------------------------------------------
[25/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1a465a2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1a465a2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1a465a2e
Branch: refs/heads/ignite-752
Commit: 1a465a2eae96e5a008d351323d3786e1ed69d649
Parents: 234a809 af3cfdf
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jul 1 11:25:18 2015 -0700
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jul 1 11:25:18 2015 -0700
----------------------------------------------------------------------
modules/extdata/uri/modules/uri-dependency/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[19/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d24658d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d24658d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d24658d5
Branch: refs/heads/ignite-752
Commit: d24658d5a149da56f37a040b33ef12f3e9a3ad04
Parents: d8c1cc2 2ee616d
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Fri Jun 26 14:25:25 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Fri Jun 26 14:25:25 2015 -0700
----------------------------------------------------------------------
.../org/apache/ignite/cluster/ClusterGroup.java | 9 +-
.../internal/cluster/ClusterGroupAdapter.java | 12 +-
.../cluster/IgniteClusterAsyncImpl.java | 7 +-
.../GridCachePartitionExchangeManager.java | 6 +-
.../processors/rest/GridRestProcessor.java | 4 +-
.../handlers/task/GridTaskCommandHandler.java | 12 +-
.../processors/task/GridTaskWorker.java | 4 +-
.../visor/query/VisorQueryCleanupTask.java | 14 +
.../util/VisorClusterGroupEmptyException.java | 33 +++
.../ignite/spi/discovery/tcp/ClientImpl.java | 151 ++++++-----
.../ignite/spi/discovery/tcp/ServerImpl.java | 103 +++++--
.../spi/discovery/tcp/TcpDiscoverySpi.java | 3 +-
.../internal/ClusterForHostsSelfTest.java | 113 --------
.../internal/ClusterGroupHostsSelfTest.java | 141 ++++++++++
.../internal/GridDiscoveryEventSelfTest.java | 12 +-
...achePartitionedMultiNodeFullApiSelfTest.java | 4 +-
.../tcp/TcpClientDiscoverySpiSelfTest.java | 265 ++++++++++++++++++-
.../ignite/testsuites/IgniteBasicTestSuite.java | 2 +-
18 files changed, 684 insertions(+), 211 deletions(-)
----------------------------------------------------------------------
[38/50] incubator-ignite git commit: Merge branches 'ignite-gg-10416'
and 'ignite-sprint-7' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10416
Posted by sb...@apache.org.
Merge branches 'ignite-gg-10416' and 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10416
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/beb697af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/beb697af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/beb697af
Branch: refs/heads/ignite-752
Commit: beb697afabec3342195d301d1c68a58b3154b689
Parents: fcff50e ea90d86
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Jul 3 10:07:42 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Jul 3 10:07:42 2015 +0700
----------------------------------------------------------------------
.../java/org/apache/ignite/IgniteCache.java | 5 +
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../apache/ignite/internal/IgniteKernal.java | 1 -
.../managers/communication/GridIoManager.java | 124 +++++++--
.../managers/communication/GridIoMessage.java | 15 +-
.../managers/communication/GridIoPolicy.java | 32 +--
.../eventstorage/GridEventStorageManager.java | 2 +-
.../processors/cache/CacheOperationContext.java | 44 +++-
.../internal/processors/cache/CacheType.java | 8 +-
.../processors/cache/GridCacheAdapter.java | 91 ++++---
.../processors/cache/GridCacheAtomicFuture.java | 12 +-
.../processors/cache/GridCacheContext.java | 4 +-
.../processors/cache/GridCacheIoManager.java | 12 +-
.../processors/cache/GridCacheMvccManager.java | 8 +-
.../processors/cache/GridCacheProxyImpl.java | 10 +-
.../processors/cache/GridCacheSwapManager.java | 257 ++++++++++++-------
.../processors/cache/GridCacheUtils.java | 42 +++
.../processors/cache/IgniteCacheProxy.java | 36 ++-
.../GridDistributedTxFinishRequest.java | 11 +-
.../GridDistributedTxPrepareRequest.java | 9 +-
.../GridDistributedTxRemoteAdapter.java | 3 +-
.../distributed/dht/GridDhtTxFinishRequest.java | 3 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 3 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 3 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 5 +-
.../dht/atomic/GridDhtAtomicCache.java | 18 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 15 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 177 +++++++++++--
.../near/GridNearTxFinishRequest.java | 3 +-
.../cache/distributed/near/GridNearTxLocal.java | 3 +-
.../distributed/near/GridNearTxRemote.java | 5 +-
.../cache/transactions/IgniteInternalTx.java | 3 +-
.../cache/transactions/IgniteTxAdapter.java | 11 +-
.../transactions/IgniteTxLocalAdapter.java | 3 +-
.../datastructures/GridCacheAtomicLongImpl.java | 25 +-
.../GridCacheAtomicSequenceImpl.java | 11 +-
.../GridCacheAtomicStampedImpl.java | 21 +-
.../GridCacheCountDownLatchImpl.java | 16 +-
.../internal/processors/igfs/IgfsContext.java | 5 +-
.../plugin/IgnitePluginProcessor.java | 3 +-
.../plugin/extensions/communication/IoPool.java | 42 +++
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 5 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 5 +-
.../TcpDiscoveryMulticastIpFinder.java | 2 +-
.../communication/GridIoManagerSelfTest.java | 2 +-
.../cache/IgniteInternalCacheTypesTest.java | 3 +-
.../IgniteCachePutRetryAbstractSelfTest.java | 147 +++++++++++
.../dht/IgniteCachePutRetryAtomicSelfTest.java | 34 +++
...gniteCachePutRetryTransactionalSelfTest.java | 74 ++++++
...eAtomicInvalidPartitionHandlingSelfTest.java | 5 +-
.../GridCacheEvictionFilterSelfTest.java | 2 -
.../inmemory/GridTestSwapSpaceSpi.java | 3 +-
.../IgniteCacheFailoverTestSuite.java | 3 +
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 8 +-
.../processors/query/h2/opt/GridH2Table.java | 2 +-
.../cache/IgniteCacheOffheapEvictQueryTest.java | 2 +-
.../IgniteCacheQueryMultiThreadedSelfTest.java | 4 +-
...QueryOffheapEvictsMultiThreadedSelfTest.java | 5 -
.../IgniteCacheQueryNodeRestartSelfTest2.java | 5 +
modules/urideploy/pom.xml | 14 -
61 files changed, 1053 insertions(+), 378 deletions(-)
----------------------------------------------------------------------
[04/50] incubator-ignite git commit: IGNITE-621 - Added automatic
retries for atomics.
Posted by sb...@apache.org.
IGNITE-621 - Added automatic retries for atomics.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5505b4d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5505b4d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5505b4d3
Branch: refs/heads/ignite-752
Commit: 5505b4d3d50caf41246d1194c52298a6df47a239
Parents: 3787a9d
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Sun Jun 21 13:09:24 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Sun Jun 21 13:09:24 2015 -0700
----------------------------------------------------------------------
.../processors/cache/GridCacheUtils.java | 42 ++++++++++++++++++++
.../datastructures/GridCacheAtomicLongImpl.java | 25 ++++++------
.../GridCacheAtomicSequenceImpl.java | 11 ++---
.../GridCacheAtomicStampedImpl.java | 21 +++++-----
.../GridCacheCountDownLatchImpl.java | 16 +++-----
.../IgniteCachePutRetryAbstractSelfTest.java | 13 ++++++
...gniteCachePutRetryTransactionalSelfTest.java | 39 ++++++++++++++++++
.../IgniteCacheFailoverTestSuite.java | 3 ++
8 files changed, 131 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 8c26046..f88e288 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -30,6 +30,7 @@ import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.internal.transactions.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.T2;
@@ -1699,4 +1700,45 @@ public class GridCacheUtils {
ctx.resource().cleanupGeneric(lsnr);
}
}
+
+ /**
+ * @param c Closure to retry.
+ * @param <S> Closure type.
+ * @return Wrapped closure.
+ */
+ public static <S> Callable<S> retryTopologySafe(final Callable<S> c ) {
+ return new Callable<S>() {
+ @Override public S call() throws Exception {
+ int retries = GridCacheAdapter.MAX_RETRIES;
+
+ IgniteCheckedException err = null;
+
+ for (int i = 0; i < retries; i++) {
+ try {
+ return c.call();
+ }
+ catch (IgniteCheckedException e) {
+ if (X.hasCause(e, ClusterTopologyCheckedException.class) ||
+ X.hasCause(e, IgniteTxRollbackCheckedException.class) ||
+ X.hasCause(e, CachePartialUpdateCheckedException.class)) {
+ if (i < retries - 1) {
+ err = e;
+
+ U.sleep(1);
+
+ continue;
+ }
+
+ throw e;
+ }
+ else
+ throw e;
+ }
+ }
+
+ // Should never happen.
+ throw err;
+ }
+ };
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
index b18d35a..5e9245d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
@@ -31,6 +31,7 @@ import java.util.concurrent.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
import static org.apache.ignite.transactions.TransactionIsolation.*;
+import static org.apache.ignite.internal.util.typedef.internal.CU.*;
/**
* Cache atomic long implementation.
@@ -78,7 +79,7 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
};
/** Callable for {@link #incrementAndGet()}. */
- private final Callable<Long> incAndGetCall = new Callable<Long>() {
+ private final Callable<Long> incAndGetCall = retryTopologySafe(new Callable<Long>() {
@Override public Long call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicLongValue val = atomicView.get(key);
@@ -102,10 +103,10 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
throw e;
}
}
- };
+ });
/** Callable for {@link #getAndIncrement()}. */
- private final Callable<Long> getAndIncCall = new Callable<Long>() {
+ private final Callable<Long> getAndIncCall = retryTopologySafe(new Callable<Long>() {
@Override public Long call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicLongValue val = atomicView.get(key);
@@ -129,10 +130,10 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
throw e;
}
}
- };
+ });
/** Callable for {@link #decrementAndGet()}. */
- private final Callable<Long> decAndGetCall = new Callable<Long>() {
+ private final Callable<Long> decAndGetCall = retryTopologySafe(new Callable<Long>() {
@Override public Long call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicLongValue val = atomicView.get(key);
@@ -156,10 +157,10 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
throw e;
}
}
- };
+ });
/** Callable for {@link #getAndDecrement()}. */
- private final Callable<Long> getAndDecCall = new Callable<Long>() {
+ private final Callable<Long> getAndDecCall = retryTopologySafe(new Callable<Long>() {
@Override public Long call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicLongValue val = atomicView.get(key);
@@ -183,7 +184,7 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
throw e;
}
}
- };
+ });
/**
* Empty constructor required by {@link Externalizable}.
@@ -378,7 +379,7 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
* @return Callable for execution in async and sync mode.
*/
private Callable<Long> internalAddAndGet(final long l) {
- return new Callable<Long>() {
+ return retryTopologySafe(new Callable<Long>() {
@Override public Long call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicLongValue val = atomicView.get(key);
@@ -402,7 +403,7 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
throw e;
}
}
- };
+ });
}
/**
@@ -412,7 +413,7 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
* @return Callable for execution in async and sync mode.
*/
private Callable<Long> internalGetAndAdd(final long l) {
- return new Callable<Long>() {
+ return retryTopologySafe(new Callable<Long>() {
@Override public Long call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicLongValue val = atomicView.get(key);
@@ -436,7 +437,7 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
throw e;
}
}
- };
+ });
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
index e66c11e..2400a7e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
@@ -35,6 +35,7 @@ import java.util.concurrent.locks.*;
import static java.util.concurrent.TimeUnit.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
import static org.apache.ignite.transactions.TransactionIsolation.*;
+import static org.apache.ignite.internal.util.typedef.internal.CU.*;
/**
* Cache sequence implementation.
@@ -435,11 +436,9 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
*/
@SuppressWarnings("TooBroadScope")
private Callable<Long> internalUpdate(final long l, final boolean updated) {
- return new Callable<Long>() {
+ return retryTopologySafe(new Callable<Long>() {
@Override public Long call() throws Exception {
- IgniteInternalTx tx = CU.txStartInternal(ctx, seqView, PESSIMISTIC, REPEATABLE_READ);
-
- try {
+ try (IgniteInternalTx tx = CU.txStartInternal(ctx, seqView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicSequenceValue seq = seqView.get(key);
checkRemoved();
@@ -506,11 +505,9 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
U.error(log, "Failed to get and add: " + this, e);
throw e;
- } finally {
- tx.close();
}
}
- };
+ });
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
index a898e58..76ea7ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
@@ -33,6 +33,7 @@ import java.util.concurrent.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
import static org.apache.ignite.transactions.TransactionIsolation.*;
+import static org.apache.ignite.internal.util.typedef.internal.CU.*;
/**
* Cache atomic stamped implementation.
@@ -68,7 +69,7 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
private GridCacheContext ctx;
/** Callable for {@link #get()} operation */
- private final Callable<IgniteBiTuple<T, S>> getCall = new Callable<IgniteBiTuple<T, S>>() {
+ private final Callable<IgniteBiTuple<T, S>> getCall = retryTopologySafe(new Callable<IgniteBiTuple<T, S>>() {
@Override public IgniteBiTuple<T, S> call() throws Exception {
GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
@@ -77,10 +78,10 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
return stmp.get();
}
- };
+ });
/** Callable for {@link #value()} operation */
- private final Callable<T> valCall = new Callable<T>() {
+ private final Callable<T> valCall = retryTopologySafe(new Callable<T>() {
@Override public T call() throws Exception {
GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
@@ -89,10 +90,10 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
return stmp.value();
}
- };
+ });
/** Callable for {@link #stamp()} operation */
- private final Callable<S> stampCall = new Callable<S>() {
+ private final Callable<S> stampCall = retryTopologySafe(new Callable<S>() {
@Override public S call() throws Exception {
GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
@@ -101,7 +102,7 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
return stmp.stamp();
}
- };
+ });
/**
* Empty constructor required by {@link Externalizable}.
@@ -254,7 +255,7 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
* @return Callable for execution in async and sync mode.
*/
private Callable<Boolean> internalSet(final T val, final S stamp) {
- return new Callable<Boolean>() {
+ return retryTopologySafe(new Callable<Boolean>() {
@Override public Boolean call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
@@ -276,7 +277,7 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
throw e;
}
}
- };
+ });
}
/**
@@ -292,7 +293,7 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
private Callable<Boolean> internalCompareAndSet(final IgnitePredicate<T> expValPred,
final IgniteClosure<T, T> newValClos, final IgnitePredicate<S> expStampPred,
final IgniteClosure<S, S> newStampClos) {
- return new Callable<Boolean>() {
+ return retryTopologySafe(new Callable<Boolean>() {
@Override public Boolean call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
@@ -323,7 +324,7 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
throw e;
}
}
- };
+ });
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
index 33547d9..ea7924f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
@@ -32,6 +32,7 @@ import java.util.concurrent.atomic.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
import static org.apache.ignite.transactions.TransactionIsolation.*;
+import static org.apache.ignite.internal.util.typedef.internal.CU.*;
/**
* Cache count down latch implementation.
@@ -179,12 +180,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
/** {@inheritDoc} */
@Override public int countDown() {
- try {
- return CU.outTx(new CountDownCallable(1), ctx);
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
+ return countDown(1);
}
/** {@inheritDoc} */
@@ -192,7 +188,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
A.ensure(val > 0, "val should be positive");
try {
- return CU.outTx(new CountDownCallable(val), ctx);
+ return CU.outTx(retryTopologySafe(new CountDownCallable(val)), ctx);
}
catch (IgniteCheckedException e) {
throw U.convertException(e);
@@ -202,7 +198,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
/** {@inheritDoc}*/
@Override public void countDownAll() {
try {
- CU.outTx(new CountDownCallable(0), ctx);
+ CU.outTx(retryTopologySafe(new CountDownCallable(0)), ctx);
}
catch (IgniteCheckedException e) {
throw U.convertException(e);
@@ -248,7 +244,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
if (initGuard.compareAndSet(false, true)) {
try {
internalLatch = CU.outTx(
- new Callable<CountDownLatch>() {
+ retryTopologySafe(new Callable<CountDownLatch>() {
@Override public CountDownLatch call() throws Exception {
try (IgniteInternalTx tx = CU.txStartInternal(ctx, latchView, PESSIMISTIC, REPEATABLE_READ)) {
GridCacheCountDownLatchValue val = latchView.get(key);
@@ -267,7 +263,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
return new CountDownLatch(val.get());
}
}
- },
+ }),
ctx
);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index 89d1040..bfddbe7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -52,6 +52,19 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
return cfg;
}
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ AtomicConfiguration acfg = new AtomicConfiguration();
+
+ acfg.setBackups(1);
+
+ cfg.setAtomicConfiguration(acfg);
+
+ return cfg;
+ }
+
/**
* @throws Exception If failed.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
index e65459a..91c454a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
@@ -17,7 +17,14 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
+import org.apache.ignite.*;
import org.apache.ignite.cache.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
/**
*
@@ -32,4 +39,36 @@ public class IgniteCachePutRetryTransactionalSelfTest extends IgniteCachePutRetr
@Override protected int keysCount() {
return 20_000;
}
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicLongRetries() throws Exception {
+ final AtomicBoolean finished = new AtomicBoolean();
+
+ IgniteAtomicLong atomic = ignite(0).atomicLong("TestAtomic", 0, true);
+
+ IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override
+ public Object call() throws Exception {
+ while (!finished.get()) {
+ stopGrid(3);
+
+ U.sleep(300);
+
+ startGrid(3);
+ }
+
+ return null;
+ }
+ });
+
+ int keysCnt = keysCount();
+
+ for (int i = 0; i < keysCnt; i++)
+ atomic.incrementAndGet();
+
+ finished.set(true);
+ fut.get();
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5505b4d3/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index dda86c1..80bfbf2 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -72,6 +72,9 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheTxNearDisabledPutGetRestartTest.class);
suite.addTestSuite(IgniteCacheTxNearDisabledFairAffinityPutGetRestartTest.class);
+ suite.addTestSuite(IgniteCachePutRetryAtomicSelfTest.class);
+ suite.addTestSuite(IgniteCachePutRetryTransactionalSelfTest.class);
+
return suite;
}
}
[34/50] incubator-ignite git commit: ignite-820
GridCacheEvictionFilterSelfTest#testPartitionedMixed enabled
Posted by sb...@apache.org.
ignite-820 GridCacheEvictionFilterSelfTest#testPartitionedMixed enabled
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c866902b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c866902b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c866902b
Branch: refs/heads/ignite-752
Commit: c866902b2abbedd26ef1d968aabae1cd74657c95
Parents: b437ec7
Author: agura <ag...@gridgain.com>
Authored: Thu Jul 2 16:10:25 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Thu Jul 2 16:10:25 2015 +0300
----------------------------------------------------------------------
.../processors/cache/eviction/GridCacheEvictionFilterSelfTest.java | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c866902b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
index ea926ee..3cdb3d9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
@@ -185,8 +185,6 @@ public class GridCacheEvictionFilterSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testPartitionedMixed() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-820");
-
mode = PARTITIONED;
nearEnabled = false;
[36/50] incubator-ignite git commit: IGNITE-621 - Merge branch
ignite-621 into sprint-7
Posted by sb...@apache.org.
IGNITE-621 - Merge branch ignite-621 into sprint-7
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1427d75b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1427d75b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1427d75b
Branch: refs/heads/ignite-752
Commit: 1427d75b9ea46d3044caddc51b44c03abc71901d
Parents: c866902 ac93958
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jul 2 12:10:09 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jul 2 12:10:09 2015 -0700
----------------------------------------------------------------------
.../java/org/apache/ignite/IgniteCache.java | 5 +
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../processors/cache/CacheOperationContext.java | 44 ++++-
.../processors/cache/GridCacheAdapter.java | 91 ++++++----
.../processors/cache/GridCacheAtomicFuture.java | 12 +-
.../processors/cache/GridCacheMvccManager.java | 8 +-
.../processors/cache/GridCacheProxyImpl.java | 10 +-
.../processors/cache/GridCacheUtils.java | 42 +++++
.../processors/cache/IgniteCacheProxy.java | 36 +++-
.../dht/atomic/GridDhtAtomicCache.java | 18 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 15 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 177 +++++++++++++++++--
.../datastructures/GridCacheAtomicLongImpl.java | 25 +--
.../GridCacheAtomicSequenceImpl.java | 11 +-
.../GridCacheAtomicStampedImpl.java | 21 +--
.../GridCacheCountDownLatchImpl.java | 16 +-
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../IgniteCachePutRetryAbstractSelfTest.java | 147 +++++++++++++++
.../dht/IgniteCachePutRetryAtomicSelfTest.java | 34 ++++
...gniteCachePutRetryTransactionalSelfTest.java | 74 ++++++++
...eAtomicInvalidPartitionHandlingSelfTest.java | 5 +-
.../IgniteCacheFailoverTestSuite.java | 3 +
22 files changed, 665 insertions(+), 134 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1427d75b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
[42/50] incubator-ignite git commit: ignite-428 Implement
IgniteKafkaStreamer to stream data from Apache Kafka
Posted by sb...@apache.org.
ignite-428 Implement IgniteKafkaStreamer to stream data from Apache Kafka
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2c41739d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2c41739d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2c41739d
Branch: refs/heads/ignite-752
Commit: 2c41739dcd83751270b6bd30c6f2595edc68a1b1
Parents: 9f6a7f9
Author: vishal.garg <vi...@workday.com>
Authored: Mon Jun 22 19:35:08 2015 -0700
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 19:39:11 2015 +0300
----------------------------------------------------------------------
modules/kafka/pom.xml | 128 +++++++
.../ignite/stream/kafka/KafkaStreamer.java | 179 +++++++++
.../stream/kafka/KafkaEmbeddedBroker.java | 373 +++++++++++++++++++
.../kafka/KafkaIgniteStreamerSelfTest.java | 230 ++++++++++++
.../ignite/stream/kafka/SimplePartitioner.java | 46 +++
pom.xml | 1 +
6 files changed, 957 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
new file mode 100644
index 0000000..165ec1c
--- /dev/null
+++ b/modules/kafka/pom.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+
+<!--
+ POM file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-parent</artifactId>
+ <version>1</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <artifactId>ignite-kafka</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka_2.10</artifactId>
+ <version>0.8.2.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.jmx</groupId>
+ <artifactId>jmxri</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jdmk</groupId>
+ <artifactId>jmxtools</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>net.sf.jopt-simple</groupId>
+ <artifactId>jopt-simple</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ <version>3.4.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-log4j</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-all</artifactId>
+ <version>4.2</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gridgain</groupId>
+ <artifactId>ignite-shmem</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
new file mode 100644
index 0000000..e0240ce
--- /dev/null
+++ b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
@@ -0,0 +1,179 @@
+/*
+ * 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.kafka;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.stream.*;
+
+import kafka.consumer.*;
+import kafka.javaapi.consumer.ConsumerConnector;
+import kafka.message.*;
+import kafka.serializer.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Server that subscribes to topic messages from Kafka broker, streams its to key-value pairs into {@link
+ * org.apache.ignite.IgniteDataStreamer} instance.
+ * <p>
+ * Uses Kafka's High Level Consumer API to read messages from Kafka
+ *
+ * @see <a href="https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example">Consumer Consumer Group
+ * Example</a>
+ */
+public class KafkaStreamer<T, K, V>
+ extends StreamAdapter<T, K, V> {
+
+ /** Logger. */
+ private IgniteLogger log;
+
+ /** Executor used to submit kafka streams. */
+ private ExecutorService executor;
+
+ /** Topic. */
+ private String topic;
+
+ /** Number of threads to process kafka streams. */
+ private int threads;
+
+ /** Kafka Consumer Config. */
+ private ConsumerConfig consumerConfig;
+
+ /** Key Decoder. */
+ private Decoder<K> keyDecoder;
+
+ /** Value Decoder. */
+ private Decoder<V> valueDecoder;
+
+ /** Kafka Consumer connector. */
+ private ConsumerConnector consumer;
+
+ /**
+ * Sets the topic.
+ *
+ * @param topic Topic Name.
+ */
+ public void setTopic(final String topic) {
+ this.topic = topic;
+ }
+
+ /**
+ * Sets the threads.
+ *
+ * @param threads Number of Threads.
+ */
+ public void setThreads(final int threads) {
+ this.threads = threads;
+ }
+
+ /**
+ * Sets the consumer config.
+ *
+ * @param consumerConfig Consumer configuration.
+ */
+ public void setConsumerConfig(final ConsumerConfig consumerConfig) {
+ this.consumerConfig = consumerConfig;
+ }
+
+ /**
+ * Sets the key decoder.
+ *
+ * @param keyDecoder Key Decoder.
+ */
+ public void setKeyDecoder(final Decoder<K> keyDecoder) {
+ this.keyDecoder = keyDecoder;
+ }
+
+ /**
+ * Sets the value decoder.
+ *
+ * @param valueDecoder Value Decoder
+ */
+ public void setValueDecoder(final Decoder<V> valueDecoder) {
+ this.valueDecoder = valueDecoder;
+ }
+
+ /**
+ * Starts streamer.
+ *
+ * @throws IgniteException If failed.
+ */
+ public void start() {
+ A.notNull(getStreamer(), "streamer");
+ A.notNull(getIgnite(), "ignite");
+ A.notNull(topic, "topic");
+ A.notNull(keyDecoder, "key decoder");
+ A.notNull(valueDecoder, "value decoder");
+ A.notNull(consumerConfig, "kafka consumer config");
+ A.ensure(threads > 0, "threads > 0");
+
+ log = getIgnite().log();
+
+ consumer = kafka.consumer.Consumer.createJavaConsumerConnector(consumerConfig);
+
+ Map<String, Integer> topicCountMap = new HashMap<>();
+ topicCountMap.put(topic, threads);
+
+ Map<String, List<KafkaStream<K, V>>> consumerMap = consumer.createMessageStreams(topicCountMap, keyDecoder,
+ valueDecoder);
+
+ List<KafkaStream<K, V>> streams = consumerMap.get(topic);
+
+ // Now launch all the consumer threads.
+ executor = Executors.newFixedThreadPool(threads);
+
+ // Now create an object to consume the messages.
+ for (final KafkaStream<K,V> stream : streams) {
+ executor.submit(new Runnable() {
+ @Override public void run() {
+
+ ConsumerIterator<K, V> it = stream.iterator();
+
+ while (it.hasNext()) {
+ final MessageAndMetadata<K, V> messageAndMetadata = it.next();
+ getStreamer().addData(messageAndMetadata.key(), messageAndMetadata.message());
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * Stops streamer.
+ */
+ public void stop() {
+ if (consumer != null)
+ consumer.shutdown();
+
+ if (executor != null) {
+ executor.shutdown();
+
+ try {
+ if (!executor.awaitTermination(5000, TimeUnit.MILLISECONDS))
+ if (log.isDebugEnabled())
+ log.debug("Timed out waiting for consumer threads to shut down, exiting uncleanly");
+ }
+ catch (InterruptedException e) {
+ if (log.isDebugEnabled())
+ log.debug("Interrupted during shutdown, exiting uncleanly");
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
new file mode 100644
index 0000000..28533f7
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
@@ -0,0 +1,373 @@
+/*
+ * 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.kafka;
+
+import org.apache.commons.io.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.zookeeper.server.*;
+
+import kafka.admin.*;
+import kafka.api.*;
+import kafka.api.Request;
+import kafka.producer.*;
+import kafka.server.*;
+import kafka.utils.*;
+import org.I0Itec.zkclient.*;
+
+import java.io.*;
+import java.net.*;
+import java.nio.file.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Kafka Embedded Broker.
+ */
+public class KafkaEmbeddedBroker {
+
+ /** Default ZooKeeper Host. */
+ private static final String ZK_HOST = "localhost";
+
+ /** Broker Port. */
+ private static final int BROKER_PORT = 9092;
+
+ /** ZooKeeper Connection Timeout. */
+ private static final int ZK_CONNECTION_TIMEOUT = 6000;
+
+ /** ZooKeeper Session Timeout. */
+ private static final int ZK_SESSION_TIMEOUT = 6000;
+
+ /** ZooKeeper port. */
+ private static int zkPort = 0;
+
+ /** Is ZooKeeper Ready. */
+ private boolean zkReady;
+
+ /** Kafka Config. */
+ private KafkaConfig brokerConfig;
+
+ /** Kafka Server. */
+ private KafkaServer kafkaServer;
+
+ /** ZooKeeper Client. */
+ private ZkClient zkClient;
+
+ /** Embedded ZooKeeper. */
+ private EmbeddedZooKeeper zooKeeper;
+
+ /**
+ * Creates an embedded Kafka Broker.
+ */
+ public KafkaEmbeddedBroker() {
+ try {
+ setupEmbeddedZooKeeper();
+ setupEmbeddedKafkaServer();
+ }
+ catch (IOException | InterruptedException e) {
+ throw new RuntimeException("failed to start Kafka Broker " + e);
+ }
+
+ }
+
+ /**
+ * @return ZooKeeper Address.
+ */
+ public static String getZKAddress() {
+ return ZK_HOST + ":" + zkPort;
+ }
+
+ /**
+ * Creates a Topic.
+ *
+ * @param topic topic name
+ * @param partitions number of paritions for the topic
+ * @param replicationFactor replication factor
+ * @throws TimeoutException
+ * @throws InterruptedException
+ */
+ public void createTopic(String topic, final int partitions, final int replicationFactor)
+ throws TimeoutException, InterruptedException {
+ AdminUtils.createTopic(zkClient, topic, partitions, replicationFactor, new Properties());
+ waitUntilMetadataIsPropagated(topic, 0, 10000, 100);
+ }
+
+ /**
+ * Sends message to Kafka Broker.
+ *
+ * @param keyedMessages List of Keyed Messages.
+ * @return Producer used to send the message.
+ */
+ public Producer sendMessages(List<KeyedMessage<String, String>> keyedMessages) {
+ Producer<String, String> producer = new Producer<>(getProducerConfig());
+ producer.send(scala.collection.JavaConversions.asScalaBuffer(keyedMessages));
+ return producer;
+ }
+
+ /**
+ * Shuts down Kafka Broker.
+ *
+ * @throws IOException
+ */
+ public void shutdown()
+ throws IOException {
+
+ zkReady = false;
+
+ if (kafkaServer != null)
+ kafkaServer.shutdown();
+
+ List<String> logDirs = scala.collection.JavaConversions.asJavaList(brokerConfig.logDirs());
+
+ for (String logDir : logDirs) {
+ FileUtils.deleteDirectory(new File(logDir));
+ }
+
+ if (zkClient != null) {
+ zkClient.close();
+ zkClient = null;
+ }
+
+ if (zooKeeper != null) {
+
+ try {
+ zooKeeper.shutdown();
+ }
+ catch (IOException e) {
+ // ignore
+ }
+
+ zooKeeper = null;
+ }
+
+ }
+
+ /**
+ * @return the Zookeeper Client
+ */
+ private ZkClient getZkClient() {
+ A.ensure(zkReady, "Zookeeper not setup yet");
+ A.notNull(zkClient, "Zookeeper client is not yet initialized");
+
+ return zkClient;
+ }
+
+ /**
+ * Checks if topic metadata is propagated.
+ *
+ * @param topic topic name
+ * @param partition partition
+ * @return true if propagated otherwise false
+ */
+ private boolean isMetadataPropagated(final String topic, final int partition) {
+ final scala.Option<PartitionStateInfo> partitionStateOption = kafkaServer.apis().metadataCache().getPartitionInfo(
+ topic, partition);
+ if (partitionStateOption.isDefined()) {
+ final PartitionStateInfo partitionState = partitionStateOption.get();
+ final LeaderAndIsr leaderAndInSyncReplicas = partitionState.leaderIsrAndControllerEpoch().leaderAndIsr();
+
+ if (ZkUtils.getLeaderForPartition(getZkClient(), topic, partition) != null
+ && Request.isValidBrokerId(leaderAndInSyncReplicas.leader())
+ && leaderAndInSyncReplicas.isr().size() >= 1)
+ return true;
+
+ }
+ return false;
+ }
+
+ /**
+ * Waits until metadata is propagated.
+ *
+ * @param topic topic name
+ * @param partition partition
+ * @param timeout timeout value in millis
+ * @param interval interval in millis to sleep
+ * @throws TimeoutException
+ * @throws InterruptedException
+ */
+ private void waitUntilMetadataIsPropagated(final String topic, final int partition, final long timeout,
+ final long interval) throws TimeoutException, InterruptedException {
+ int attempt = 1;
+ final long startTime = System.currentTimeMillis();
+
+ while (true) {
+ if (isMetadataPropagated(topic, partition))
+ return;
+
+ final long duration = System.currentTimeMillis() - startTime;
+
+ if (duration < timeout)
+ Thread.sleep(interval);
+ else
+ throw new TimeoutException("metadata propagate timed out, attempt=" + attempt);
+
+ attempt++;
+ }
+
+ }
+
+ /**
+ * Sets up embedded Kafka Server
+ *
+ * @throws IOException
+ */
+ private void setupEmbeddedKafkaServer()
+ throws IOException {
+ A.ensure(zkReady, "Zookeeper should be setup before hand");
+
+ brokerConfig = new KafkaConfig(getBrokerConfig());
+ kafkaServer = new KafkaServer(brokerConfig, SystemTime$.MODULE$);
+ kafkaServer.startup();
+ }
+
+ /**
+ * Sets up embedded zooKeeper
+ *
+ * @throws IOException
+ * @throws InterruptedException
+ */
+ private void setupEmbeddedZooKeeper()
+ throws IOException, InterruptedException {
+ EmbeddedZooKeeper zooKeeper = new EmbeddedZooKeeper(ZK_HOST, zkPort);
+ zooKeeper.startup();
+ zkPort = zooKeeper.getActualPort();
+ zkClient = new ZkClient(getZKAddress(), ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT, ZKStringSerializer$.MODULE$);
+ zkReady = true;
+ }
+
+ /**
+ * @return Kafka Broker Address.
+ */
+ private static String getBrokerAddress() {
+ return ZK_HOST + ":" + BROKER_PORT;
+ }
+
+ /**
+ * Gets KafKa Brofer Config
+ *
+ * @return Kafka Broker Config
+ * @throws IOException
+ */
+ private static Properties getBrokerConfig()
+ throws IOException {
+ Properties props = new Properties();
+ props.put("broker.id", "0");
+ props.put("host.name", ZK_HOST);
+ props.put("port", "" + BROKER_PORT);
+ props.put("log.dir", createTempDir("_cfg").getAbsolutePath());
+ props.put("zookeeper.connect", getZKAddress());
+ props.put("log.flush.interval.messages", "1");
+ props.put("replica.socket.timeout.ms", "1500");
+ return props;
+ }
+
+ /**
+ * @return Kafka Producer Config
+ */
+ private static ProducerConfig getProducerConfig() {
+ Properties props = new Properties();
+ props.put("metadata.broker.list", getBrokerAddress());
+ props.put("serializer.class", "kafka.serializer.StringEncoder");
+ props.put("key.serializer.class", "kafka.serializer.StringEncoder");
+ props.put("partitioner.class", "org.apache.ignite.kafka.SimplePartitioner");
+ return new ProducerConfig(props);
+ }
+
+ /**
+ * Creates Temp Directory
+ *
+ * @param prefix prefix
+ * @return Created File.
+ * @throws IOException
+ */
+ private static File createTempDir(final String prefix)
+ throws IOException {
+ final Path path = Files.createTempDirectory(prefix);
+ return path.toFile();
+
+ }
+
+ /**
+ * Creates Embedded ZooKeeper.
+ */
+ private static class EmbeddedZooKeeper {
+ /** Default ZooKeeper Host. */
+ private final String zkHost;
+
+ /** Default ZooKeeper Port. */
+ private final int zkPort;
+
+ /** NIO Context Factory. */
+ private NIOServerCnxnFactory factory;
+
+ /** Snapshot Directory. */
+ private File snapshotDir;
+
+ /** Log Directory. */
+ private File logDir;
+
+ /**
+ * Creates an embedded Zookeeper
+ * @param zkHost zookeeper host
+ * @param zkPort zookeeper port
+ */
+ EmbeddedZooKeeper(final String zkHost, final int zkPort) {
+ this.zkHost = zkHost;
+ this.zkPort = zkPort;
+ }
+
+ /**
+ * Starts up ZooKeeper.
+ *
+ * @throws IOException
+ * @throws InterruptedException
+ */
+ void startup()
+ throws IOException, InterruptedException {
+ snapshotDir = createTempDir("_ss");
+ logDir = createTempDir("_log");
+ ZooKeeperServer zooServer = new ZooKeeperServer(snapshotDir, logDir, 500);
+ factory = new NIOServerCnxnFactory();
+ factory.configure(new InetSocketAddress(zkHost, zkPort), 16);
+ factory.startup(zooServer);
+ }
+
+ /**
+ *
+ * @return actual port zookeeper is started
+ */
+ int getActualPort() {
+ return factory.getLocalPort();
+ }
+
+ /**
+ * Shuts down ZooKeeper.
+ *
+ * @throws IOException
+ */
+ void shutdown()
+ throws IOException {
+ if (factory != null) {
+ factory.shutdown();
+
+ U.delete(snapshotDir);
+ U.delete(logDir);
+ }
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
new file mode 100644
index 0000000..5972639
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
@@ -0,0 +1,230 @@
+/*
+ * 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.kafka;
+
+import org.apache.ignite.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import kafka.consumer.*;
+import kafka.producer.*;
+import kafka.serializer.*;
+import kafka.utils.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ * Tests {@link KafkaStreamer}.
+ */
+public class KafkaIgniteStreamerSelfTest
+ extends GridCommonAbstractTest {
+ /** Embedded Kafka. */
+ private KafkaEmbeddedBroker embeddedBroker;
+
+ /** Count. */
+ private static final int CNT = 100;
+
+ /** Test Topic. */
+ private static final String TOPIC_NAME = "page_visits";
+
+ /** Kafka Partition. */
+ private static final int PARTITIONS = 4;
+
+ /** Kafka Replication Factor. */
+ private static final int REPLICATION_FACTOR = 1;
+
+ /** Topic Message Key Prefix. */
+ private static final String KEY_PREFIX = "192.168.2.";
+
+ /** Topic Message Value Url. */
+ private static final String VALUE_URL = ",www.example.com,";
+
+ /** Constructor. */
+ public KafkaIgniteStreamerSelfTest() {
+ super(true);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void beforeTest()
+ throws Exception {
+ grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration());
+
+ embeddedBroker = new KafkaEmbeddedBroker();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void afterTest()
+ throws Exception {
+ grid().cache(null).clear();
+
+ embeddedBroker.shutdown();
+ }
+
+ /**
+ * Tests Kafka streamer.
+ *
+ * @throws TimeoutException
+ * @throws InterruptedException
+ */
+ public void testKafkaStreamer()
+ throws TimeoutException, InterruptedException {
+ embeddedBroker.createTopic(TOPIC_NAME, PARTITIONS, REPLICATION_FACTOR);
+
+ Map<String, String> keyValueMap = produceStream(TOPIC_NAME);
+ consumerStream(TOPIC_NAME, keyValueMap);
+ }
+
+ /**
+ * Produces/Sends messages to Kafka.
+ *
+ * @param topic Topic name.
+ * @return Map of key value messages.
+ */
+ private Map<String, String> produceStream(final String topic) {
+ final Map<String, String> keyValueMap = new HashMap<>();
+
+ // Generate random subnets.
+ List<Integer> subnet = new ArrayList<>();
+
+ int i = 0;
+ while (i <= CNT)
+ subnet.add(++i);
+
+ Collections.shuffle(subnet);
+
+ final List<KeyedMessage<String, String>> messages = new ArrayList<>();
+ for (int event = 0; event < CNT; event++) {
+ long runtime = new Date().getTime();
+ String ip = KEY_PREFIX + subnet.get(event);
+ String msg = runtime + VALUE_URL + ip;
+ messages.add(new KeyedMessage<>(topic, ip, msg));
+ keyValueMap.put(ip, msg);
+ }
+
+ final Producer<String, String> producer = embeddedBroker.sendMessages(messages);
+ producer.close();
+
+ return keyValueMap;
+ }
+
+ /**
+ * Consumes Kafka Stream via ignite.
+ *
+ * @param topic Topic name.
+ * @param keyValueMap Expected key value map.
+ * @throws TimeoutException TimeoutException.
+ * @throws InterruptedException InterruptedException.
+ */
+ private void consumerStream(final String topic, final Map<String, String> keyValueMap)
+ throws TimeoutException, InterruptedException {
+
+ KafkaStreamer<String, String, String> kafkaStmr = null;
+
+ final Ignite ignite = grid();
+ try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(null)) {
+
+ stmr.allowOverwrite(true);
+ stmr.autoFlushFrequency(10);
+
+ // Configure socket streamer.
+ kafkaStmr = new KafkaStreamer<>();
+
+ // Get the cache.
+ IgniteCache<String, String> cache = ignite.cache(null);
+
+ // Set ignite instance.
+ kafkaStmr.setIgnite(ignite);
+
+ // Set data streamer instance.
+ kafkaStmr.setStreamer(stmr);
+
+ // Set the topic.
+ kafkaStmr.setTopic(topic);
+
+ // Set the number of threads.
+ kafkaStmr.setThreads(4);
+
+ // Set the consumer configuration.
+ kafkaStmr.setConsumerConfig(createDefaultConsumerConfig(KafkaEmbeddedBroker.getZKAddress(),
+ "groupX"));
+
+ // Set the decoders.
+ StringDecoder stringDecoder = new StringDecoder(new VerifiableProperties());
+ kafkaStmr.setKeyDecoder(stringDecoder);
+ kafkaStmr.setValueDecoder(stringDecoder);
+
+ // Start kafka streamer.
+ kafkaStmr.start();
+
+ 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);
+ latch.await();
+
+ for (Map.Entry<String, String> entry : keyValueMap.entrySet()) {
+ final String key = entry.getKey();
+ final String value = entry.getValue();
+
+ final String cacheValue = cache.get(key);
+ assertEquals(value, cacheValue);
+ }
+ }
+
+ finally {
+ // Shutdown kafka streamer.
+ kafkaStmr.stop();
+ }
+ }
+
+ /**
+ * Creates default consumer config.
+ *
+ * @param zooKeeper Zookeeper address <server:port>.
+ * @param groupId Group Id for kafka subscriber.
+ * @return {@link ConsumerConfig} kafka consumer configuration.
+ */
+ private ConsumerConfig createDefaultConsumerConfig(String zooKeeper, String groupId) {
+ A.notNull(zooKeeper, "zookeeper");
+ A.notNull(groupId, "groupId");
+
+ Properties props = new Properties();
+ props.put("zookeeper.connect", zooKeeper);
+ props.put("group.id", groupId);
+ props.put("zookeeper.session.timeout.ms", "400");
+ props.put("zookeeper.sync.time.ms", "200");
+ props.put("auto.commit.interval.ms", "1000");
+ props.put("auto.offset.reset", "smallest");
+
+ return new ConsumerConfig(props);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
new file mode 100644
index 0000000..b836b44
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
@@ -0,0 +1,46 @@
+/*
+ * 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.kafka;
+
+import kafka.producer.*;
+
+/**
+ * Simple Partitioner for Kafka.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public class SimplePartitioner
+ implements Partitioner {
+
+ /**
+ * Partitions the key based on the key value.
+ *
+ * @param key Key.
+ * @param partitionSize Partition size.
+ * @return partition Partition.
+ */
+ public int partition(Object key, int partitionSize) {
+ int partition = 0;
+ String keyStr = (String)key;
+ String[] keyValues = keyStr.split("\\.");
+ Integer intKey = Integer.parseInt(keyValues[3]);
+ if (intKey > 0) {
+ partition = intKey % partitionSize;
+ }
+ return partition;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a6d1609..b47d34b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,6 +70,7 @@
<module>modules/gce</module>
<module>modules/cloud</module>
<module>modules/mesos</module>
+ <module>modules/kafka</module>
</modules>
<profiles>
[14/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/211ad65c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/211ad65c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/211ad65c
Branch: refs/heads/ignite-752
Commit: 211ad65cff1a7c3997e865668dfc51e44aefe0c0
Parents: 4902e8f b29ff1c
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 24 18:41:48 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 24 18:41:48 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheContext.java | 2 +-
.../distributed/dht/GridDhtLockFuture.java | 2 +-
.../GridDhtPartitionsExchangeFuture.java | 46 +-
.../datastructures/DataStructuresProcessor.java | 64 +--
.../CacheReadThroughAtomicRestartSelfTest.java | 32 ++
...heReadThroughLocalAtomicRestartSelfTest.java | 32 ++
.../CacheReadThroughLocalRestartSelfTest.java | 32 ++
...dThroughReplicatedAtomicRestartSelfTest.java | 32 ++
...cheReadThroughReplicatedRestartSelfTest.java | 32 ++
.../cache/CacheReadThroughRestartSelfTest.java | 133 ++++++
.../cache/GridCacheAbstractSelfTest.java | 2 +-
...eDynamicCacheStartNoExchangeTimeoutTest.java | 466 +++++++++++++++++++
.../cache/IgniteDynamicCacheStartSelfTest.java | 37 ++
...GridCacheQueueMultiNodeAbstractSelfTest.java | 4 +-
.../GridCacheSetAbstractSelfTest.java | 22 +-
.../IgniteDataStructureWithJobTest.java | 111 +++++
.../distributed/IgniteCache150ClientsTest.java | 189 ++++++++
...teCacheClientNodePartitionsExchangeTest.java | 1 +
.../distributed/IgniteCacheManyClientsTest.java | 1 +
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 5 -
...achePartitionedMultiNodeFullApiSelfTest.java | 49 +-
.../IgniteCacheTxStoreSessionTest.java | 4 +
.../IgniteCacheDataStructuresSelfTestSuite.java | 1 +
.../testsuites/IgniteCacheTestSuite4.java | 8 +
.../testsuites/IgniteClientTestSuite.java | 38 ++
25 files changed, 1263 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
[32/50] incubator-ignite git commit: [IGNITE-1058]: GridIoPolicy:
Switch from enum to collection of byte constants.
Posted by sb...@apache.org.
[IGNITE-1058]: GridIoPolicy: Switch from enum to collection of byte constants.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b437ec73
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b437ec73
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b437ec73
Branch: refs/heads/ignite-752
Commit: b437ec73dbc15388d1a9a526dc43e7a74abdc288
Parents: 91e1cb2
Author: iveselovskiy <iv...@gridgain.com>
Authored: Thu Jul 2 13:26:22 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Thu Jul 2 13:26:22 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/IgniteKernal.java | 1 -
.../managers/communication/GridIoManager.java | 124 +++++++++++++++----
.../managers/communication/GridIoMessage.java | 15 ++-
.../managers/communication/GridIoPolicy.java | 32 ++---
.../eventstorage/GridEventStorageManager.java | 2 +-
.../internal/processors/cache/CacheType.java | 8 +-
.../processors/cache/GridCacheContext.java | 4 +-
.../processors/cache/GridCacheIoManager.java | 12 +-
.../GridDistributedTxFinishRequest.java | 11 +-
.../GridDistributedTxPrepareRequest.java | 9 +-
.../GridDistributedTxRemoteAdapter.java | 3 +-
.../distributed/dht/GridDhtTxFinishRequest.java | 3 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 3 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 3 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 5 +-
.../near/GridNearTxFinishRequest.java | 3 +-
.../cache/distributed/near/GridNearTxLocal.java | 3 +-
.../distributed/near/GridNearTxRemote.java | 5 +-
.../cache/transactions/IgniteInternalTx.java | 3 +-
.../cache/transactions/IgniteTxAdapter.java | 11 +-
.../transactions/IgniteTxLocalAdapter.java | 3 +-
.../internal/processors/igfs/IgfsContext.java | 5 +-
.../plugin/IgnitePluginProcessor.java | 3 +-
.../plugin/extensions/communication/IoPool.java | 42 +++++++
.../communication/GridIoManagerSelfTest.java | 2 +-
.../cache/IgniteInternalCacheTypesTest.java | 3 +-
26 files changed, 202 insertions(+), 116 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 e19d3d3..30931fa 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
@@ -77,7 +77,6 @@ import javax.management.*;
import java.io.*;
import java.lang.management.*;
import java.lang.reflect.*;
-import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 d8dcc2c..c1fb79a 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
@@ -69,6 +69,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
/** Disconnect listeners. */
private final Collection<GridDisconnectListener> disconnectLsnrs = new ConcurrentLinkedQueue<>();
+ /** Map of {@link IoPool}-s injected by Ignite plugins. */
+ private final IoPool[] ioPools = new IoPool[128];
+
/** Public pool. */
private ExecutorService pubPool;
@@ -255,6 +258,41 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (log.isDebugEnabled())
log.debug(startInfo());
+
+ registerIoPoolExtensions();
+ }
+
+ /**
+ * Processes IO messaging pool extensions.
+ * @throws IgniteCheckedException On error.
+ */
+ private void registerIoPoolExtensions() throws IgniteCheckedException {
+ // Process custom IO messaging pool extensions:
+ final IoPool[] executorExtensions = ctx.plugins().extensions(IoPool.class);
+
+ if (executorExtensions != null) {
+ // Store it into the map and check for duplicates:
+ for (IoPool ex : executorExtensions) {
+ final byte id = ex.id();
+
+ // 1. Check the pool id is non-negative:
+ if (id < 0)
+ throw new IgniteCheckedException("Failed to register IO executor pool because its Id is negative " +
+ "[id=" + id + ']');
+
+ // 2. Check the pool id is in allowed range:
+ if (isReservedGridIoPolicy(id))
+ throw new IgniteCheckedException("Failed to register IO executor pool because its Id in in the " +
+ "reserved range (0-31) [id=" + id + ']');
+
+ // 3. Check the pool for duplicates:
+ if (ioPools[id] != null)
+ throw new IgniteCheckedException("Failed to register IO executor pool because its " +
+ "Id as already used [id=" + id + ']');
+
+ ioPools[id] = ex;
+ }
+ }
}
/** {@inheritDoc} */
@@ -451,6 +489,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (log.isDebugEnabled())
log.debug(stopInfo());
+
+ Arrays.fill(ioPools, null);
}
/**
@@ -518,7 +558,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
// If message is P2P, then process in P2P service.
// This is done to avoid extra waiting and potential deadlocks
// as thread pool may not have any available threads to give.
- GridIoPolicy plc = msg.policy();
+ byte plc = msg.policy();
switch (plc) {
case P2P_POOL: {
@@ -532,7 +572,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
case MANAGEMENT_POOL:
case AFFINITY_POOL:
case UTILITY_CACHE_POOL:
- case MARSH_CACHE_POOL: {
+ case MARSH_CACHE_POOL:
+ {
if (msg.isOrdered())
processOrderedMessage(nodeId, msg, plc, msgC);
else
@@ -540,6 +581,18 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
break;
}
+
+ default:
+ assert plc >= 0 : "Negative policy: " + plc;
+
+ if (isReservedGridIoPolicy(plc))
+ throw new IgniteCheckedException("Failed to process message with policy of reserved range. " +
+ "[policy=" + plc + ']');
+
+ if (msg.isOrdered())
+ processOrderedMessage(nodeId, msg, plc, msgC);
+ else
+ processRegularMessage(nodeId, msg, plc, msgC);
}
}
catch (IgniteCheckedException e) {
@@ -556,7 +609,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param plc Policy.
* @return Execution pool.
*/
- private Executor pool(GridIoPolicy plc) {
+ private Executor pool(byte plc) throws IgniteCheckedException {
switch (plc) {
case P2P_POOL:
return p2pPool;
@@ -580,10 +633,27 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
return marshCachePool;
default: {
- assert false : "Invalid communication policy: " + plc;
+ assert plc >= 0 : "Negative policy: " + plc;
+
+ if (isReservedGridIoPolicy(plc))
+ throw new IgniteCheckedException("Failed to process message with policy of reserved" +
+ " range (0-31), [policy=" + plc + ']');
+
+ IoPool pool = ioPools[plc];
+
+ if (pool == null)
+ throw new IgniteCheckedException("Failed to process message because no pool is registered " +
+ "for policy. [policy=" + plc + ']');
+
+ assert plc == pool.id();
+
+ Executor ex = pool.executor();
- // Never reached.
- return null;
+ if (ex == null)
+ throw new IgniteCheckedException("Failed to process message because corresponding executor " +
+ "is null. [id=" + plc + ']');
+
+ return ex;
}
}
}
@@ -643,9 +713,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
private void processRegularMessage(
final UUID nodeId,
final GridIoMessage msg,
- GridIoPolicy plc,
+ byte plc,
final IgniteRunnable msgC
- ) {
+ ) throws IgniteCheckedException {
Runnable c = new Runnable() {
@Override public void run() {
try {
@@ -701,9 +771,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
private void processOrderedMessage(
final UUID nodeId,
final GridIoMessage msg,
- final GridIoPolicy plc,
+ final byte plc,
@Nullable final IgniteRunnable msgC
- ) {
+ ) throws IgniteCheckedException {
assert msg != null;
long timeout = msg.timeout();
@@ -908,7 +978,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Object topic,
int topicOrd,
Message msg,
- GridIoPolicy plc,
+ byte plc,
boolean ordered,
long timeout,
boolean skipOnTimeout
@@ -916,7 +986,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
assert node != null;
assert topic != null;
assert msg != null;
- assert plc != null;
GridIoMessage ioMsg = new GridIoMessage(plc, topic, topicOrd, msg, ordered, timeout, skipOnTimeout);
@@ -956,7 +1025,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param plc Type of processing.
* @throws IgniteCheckedException Thrown in case of any errors.
*/
- public void send(UUID nodeId, Object topic, Message msg, GridIoPolicy plc)
+ public void send(UUID nodeId, Object topic, Message msg, byte plc)
throws IgniteCheckedException {
ClusterNode node = ctx.discovery().node(nodeId);
@@ -974,7 +1043,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @throws IgniteCheckedException Thrown in case of any errors.
*/
@SuppressWarnings("TypeMayBeWeakened")
- public void send(UUID nodeId, GridTopic topic, Message msg, GridIoPolicy plc)
+ public void send(UUID nodeId, GridTopic topic, Message msg, byte plc)
throws IgniteCheckedException {
ClusterNode node = ctx.discovery().node(nodeId);
@@ -991,7 +1060,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param plc Type of processing.
* @throws IgniteCheckedException Thrown in case of any errors.
*/
- public void send(ClusterNode node, Object topic, Message msg, GridIoPolicy plc)
+ public void send(ClusterNode node, Object topic, Message msg, byte plc)
throws IgniteCheckedException {
send(node, topic, -1, msg, plc, false, 0, false);
}
@@ -1003,7 +1072,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param plc Type of processing.
* @throws IgniteCheckedException Thrown in case of any errors.
*/
- public void send(ClusterNode node, GridTopic topic, Message msg, GridIoPolicy plc)
+ public void send(ClusterNode node, GridTopic topic, Message msg, byte plc)
throws IgniteCheckedException {
send(node, topic, topic.ordinal(), msg, plc, false, 0, false);
}
@@ -1021,7 +1090,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
ClusterNode node,
Object topic,
Message msg,
- GridIoPolicy plc,
+ byte plc,
long timeout,
boolean skipOnTimeout
) throws IgniteCheckedException {
@@ -1043,7 +1112,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
UUID nodeId,
Object topic,
Message msg,
- GridIoPolicy plc,
+ byte plc,
long timeout,
boolean skipOnTimeout
) throws IgniteCheckedException {
@@ -1070,7 +1139,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Collection<? extends ClusterNode> nodes,
Object topic,
Message msg,
- GridIoPolicy plc,
+ byte plc,
long timeout,
boolean skipOnTimeout
)
@@ -1091,7 +1160,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Collection<? extends ClusterNode> nodes,
Object topic,
Message msg,
- GridIoPolicy plc
+ byte plc
) throws IgniteCheckedException {
send(nodes, topic, -1, msg, plc, false, 0, false);
}
@@ -1107,7 +1176,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Collection<? extends ClusterNode> nodes,
GridTopic topic,
Message msg,
- GridIoPolicy plc
+ byte plc
) throws IgniteCheckedException {
send(nodes, topic, topic.ordinal(), msg, plc, false, 0, false);
}
@@ -1247,7 +1316,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
Object topic,
int topicOrd,
Message msg,
- GridIoPolicy plc,
+ byte plc,
boolean ordered,
long timeout,
boolean skipOnTimeout
@@ -1255,7 +1324,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
assert nodes != null;
assert topic != null;
assert msg != null;
- assert plc != null;
if (!ordered)
assert F.find(nodes, null, F.localNode(locNodeId)) == null :
@@ -1371,6 +1439,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
for (GridCommunicationMessageSet msgSet : msgSets)
unwindMessageSet(msgSet, lsnr);
}
+ catch (IgniteCheckedException ice) {
+ throw new IgniteException(ice);
+ }
}
}
@@ -1840,7 +1911,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
private final Object topic;
/** */
- private final GridIoPolicy plc;
+ private final byte plc;
/** */
@GridToStringInclude
@@ -1868,7 +1939,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param msgC Message closure (may be {@code null}).
*/
GridCommunicationMessageSet(
- GridIoPolicy plc,
+ byte plc,
Object topic,
UUID nodeId,
long timeout,
@@ -1878,7 +1949,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
) {
assert nodeId != null;
assert topic != null;
- assert plc != null;
assert msg != null;
this.plc = plc;
@@ -1971,7 +2041,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
/**
* @return Communication policy.
*/
- GridIoPolicy policy() {
+ byte policy() {
return plc;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
index 5c1122b..6cf1ae5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
@@ -33,7 +33,7 @@ public class GridIoMessage implements Message {
private static final long serialVersionUID = 0L;
/** Policy. */
- private GridIoPolicy plc;
+ private byte plc;
/** Message topic. */
@GridToStringInclude
@@ -76,7 +76,7 @@ public class GridIoMessage implements Message {
* @param skipOnTimeout Whether message can be skipped on timeout.
*/
public GridIoMessage(
- GridIoPolicy plc,
+ byte plc,
Object topic,
int topicOrd,
Message msg,
@@ -84,7 +84,6 @@ public class GridIoMessage implements Message {
long timeout,
boolean skipOnTimeout
) {
- assert plc != null;
assert topic != null;
assert topicOrd <= Byte.MAX_VALUE;
assert msg != null;
@@ -101,7 +100,7 @@ public class GridIoMessage implements Message {
/**
* @return Policy.
*/
- GridIoPolicy policy() {
+ byte policy() {
return plc;
}
@@ -203,7 +202,7 @@ public class GridIoMessage implements Message {
writer.incrementState();
case 2:
- if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
+ if (!writer.writeByte("plc", plc))
return false;
writer.incrementState();
@@ -262,14 +261,14 @@ public class GridIoMessage implements Message {
reader.incrementState();
case 2:
- byte plcOrd;
+ byte plc0;
- plcOrd = reader.readByte("plc");
+ plc0 = reader.readByte("plc");
if (!reader.isLastRead())
return false;
- plc = GridIoPolicy.fromOrdinal(plcOrd);
+ plc = plc0;
reader.incrementState();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
index 6e45043..b091d44 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
@@ -17,44 +17,38 @@
package org.apache.ignite.internal.managers.communication;
-import org.jetbrains.annotations.*;
-
/**
* This enumeration defines different types of communication
* message processing by the communication manager.
*/
-public enum GridIoPolicy {
+public class GridIoPolicy {
/** Public execution pool. */
- PUBLIC_POOL,
+ public static final byte PUBLIC_POOL = 0;
/** P2P execution pool. */
- P2P_POOL,
+ public static final byte P2P_POOL = 1;
/** System execution pool. */
- SYSTEM_POOL,
+ public static final byte SYSTEM_POOL = 2;
/** Management execution pool. */
- MANAGEMENT_POOL,
+ public static final byte MANAGEMENT_POOL = 3;
/** Affinity fetch pool. */
- AFFINITY_POOL,
+ public static final byte AFFINITY_POOL = 4;
/** Utility cache execution pool. */
- UTILITY_CACHE_POOL,
+ public static final byte UTILITY_CACHE_POOL = 5;
/** Marshaller cache execution pool. */
- MARSH_CACHE_POOL;
-
- /** Enum values. */
- private static final GridIoPolicy[] VALS = values();
+ public static final byte MARSH_CACHE_POOL = 6;
/**
- * Efficiently gets enumerated value from its ordinal.
- *
- * @param ord Ordinal value.
- * @return Enumerated value.
+ * Defines the range of reserved pools that are not available for plugins.
+ * @param key The key.
+ * @return If the key corresponds to reserved pool range.
*/
- @Nullable public static GridIoPolicy fromOrdinal(int ord) {
- return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
+ public static boolean isReservedGridIoPolicy(byte key) {
+ return key >= 0 && key <= 31;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 95c5eb1..365076b 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
@@ -986,7 +986,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
* @throws IgniteCheckedException If sending failed.
*/
private void sendMessage(Collection<? extends ClusterNode> nodes, GridTopic topic,
- GridEventStorageMessage msg, GridIoPolicy plc) throws IgniteCheckedException {
+ GridEventStorageMessage msg, byte plc) throws IgniteCheckedException {
ClusterNode locNode = F.find(nodes, null, F.localNode(ctx.localNodeId()));
Collection<? extends ClusterNode> rmtNodes = F.view(nodes, F.remoteNodes(ctx.localNodeId()));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java
index e0747b9..954bfe5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java
@@ -17,8 +17,6 @@
package org.apache.ignite.internal.processors.cache;
-import org.apache.ignite.internal.managers.communication.*;
-
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
/**
@@ -49,13 +47,13 @@ public enum CacheType {
private final boolean userCache;
/** */
- private final GridIoPolicy ioPlc;
+ private final byte ioPlc;
/**
* @param userCache {@code True} if cache created by user.
* @param ioPlc Cache IO policy.
*/
- CacheType(boolean userCache, GridIoPolicy ioPlc) {
+ CacheType(boolean userCache, byte ioPlc) {
this.userCache = userCache;
this.ioPlc = ioPlc;
}
@@ -63,7 +61,7 @@ public enum CacheType {
/**
* @return Cache IO policy.
*/
- public GridIoPolicy ioPolicy() {
+ public byte ioPolicy() {
return ioPlc;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 9b7801c..580e452 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -170,7 +170,7 @@ public class GridCacheContext<K, V> implements Externalizable {
private CacheType cacheType;
/** IO policy. */
- private GridIoPolicy plc;
+ private byte plc;
/** Default expiry policy. */
private ExpiryPolicy expiryPlc;
@@ -459,7 +459,7 @@ public class GridCacheContext<K, V> implements Externalizable {
/**
* @return IO policy for the given cache.
*/
- public GridIoPolicy ioPolicy() {
+ public byte ioPolicy() {
return plc;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 74a4512..0707096 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
@@ -309,7 +309,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
* @param plc grid io policy.
*/
private void sendResponseOnFailedMessage(UUID nodeId, GridCacheMessage res, GridCacheSharedContext cctx,
- GridIoPolicy plc) {
+ byte plc) {
try {
cctx.io().send(nodeId, res, plc);
}
@@ -580,7 +580,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
* @throws ClusterTopologyCheckedException If receiver left.
*/
@SuppressWarnings("unchecked")
- public void send(ClusterNode node, GridCacheMessage msg, GridIoPolicy plc) throws IgniteCheckedException {
+ public void send(ClusterNode node, GridCacheMessage msg, byte plc) throws IgniteCheckedException {
assert !node.isLocal();
onSend(msg, node.id());
@@ -627,7 +627,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
* @throws IgniteCheckedException If send failed.
*/
@SuppressWarnings({"BusyWait", "unchecked"})
- public boolean safeSend(Collection<? extends ClusterNode> nodes, GridCacheMessage msg, GridIoPolicy plc,
+ public boolean safeSend(Collection<? extends ClusterNode> nodes, GridCacheMessage msg, byte plc,
@Nullable IgnitePredicate<ClusterNode> fallback) throws IgniteCheckedException {
assert nodes != null;
assert msg != null;
@@ -739,7 +739,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
* @param plc IO policy.
* @throws IgniteCheckedException If sending failed.
*/
- public void send(UUID nodeId, GridCacheMessage msg, GridIoPolicy plc) throws IgniteCheckedException {
+ public void send(UUID nodeId, GridCacheMessage msg, byte plc) throws IgniteCheckedException {
ClusterNode n = cctx.discovery().node(nodeId);
if (n == null)
@@ -757,7 +757,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
* @param timeout Timeout to keep a message on receiving queue.
* @throws IgniteCheckedException Thrown in case of any errors.
*/
- public void sendOrderedMessage(ClusterNode node, Object topic, GridCacheMessage msg, GridIoPolicy plc,
+ public void sendOrderedMessage(ClusterNode node, Object topic, GridCacheMessage msg, byte plc,
long timeout) throws IgniteCheckedException {
onSend(msg, node.id());
@@ -807,7 +807,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
*/
public void sendNoRetry(ClusterNode node,
GridCacheMessage msg,
- GridIoPolicy plc)
+ byte plc)
throws IgniteCheckedException
{
assert node != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 986e211..7a84f9a 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,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed;
import org.apache.ignite.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.tostring.*;
@@ -68,7 +67,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
private boolean sys;
/** IO policy. */
- private GridIoPolicy plc;
+ private byte plc;
/**
* Empty constructor required by {@link Externalizable}.
@@ -99,7 +98,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
boolean commit,
boolean invalidate,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
boolean syncCommit,
boolean syncRollback,
GridCacheVersion baseVer,
@@ -135,7 +134,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
/**
* @return IO policy.
*/
- public GridIoPolicy policy() {
+ public byte policy() {
return plc;
}
@@ -268,7 +267,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
writer.incrementState();
case 12:
- if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
+ if (!writer.writeByte("plc", plc))
return false;
writer.incrementState();
@@ -367,7 +366,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
if (!reader.isLastRead())
return false;
- plc = GridIoPolicy.fromOrdinal(plcOrd);
+ plc = plcOrd;
reader.incrementState();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 3078277..20aa833 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
@@ -19,7 +19,6 @@ 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.*;
@@ -105,7 +104,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
private boolean sys;
/** IO policy. */
- private GridIoPolicy plc;
+ private byte plc;
/**
* Required by {@link Externalizable}.
@@ -163,7 +162,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
/**
* @return IO policy.
*/
- public GridIoPolicy policy() {
+ public byte policy() {
return plc;
}
@@ -377,7 +376,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
writer.incrementState();
case 13:
- if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
+ if (!writer.writeByte("plc", plc))
return false;
writer.incrementState();
@@ -510,7 +509,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
if (!reader.isLastRead())
return false;
- plc = GridIoPolicy.fromOrdinal(plcOrd);
+ plc = plcOrd;
reader.incrementState();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 ac5395d..ef5d3d9 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
@@ -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.affinity.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.processors.cache.transactions.*;
@@ -105,7 +104,7 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
GridCacheVersion xidVer,
GridCacheVersion commitVer,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
boolean invalidate,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 a493ebb..fe72b24 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
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
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.version.*;
import org.apache.ignite.internal.util.tostring.*;
@@ -111,7 +110,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
boolean commit,
boolean invalidate,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
boolean sysInvalidate,
boolean syncCommit,
boolean syncRollback,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 841cac8..6a72c89 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
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.processors.affinity.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
@@ -106,7 +105,7 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
boolean implicitSingle,
boolean sys,
boolean explicitLock,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 90edb0f..b50a010 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
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
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.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
@@ -100,7 +99,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
boolean implicitSingle,
boolean sys,
boolean explicitLock,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 0a69910..ae13a10 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
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
@@ -90,7 +89,7 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
GridCacheVersion xidVer,
GridCacheVersion commitVer,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
boolean invalidate,
@@ -149,7 +148,7 @@ public class GridDhtTxRemote extends GridDistributedTxRemoteAdapter {
GridCacheVersion xidVer,
GridCacheVersion commitVer,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
boolean invalidate,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 15f42ff..26e4bdc 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
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
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.version.*;
import org.apache.ignite.internal.util.tostring.*;
@@ -84,7 +83,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
boolean commit,
boolean invalidate,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
boolean syncCommit,
boolean syncRollback,
boolean explicitLock,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 fa8877a..cb391e4 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
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
@@ -111,7 +110,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
boolean implicit,
boolean implicitSingle,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 49283cb..4ac81f8 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
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.transactions.*;
@@ -86,7 +85,7 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
GridCacheVersion xidVer,
GridCacheVersion commitVer,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
boolean invalidate,
@@ -143,7 +142,7 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
GridCacheVersion xidVer,
GridCacheVersion commitVer,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
boolean invalidate,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 cb86e0d..b16e950 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
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.transactions;
import org.apache.ignite.*;
import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.version.*;
@@ -246,7 +245,7 @@ public interface IgniteInternalTx extends AutoCloseable, GridTimeoutObject {
/**
* @return Pool where message for the given transaction must be processed.
*/
- public GridIoPolicy ioPolicy();
+ public byte ioPolicy();
/**
* @return Last recorded topology version.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 9e8950f..709c208 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
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.transactions;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
@@ -136,7 +135,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
private boolean sys;
/** IO policy. */
- private GridIoPolicy plc;
+ private byte plc;
/** */
protected boolean onePhaseCommit;
@@ -238,7 +237,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
boolean implicitSingle,
boolean loc,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
@@ -296,7 +295,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
GridCacheVersion startVer,
long threadId,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
@@ -399,7 +398,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
}
/** {@inheritDoc} */
- @Override public GridIoPolicy ioPolicy() {
+ @Override public byte ioPolicy() {
return plc;
}
@@ -1716,7 +1715,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
}
- @Override public GridIoPolicy ioPolicy() {
+ @Override public byte ioPolicy() {
throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/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 7bc9042..0a61b1a 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
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.transactions;
import org.apache.ignite.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
@@ -128,7 +127,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
boolean implicit,
boolean implicitSingle,
boolean sys,
- GridIoPolicy plc,
+ byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
index 475a7fc..24b56d3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
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.util.typedef.*;
import org.jetbrains.annotations.*;
@@ -148,7 +147,7 @@ public class IgfsContext {
* @param plc Policy.
* @throws IgniteCheckedException In case of error.
*/
- public void send(UUID nodeId, Object topic, IgfsCommunicationMessage msg, GridIoPolicy plc)
+ public void send(UUID nodeId, Object topic, IgfsCommunicationMessage msg, byte plc)
throws IgniteCheckedException {
if (!kernalContext().localNodeId().equals(nodeId))
msg.prepareMarshal(kernalContext().config().getMarshaller());
@@ -163,7 +162,7 @@ public class IgfsContext {
* @param plc Policy.
* @throws IgniteCheckedException In case of error.
*/
- public void send(ClusterNode node, Object topic, IgfsCommunicationMessage msg, GridIoPolicy plc)
+ public void send(ClusterNode node, Object topic, IgfsCommunicationMessage msg, byte plc)
throws IgniteCheckedException {
if (!kernalContext().localNodeId().equals(node.id()))
msg.prepareMarshal(kernalContext().config().getMarshaller());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
index ecc6924..5e24b4b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
@@ -28,7 +28,6 @@ import org.jetbrains.annotations.*;
import java.io.*;
import java.lang.reflect.*;
-import java.security.*;
import java.util.*;
/**
@@ -176,7 +175,7 @@ public class IgnitePluginProcessor extends GridProcessorAdapter {
}
/**
- * Print plugin information.
+ * Print plugins information.
*/
private void ackPluginsInfo() {
U.quietAndInfo(log, "Configured plugins:");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java
new file mode 100644
index 0000000..e87b82c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java
@@ -0,0 +1,42 @@
+/*
+ * 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.plugin.extensions.communication;
+
+import org.apache.ignite.plugin.*;
+
+import java.util.concurrent.*;
+
+/**
+ * The interface of IO Messaging Pool Extension.
+ */
+public interface IoPool extends Extension {
+ /**
+ * Gets the numeric identifier of the pool. This identifier is to be taken from serialized
+ * message and used to find the appropriate executor pool to process it.
+ *
+ * @return The id.
+ */
+ public byte id();
+
+ /**
+ * Gets the Executor for this Pool. Cannot be null.
+ *
+ * @return The executor.
+ */
+ public Executor executor();
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
index 3890716..eb1fd88 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
@@ -189,7 +189,7 @@ public class GridIoManagerSelfTest extends GridCommonAbstractTest {
}
/** {@inheritDoc} */
- @Override public void send(ClusterNode node, GridTopic topic, Message msg, GridIoPolicy plc)
+ @Override public void send(ClusterNode node, GridTopic topic, Message msg, byte plc)
throws IgniteCheckedException {
// No-op.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b437ec73/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
index c9da7c5..8c2a0f8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -146,7 +145,7 @@ public class IgniteInternalCacheTypesTest extends GridCommonAbstractTest {
private void checkCache(
Ignite ignite,
String name,
- GridIoPolicy plc,
+ byte plc,
boolean user,
boolean sysTx) {
GridCacheAdapter cache = ((IgniteKernal)ignite).context().cache().internalCache(name);
[22/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ac93958d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ac93958d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ac93958d
Branch: refs/heads/ignite-752
Commit: ac93958d21ef33d98bb223904131bf1bf54a7cf2
Parents: 0cb2d97 68c21ac
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Mon Jun 29 17:40:01 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Mon Jun 29 17:40:01 2015 -0700
----------------------------------------------------------------------
.../ignite/internal/GridKernalContextImpl.java | 2 +-
.../discovery/GridDiscoveryManager.java | 6 +
.../cache/GridCacheDeploymentManager.java | 10 +-
.../processors/cache/GridCacheProcessor.java | 62 ++++--
.../shmem/IpcSharedMemoryServerEndpoint.java | 10 +-
.../apache/ignite/internal/visor/VisorJob.java | 2 +
.../internal/visor/log/VisorLogSearchTask.java | 2 +-
.../visor/node/VisorNodeDataCollectorJob.java | 4 +
.../util/VisorClusterGroupEmptyException.java | 6 +-
.../cache/GridCacheDaemonNodeStopSelfTest.java | 119 ------------
.../IgniteDaemonNodeMarshallerCacheTest.java | 192 +++++++++++++++++++
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 +
.../testsuites/IgniteCacheTestSuite3.java | 1 -
pom.xml | 12 +-
14 files changed, 282 insertions(+), 147 deletions(-)
----------------------------------------------------------------------
[47/50] incubator-ignite git commit: disable failing test
Posted by sb...@apache.org.
disable failing 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/b1342ba1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b1342ba1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b1342ba1
Branch: refs/heads/ignite-752
Commit: b1342ba19078bd8f742d4d1d605bd9ccc19c82b5
Parents: 334fee9
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 6 10:30:23 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 6 10:30:23 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheAtomicReplicatedNodeRestartSelfTest.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b1342ba1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index 52d8871..c802d7c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -27,7 +27,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheReplicatedNodeRestartSelfTest {
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-747");
+ //fail("https://issues.apache.org/jira/browse/IGNITE-747");
}
/** {@inheritDoc} */
@@ -36,6 +36,11 @@ public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheRep
}
/** {@inheritDoc} */
+ @Override public void testRestartWithPutEightNodesTwoBackups() throws Throwable {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1095");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return ATOMIC;
}
[39/50] incubator-ignite git commit: muted
GridCachePartitionedFailoverSelfTest
Posted by sb...@apache.org.
muted GridCachePartitionedFailoverSelfTest
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7828d19f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7828d19f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7828d19f
Branch: refs/heads/ignite-752
Commit: 7828d19f3fc2b3793c2882ac1305b95960646e5c
Parents: beb697a
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jul 3 16:43:17 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jul 3 16:43:17 2015 +0300
----------------------------------------------------------------------
.../distributed/near/GridCachePartitionedFailoverSelfTest.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7828d19f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
index 553d748..64e8f81 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCachePartitionedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1092");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
[35/50] incubator-ignite git commit: Merge branches 'ignite-973-2'
and 'ignite-sprint-7' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Posted by sb...@apache.org.
Merge branches 'ignite-973-2' and 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a0a31e22
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a0a31e22
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a0a31e22
Branch: refs/heads/ignite-752
Commit: a0a31e221b215a3ac0477d083064200991c241e2
Parents: cbbb6a1 c866902
Author: S.Vladykin <sv...@gridgain.com>
Authored: Thu Jul 2 10:56:22 2015 -0700
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Thu Jul 2 10:56:22 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/internal/IgniteKernal.java | 1 -
.../managers/communication/GridIoManager.java | 124 +++++++++++++++----
.../managers/communication/GridIoMessage.java | 15 ++-
.../managers/communication/GridIoPolicy.java | 32 ++---
.../eventstorage/GridEventStorageManager.java | 2 +-
.../internal/processors/cache/CacheType.java | 8 +-
.../processors/cache/GridCacheContext.java | 4 +-
.../processors/cache/GridCacheIoManager.java | 12 +-
.../GridDistributedTxFinishRequest.java | 11 +-
.../GridDistributedTxPrepareRequest.java | 9 +-
.../GridDistributedTxRemoteAdapter.java | 3 +-
.../distributed/dht/GridDhtTxFinishRequest.java | 3 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 3 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 3 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 5 +-
.../near/GridNearTxFinishRequest.java | 3 +-
.../cache/distributed/near/GridNearTxLocal.java | 3 +-
.../distributed/near/GridNearTxRemote.java | 5 +-
.../cache/transactions/IgniteInternalTx.java | 3 +-
.../cache/transactions/IgniteTxAdapter.java | 11 +-
.../transactions/IgniteTxLocalAdapter.java | 3 +-
.../internal/processors/igfs/IgfsContext.java | 5 +-
.../plugin/IgnitePluginProcessor.java | 3 +-
.../plugin/extensions/communication/IoPool.java | 42 +++++++
.../ignite/spi/discovery/tcp/ClientImpl.java | 5 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 5 +-
.../TcpDiscoveryMulticastIpFinder.java | 2 +-
.../communication/GridIoManagerSelfTest.java | 2 +-
.../cache/IgniteInternalCacheTypesTest.java | 3 +-
.../GridCacheEvictionFilterSelfTest.java | 2 -
.../extdata/uri/modules/uri-dependency/pom.xml | 30 ++---
.../deployment/uri/tasks/gar-spring-bean.xml | 30 ++---
modules/urideploy/pom.xml | 14 ---
33 files changed, 239 insertions(+), 167 deletions(-)
----------------------------------------------------------------------
[30/50] incubator-ignite git commit: project release fix
Posted by sb...@apache.org.
project release 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/872fc387
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/872fc387
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/872fc387
Branch: refs/heads/ignite-752
Commit: 872fc387aa6f839123c9a9fbb0b100f2c989e65c
Parents: 7ea64e0
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Thu Jul 2 11:00:30 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Thu Jul 2 11:00:30 2015 +0300
----------------------------------------------------------------------
modules/urideploy/pom.xml | 14 --------------
1 file changed, 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/872fc387/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 4e971d7..76a862b 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -143,19 +143,5 @@
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>org.apache.ignite</groupId>
- <artifactId>ignite-extdata-uri</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ignite</groupId>
- <artifactId>ignite-extdata-p2p</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
[21/50] incubator-ignite git commit: IGNITE-621 - Fixing tests.
Posted by sb...@apache.org.
IGNITE-621 - Fixing tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0cb2d97c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0cb2d97c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0cb2d97c
Branch: refs/heads/ignite-752
Commit: 0cb2d97c61603017909ff6ffc4908f93b2384ec0
Parents: d24658d
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Mon Jun 29 17:39:42 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Mon Jun 29 17:39:42 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 3 ---
.../dht/atomic/GridNearAtomicUpdateFuture.java | 23 ++++++++++----------
2 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb2d97c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 37b57e6..4b1a58f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -146,9 +146,6 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
GridDhtAtomicUpdateRequest req = mappings.get(nodeId);
if (req != null) {
- updateRes.addFailedKeys(req.keys(), new ClusterTopologyCheckedException("Failed to write keys on backup " +
- "(node left grid before response is received): " + nodeId));
-
// Remove only after added keys to failed set.
mappings.remove(nodeId);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb2d97c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index ea9b335..41cc400 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -328,12 +328,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
else {
topLocked = true;
- synchronized (this) {
- this.topVer = topVer;
-
- // Cannot remap.
- remapCnt.set(1);
- }
+ // Cannot remap.
+ remapCnt.set(1);
map0(topVer, null, false, null);
}
@@ -452,6 +448,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
+ if (F.isEmpty(cause.failedKeys()))
+ cause.printStackTrace();
+
remap(cause.failedKeys());
return false;
@@ -609,10 +608,6 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return;
}
-
- synchronized (this) {
- this.topVer = topVer;
- }
}
finally {
cache.topology().readUnlock();
@@ -786,7 +781,11 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
conflictVer,
true);
- single = true;
+ synchronized (this) {
+ this.topVer = topVer;
+
+ single = true;
+ }
// Optimize mapping for single key.
mapSingle(primary.id(), req);
@@ -942,6 +941,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
}
+ this.topVer = topVer;
+
fastMapRemap = false;
}
[05/50] incubator-ignite git commit: IGNITE-621 - Retries.
Posted by sb...@apache.org.
IGNITE-621 - Retries.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c94c0c47
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c94c0c47
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c94c0c47
Branch: refs/heads/ignite-752
Commit: c94c0c475b8d8ac5c31302235d0de36f791fc3a0
Parents: 5505b4d
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Sun Jun 21 22:40:01 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Sun Jun 21 22:40:01 2015 -0700
----------------------------------------------------------------------
.../dht/atomic/GridNearAtomicUpdateFuture.java | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c94c0c47/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 53150cc..536eb40 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -338,19 +338,21 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
cctx.mvcc().removeAtomicFuture(version());
Collection<Object> remapKeys = new ArrayList<>(failed.size());
- Collection<Object> remapVals = new ArrayList<>(failed.size());
+ Collection<Object> remapVals = vals != null ? new ArrayList<>(failed.size()) : null;
Iterator<?> keyIt = keys.iterator();
- Iterator<?> valsIt = vals.iterator();
+ Iterator<?> valsIt = vals != null ? vals.iterator() : null;
for (Object key : failed) {
while (keyIt.hasNext()) {
Object nextKey = keyIt.next();
- Object nextVal = valsIt.next();
+ Object nextVal = valsIt != null ? valsIt.next() : null;
if (F.eq(key, nextKey)) {
remapKeys.add(nextKey);
- remapVals.add(nextVal);
+
+ if (remapVals != null)
+ remapVals.add(nextVal);
break;
}
@@ -388,8 +390,13 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (op == TRANSFORM && retval == null)
retval = Collections.emptyMap();
- if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) && remapCnt.decrementAndGet() > 0) {
- remap(X.cause(err, CachePartialUpdateCheckedException.class).failedKeys());
+ if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) &&
+ X.hasCause(err, ClusterTopologyCheckedException.class) &&
+ remapCnt.decrementAndGet() > 0) {
+
+ CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
+
+ remap(cause.failedKeys());
return false;
}
[20/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
into ignite-gg-10416
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' into ignite-gg-10416
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7e82a682
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7e82a682
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7e82a682
Branch: refs/heads/ignite-752
Commit: 7e82a6826233f94c1601d0c68526a179d5d1104b
Parents: 0acdc2f c6187a9
Author: Andrey <an...@gridgain.com>
Authored: Mon Jun 29 13:32:10 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Jun 29 13:32:10 2015 +0700
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
.../s3/S3CheckpointManagerSelfTest.java | 2 +-
.../checkpoint/s3/S3CheckpointSpiSelfTest.java | 4 +-
.../s3/S3CheckpointSpiStartStopSelfTest.java | 2 +-
.../s3/S3SessionCheckpointSelfTest.java | 2 +-
.../s3/TcpDiscoveryS3IpFinderSelfTest.java | 2 +-
modules/clients/pom.xml | 2 +-
.../ClientAbstractConnectivitySelfTest.java | 4 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../org/apache/ignite/cluster/ClusterGroup.java | 18 +-
.../org/apache/ignite/cluster/ClusterNode.java | 2 +
.../ignite/compute/ComputeTaskSplitAdapter.java | 2 +-
.../configuration/IgniteReflectionFactory.java | 81 +-
.../ignite/internal/GridKernalContextImpl.java | 3 +
.../ignite/internal/MarshallerContextImpl.java | 12 +-
.../client/GridClientConfiguration.java | 4 +-
.../internal/cluster/ClusterGroupAdapter.java | 50 +-
.../cluster/IgniteClusterAsyncImpl.java | 12 +-
.../internal/managers/GridManagerAdapter.java | 8 +-
.../discovery/GridDiscoveryManager.java | 30 +-
.../affinity/AffinityTopologyVersion.java | 7 -
.../processors/cache/GridCacheAdapter.java | 4 +
.../processors/cache/GridCacheContext.java | 2 +-
.../processors/cache/GridCacheIoManager.java | 64 +-
.../GridCachePartitionExchangeManager.java | 77 +-
.../processors/cache/GridCacheSwapManager.java | 12 +-
.../processors/cache/GridCacheUtils.java | 9 +
.../processors/cache/IgniteCacheProxy.java | 12 +
.../distributed/dht/GridDhtLocalPartition.java | 59 +-
.../distributed/dht/GridDhtLockFuture.java | 2 +-
.../dht/GridDhtPartitionTopologyImpl.java | 4 +-
.../dht/GridDhtPartitionsReservation.java | 292 +++++++
.../dht/GridDhtTransactionalCacheAdapter.java | 2 +-
.../cache/distributed/dht/GridReservable.java | 35 +
.../dht/atomic/GridDhtAtomicCache.java | 9 +-
.../dht/preloader/GridDhtPartitionMap.java | 26 +-
.../GridDhtPartitionsExchangeFuture.java | 95 ++-
.../cache/query/GridCacheQueryManager.java | 33 -
.../cache/query/GridCacheTwoStepQuery.java | 22 +-
.../continuous/CacheContinuousQueryHandler.java | 8 +
.../cache/transactions/IgniteTxHandler.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 12 +-
.../datastructures/DataStructuresProcessor.java | 64 +-
.../dr/IgniteDrDataStreamerCacheUpdater.java | 7 +-
.../processors/hadoop/HadoopJobInfo.java | 4 +-
.../hadoop/counter/HadoopCounterWriter.java | 5 +-
.../offheap/GridOffHeapProcessor.java | 19 +-
.../processors/plugin/CachePluginManager.java | 10 +-
.../processors/query/GridQueryIndexing.java | 14 +-
.../processors/query/GridQueryProcessor.java | 21 +-
.../messages/GridQueryNextPageResponse.java | 34 +-
.../h2/twostep/messages/GridQueryRequest.java | 111 ++-
.../processors/rest/GridRestProcessor.java | 4 +-
.../handlers/task/GridTaskCommandHandler.java | 12 +-
.../processors/task/GridTaskProcessor.java | 23 +-
.../processors/task/GridTaskWorker.java | 4 +-
.../internal/util/GridConfigurationFinder.java | 55 +-
.../apache/ignite/internal/util/GridDebug.java | 48 +-
.../ignite/internal/util/IgniteUtils.java | 6 +-
.../ignite/internal/util/nio/GridNioServer.java | 64 +-
.../apache/ignite/internal/visor/VisorJob.java | 2 +
.../internal/visor/log/VisorLogSearchTask.java | 2 +-
.../visor/node/VisorNodeDataCollectorJob.java | 4 +
.../visor/query/VisorQueryCleanupTask.java | 14 +
.../util/VisorClusterGroupEmptyException.java | 33 +
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 7 +-
.../org/apache/ignite/spi/IgniteSpiContext.java | 9 +-
.../communication/tcp/TcpCommunicationSpi.java | 146 +++-
.../tcp/TcpCommunicationSpiMBean.java | 19 +
.../ignite/spi/discovery/DiscoverySpi.java | 3 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 229 ++++--
.../ignite/spi/discovery/tcp/ServerImpl.java | 155 +++-
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 3 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 51 +-
.../tcp/internal/TcpDiscoveryNode.java | 18 +
.../messages/TcpDiscoveryNodeFailedMessage.java | 18 +
.../core/src/main/resources/ignite.properties | 2 +-
.../internal/ClusterGroupAbstractTest.java | 777 ++++++++++++++++++
.../internal/ClusterGroupHostsSelfTest.java | 141 ++++
.../ignite/internal/ClusterGroupSelfTest.java | 251 ++++++
.../internal/GridDiscoveryEventSelfTest.java | 12 +-
...ridFailFastNodeFailureDetectionSelfTest.java | 17 +-
.../internal/GridProjectionAbstractTest.java | 784 -------------------
.../ignite/internal/GridProjectionSelfTest.java | 251 ------
.../apache/ignite/internal/GridSelfTest.java | 22 +-
.../GridTaskFailoverAffinityRunTest.java | 170 ++++
.../IgniteSlowClientDetectionSelfTest.java | 187 +++++
.../CacheReadThroughAtomicRestartSelfTest.java | 32 +
...heReadThroughLocalAtomicRestartSelfTest.java | 32 +
.../CacheReadThroughLocalRestartSelfTest.java | 32 +
...dThroughReplicatedAtomicRestartSelfTest.java | 32 +
...cheReadThroughReplicatedRestartSelfTest.java | 32 +
.../cache/CacheReadThroughRestartSelfTest.java | 133 ++++
.../CacheStoreUsageMultinodeAbstractTest.java | 305 ++++++++
...eUsageMultinodeDynamicStartAbstractTest.java | 169 ++++
...oreUsageMultinodeDynamicStartAtomicTest.java | 32 +
...heStoreUsageMultinodeDynamicStartTxTest.java | 32 +
...reUsageMultinodeStaticStartAbstractTest.java | 158 ++++
...toreUsageMultinodeStaticStartAtomicTest.java | 32 +
...cheStoreUsageMultinodeStaticStartTxTest.java | 32 +
.../GridCacheAbstractFailoverSelfTest.java | 6 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 24 +-
.../cache/GridCacheAbstractSelfTest.java | 2 +-
.../cache/GridCacheDaemonNodeStopSelfTest.java | 119 +++
.../IgniteCacheAbstractStopBusySelfTest.java | 30 +-
.../IgniteCacheAtomicStopBusySelfTest.java | 8 +-
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 19 +-
...gniteCacheTransactionalStopBusySelfTest.java | 8 +-
...eDynamicCacheStartNoExchangeTimeoutTest.java | 466 +++++++++++
.../cache/IgniteDynamicCacheStartSelfTest.java | 37 +
...GridCacheQueueMultiNodeAbstractSelfTest.java | 4 +-
.../GridCacheSetAbstractSelfTest.java | 22 +-
.../IgniteDataStructureWithJobTest.java | 111 +++
.../distributed/IgniteCache150ClientsTest.java | 189 +++++
...teCacheClientNodePartitionsExchangeTest.java | 1 +
.../distributed/IgniteCacheManyClientsTest.java | 2 +
.../IgniteCacheTxMessageRecoveryTest.java | 5 +
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 5 -
...achePartitionedMultiNodeFullApiSelfTest.java | 53 +-
.../GridCacheReplicatedFailoverSelfTest.java | 5 +
.../IgniteCacheTxStoreSessionTest.java | 4 +
.../DataStreamerMultiThreadedSelfTest.java | 3 +
.../internal/util/IgniteUtilsSelfTest.java | 22 +
.../GridTcpCommunicationSpiConfigSelfTest.java | 1 -
.../tcp/TcpClientDiscoverySpiSelfTest.java | 265 ++++++-
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 44 +-
.../testframework/GridSpiTestContext.java | 7 +-
.../testframework/junits/GridAbstractTest.java | 2 +-
.../junits/GridTestKernalContext.java | 2 +-
.../junits/common/GridCommonAbstractTest.java | 8 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 7 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 1 +
.../ignite/testsuites/IgniteCacheTestSuite.java | 4 +-
.../testsuites/IgniteCacheTestSuite3.java | 1 +
.../testsuites/IgniteCacheTestSuite4.java | 12 +
.../testsuites/IgniteClientTestSuite.java | 38 +
.../testsuites/IgniteComputeGridTestSuite.java | 1 +
modules/extdata/p2p/pom.xml | 2 +-
.../p2p/GridP2PContinuousDeploymentTask1.java | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 80 +-
.../fs/IgniteHadoopFileSystemCounterWriter.java | 9 +-
.../processors/hadoop/HadoopClassLoader.java | 29 +
.../processors/hadoop/HadoopDefaultJobInfo.java | 27 +-
.../internal/processors/hadoop/HadoopUtils.java | 237 ------
.../hadoop/SecondaryFileSystemProvider.java | 3 +-
.../hadoop/fs/HadoopFileSystemCacheUtils.java | 241 ++++++
.../hadoop/fs/HadoopFileSystemsUtils.java | 11 +
.../hadoop/fs/HadoopLazyConcurrentMap.java | 5 +
.../hadoop/jobtracker/HadoopJobTracker.java | 25 +-
.../child/HadoopChildProcessRunner.java | 3 +-
.../processors/hadoop/v2/HadoopV2Job.java | 84 +-
.../hadoop/v2/HadoopV2JobResourceManager.java | 22 +-
.../hadoop/v2/HadoopV2TaskContext.java | 37 +-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 5 +-
.../processors/hadoop/HadoopMapReduceTest.java | 2 +-
.../processors/hadoop/HadoopTasksV1Test.java | 7 +-
.../processors/hadoop/HadoopTasksV2Test.java | 7 +-
.../processors/hadoop/HadoopV2JobSelfTest.java | 6 +-
.../collections/HadoopAbstractMapTest.java | 3 +-
.../testsuites/IgniteHadoopTestSuite.java | 2 +-
.../IgniteIgfsLinuxAndMacOSTestSuite.java | 3 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
.../processors/query/h2/IgniteH2Indexing.java | 81 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 49 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 321 ++++++--
.../query/h2/twostep/GridMergeIndex.java | 17 +-
.../h2/twostep/GridMergeIndexUnsorted.java | 7 +-
.../h2/twostep/GridReduceQueryExecutor.java | 650 ++++++++++++---
.../query/h2/twostep/GridResultPage.java | 21 +-
.../cache/GridCacheCrossCacheQuerySelfTest.java | 3 +-
.../cache/IgniteCacheOffheapEvictQueryTest.java | 196 +++++
.../IgniteCacheQueryMultiThreadedSelfTest.java | 1 -
...QueryOffheapEvictsMultiThreadedSelfTest.java | 5 +
...lientQueryReplicatedNodeRestartSelfTest.java | 419 ++++++++++
.../IgniteCacheQueryNodeRestartSelfTest.java | 36 +-
.../IgniteCacheQueryNodeRestartSelfTest2.java | 383 +++++++++
.../IgniteCacheQuerySelfTestSuite.java | 5 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
.../cache/jta/GridCacheXAResource.java | 18 +-
.../processors/cache/GridCacheJtaSelfTest.java | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/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/spark-2.10/pom.xml | 2 +-
modules/spark/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-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
.../commands/cache/VisorCacheCommand.scala | 7 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
scripts/git-patch-prop.sh | 2 +-
213 files changed, 8348 insertions(+), 2249 deletions(-)
----------------------------------------------------------------------
[16/50] incubator-ignite git commit: IGNITE-621 - Fixing remap logic.
Posted by sb...@apache.org.
IGNITE-621 - Fixing remap logic.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c2c90b52
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c2c90b52
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c2c90b52
Branch: refs/heads/ignite-752
Commit: c2c90b52972bec53919d97ec07d2aeab4d0d55e8
Parents: a9d0662
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jun 25 17:06:31 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jun 25 17:06:31 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../processors/cache/GridCacheAdapter.java | 2 +-
.../processors/cache/GridCacheAtomicFuture.java | 12 ++-
.../processors/cache/GridCacheMvccManager.java | 8 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 12 ++-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 88 ++++++++++++++++++--
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
...eAtomicInvalidPartitionHandlingSelfTest.java | 7 +-
8 files changed, 110 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 542fa30..40fc873 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -343,6 +343,9 @@ public final class IgniteSystemProperties {
/** Maximum size for affinity assignment history. */
public static final String IGNITE_AFFINITY_HISTORY_SIZE = "IGNITE_AFFINITY_HISTORY_SIZE";
+ /** Number of cache operation retries in case of topology exceptions. */
+ public static final String IGNITE_CACHE_RETRIES_COUNT = "IGNITE_CACHE_RETRIES_COUNT";
+
/**
* Enforces singleton.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/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 f993527..e138520 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
@@ -79,7 +79,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
public static final int CLEAR_ALL_SPLIT_THRESHOLD = 10000;
/** Maximum number of retries when topology changes. */
- public static final int MAX_RETRIES = 100;
+ public static final int MAX_RETRIES = IgniteSystemProperties.getInteger(IGNITE_CACHE_RETRIES_COUNT, 100);
/** Deserialization stash. */
private static final ThreadLocal<IgniteBiTuple<String, String>> stash = new ThreadLocal<IgniteBiTuple<String,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
index 35d3ec5..8724d3a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.cache;
+import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.affinity.*;
import java.util.*;
@@ -26,14 +27,17 @@ import java.util.*;
*/
public interface GridCacheAtomicFuture<R> extends GridCacheFuture<R> {
/**
- * @return {@code True} if partition exchange should wait for this future to complete.
+ * @return Future topology version.
*/
- public boolean waitForPartitionExchange();
+ public AffinityTopologyVersion topologyVersion();
/**
- * @return Future topology version.
+ * Gets future that will be completed when it is safe when update is finished on the given version of topology.
+ *
+ * @param topVer Topology version to finish.
+ * @return Future or {@code null} if no need to wait.
*/
- public AffinityTopologyVersion topologyVersion();
+ public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer);
/**
* @return Future keys.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index c528e08..f24cf01 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -338,7 +338,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
public void addAtomicFuture(GridCacheVersion futVer, GridCacheAtomicFuture<?> fut) {
IgniteInternalFuture<?> old = atomicFuts.put(futVer, fut);
- assert old == null;
+ assert old == null : "Old future is not null [futVer=" + futVer + ", fut=" + fut + ", old=" + old + ']';
}
/**
@@ -1002,8 +1002,10 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
res.ignoreChildFailures(ClusterTopologyCheckedException.class, CachePartialUpdateCheckedException.class);
for (GridCacheAtomicFuture<?> fut : atomicFuts.values()) {
- if (fut.waitForPartitionExchange() && fut.topologyVersion().compareTo(topVer) < 0)
- res.add((IgniteInternalFuture<Object>)fut);
+ IgniteInternalFuture<Void> complete = fut.completeFuture(topVer);
+
+ if (complete != null)
+ res.add((IgniteInternalFuture)complete);
}
res.markInitialized();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index ff8454e..37b57e6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
@@ -170,13 +171,16 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
}
/** {@inheritDoc} */
- @Override public boolean waitForPartitionExchange() {
- return waitForExchange;
+ @Override public AffinityTopologyVersion topologyVersion() {
+ return updateReq.topologyVersion();
}
/** {@inheritDoc} */
- @Override public AffinityTopologyVersion topologyVersion() {
- return updateReq.topologyVersion();
+ @Override public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer) {
+ if (waitForExchange && topologyVersion().compareTo(topVer) < 0)
+ return this;
+
+ return null;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 536eb40..ea9b335 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -105,7 +105,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
private final ExpiryPolicy expiryPlc;
/** Future map topology version. */
- private AffinityTopologyVersion topVer = AffinityTopologyVersion.ZERO;
+ private volatile AffinityTopologyVersion topVer = AffinityTopologyVersion.ZERO;
+
+ /** Completion future for a particular topology version. */
+ private GridFutureAdapter<Void> topCompleteFut;
/** Optional filter. */
private final CacheEntryPredicate[] filter;
@@ -246,8 +249,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return F.view(F.viewReadOnly(mappings.keySet(), U.id2Node(cctx.kernalContext())), F.notNull());
}
- /** {@inheritDoc} */
- @Override public boolean waitForPartitionExchange() {
+ /**
+ * @return {@code True} if this future should block partition map exchange.
+ */
+ private boolean waitForPartitionExchange() {
// Wait fast-map near atomic update futures in CLOCK mode.
return fastMap;
}
@@ -323,13 +328,36 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
else {
topLocked = true;
- // Cannot remap.
- remapCnt.set(1);
+ synchronized (this) {
+ this.topVer = topVer;
+
+ // Cannot remap.
+ remapCnt.set(1);
+ }
map0(topVer, null, false, null);
}
}
+ /** {@inheritDoc} */
+ @Override public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer) {
+ if (waitForPartitionExchange() && topologyVersion().compareTo(topVer) < 0) {
+ synchronized (this) {
+ if (this.topVer == AffinityTopologyVersion.ZERO)
+ return null;
+
+ if (this.topVer.compareTo(topVer) < 0) {
+ if (topCompleteFut == null)
+ topCompleteFut = new GridFutureAdapter<>();
+
+ return topCompleteFut;
+ }
+ }
+ }
+
+ return null;
+ }
+
/**
* @param failed Keys to remap.
*/
@@ -339,14 +367,20 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
Collection<Object> remapKeys = new ArrayList<>(failed.size());
Collection<Object> remapVals = vals != null ? new ArrayList<>(failed.size()) : null;
+ Collection<GridCacheDrInfo> remapConflictPutVals = conflictPutVals != null ? new ArrayList<GridCacheDrInfo>(failed.size()) : null;
+ Collection<GridCacheVersion> remapConflictRmvVals = conflictRmvVals != null ? new ArrayList<GridCacheVersion>(failed.size()) : null;
Iterator<?> keyIt = keys.iterator();
Iterator<?> valsIt = vals != null ? vals.iterator() : null;
+ Iterator<GridCacheDrInfo> conflictPutValsIt = conflictPutVals != null ? conflictPutVals.iterator() : null;
+ Iterator<GridCacheVersion> conflictRmvValsIt = conflictRmvVals != null ? conflictRmvVals.iterator() : null;
for (Object key : failed) {
while (keyIt.hasNext()) {
Object nextKey = keyIt.next();
Object nextVal = valsIt != null ? valsIt.next() : null;
+ GridCacheDrInfo nextConflictPutVal = conflictPutValsIt != null ? conflictPutValsIt.next() : null;
+ GridCacheVersion nextConflictRmvVal = conflictRmvValsIt != null ? conflictRmvValsIt.next() : null;
if (F.eq(key, nextKey)) {
remapKeys.add(nextKey);
@@ -354,6 +388,12 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (remapVals != null)
remapVals.add(nextVal);
+ if (remapConflictPutVals != null)
+ remapConflictPutVals.add(nextConflictPutVal);
+
+ if (remapConflictRmvVals != null)
+ remapConflictRmvVals.add(nextConflictRmvVal);
+
break;
}
}
@@ -361,13 +401,29 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
keys = remapKeys;
vals = remapVals;
+ conflictPutVals = remapConflictPutVals;
+ conflictRmvVals = remapConflictRmvVals;
- mappings = new ConcurrentHashMap8<>(keys.size(), 1.0f);
single = null;
futVer = null;
err = null;
opRes = null;
- topVer = AffinityTopologyVersion.ZERO;
+
+ GridFutureAdapter<Void> fut0;
+
+ synchronized (this) {
+ mappings = new ConcurrentHashMap8<>(keys.size(), 1.0f);
+
+ topVer = AffinityTopologyVersion.ZERO;
+
+ fut0 = topCompleteFut;
+
+ topCompleteFut = null;
+ }
+
+ if (fut0 != null)
+ fut0.onDone();
+
singleNodeId = null;
singleReq = null;
fastMapRemap = false;
@@ -405,6 +461,15 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (futVer != null)
cctx.mvcc().removeAtomicFuture(version());
+ GridFutureAdapter<Void> fut0;
+
+ synchronized (this) {
+ fut0 = topCompleteFut;
+ }
+
+ if (fut0 != null)
+ fut0.onDone();
+
return true;
}
@@ -544,6 +609,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return;
}
+
+ synchronized (this) {
+ this.topVer = topVer;
+ }
}
finally {
cache.topology().readUnlock();
@@ -559,7 +628,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
boolean remap = false;
synchronized (this) {
- if ((syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY) || mappings.isEmpty()) {
+ if (topVer != AffinityTopologyVersion.ZERO &&
+ ((syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY) || mappings.isEmpty())) {
CachePartialUpdateCheckedException err0 = err;
if (err0 != null)
@@ -1040,7 +1110,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (err0 == null)
err0 = this.err = new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible).");
- List<Object> keys = new ArrayList<>(failedKeys.size());
+ Collection<Object> keys = new ArrayList<>(failedKeys.size());
for (KeyCacheObject key : failedKeys)
keys.add(key.value(cctx.cacheObjectContext(), false));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index addf243d..4ca2995 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -210,7 +210,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
public static final int DFLT_ACK_SND_THRESHOLD = 16;
/** Default socket write timeout. */
- public static final long DFLT_SOCK_WRITE_TIMEOUT = 200;
+ public static final long DFLT_SOCK_WRITE_TIMEOUT = 2000;
/** No-op runnable. */
private static final IgniteRunnable NOOP = new IgniteRunnable() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2c90b52/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index 054a110..b255558 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@ -41,6 +41,7 @@ import org.jsr166.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
+import java.util.concurrent.locks.*;
import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
import static org.apache.ignite.cache.CacheMode.*;
@@ -236,6 +237,8 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends GridCommonA
System.err.println("FINISHED PUTS");
+ GridCacheMapEntry.debug = true;
+
// Start put threads.
IgniteInternalFuture<?> fut = multithreadedAsync(new Callable<Object>() {
@Override public Object call() throws Exception {
@@ -340,12 +343,12 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends GridCommonA
}
catch (AssertionError e) {
if (r == 9) {
- System.err.println("Failed to verify cache contents: " + e.getMessage());
+ info("Failed to verify cache contents: " + e.getMessage());
throw e;
}
- System.err.println("Failed to verify cache contents, will retry: " + e.getMessage());
+ info("Failed to verify cache contents, will retry: " + e.getMessage());
// Give some time to finish async updates.
U.sleep(1000);
[33/50] incubator-ignite git commit: # ignite_1055
Posted by sb...@apache.org.
# ignite_1055
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7030ee19
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7030ee19
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7030ee19
Branch: refs/heads/ignite-752
Commit: 7030ee191f9e229c73a85cb48e01c8255a53a0cc
Parents: b437ec7
Author: Atri <at...@gmail.com>
Authored: Mon Jun 29 21:44:01 2015 +0530
Committer: ashutak <as...@gridgain.com>
Committed: Thu Jul 2 14:05:50 2015 +0300
----------------------------------------------------------------------
bin/ignite.bat | 8 ++++++--
bin/ignite.sh | 6 +++++-
bin/include/parseargs.bat | 1 +
bin/include/parseargs.sh | 3 +++
.../ignite/startup/cmdline/CommandLineTransformer.java | 9 +++++++++
5 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/ignite.bat
----------------------------------------------------------------------
diff --git a/bin/ignite.bat b/bin/ignite.bat
index 1a4a58c..43cc58b 100644
--- a/bin/ignite.bat
+++ b/bin/ignite.bat
@@ -129,8 +129,12 @@ set RESTART_SUCCESS_OPT=-DIGNITE_SUCCESS_FILE=%RESTART_SUCCESS_FILE%
::
:: You can specify IGNITE_JMX_PORT environment variable for overriding automatically found JMX port
::
-for /F "tokens=*" %%A in ('""%JAVA_HOME%\bin\java" -cp %CP% org.apache.ignite.internal.util.portscanner.GridJmxPortFinder"') do (
- set JMX_PORT=%%A
+:: This is executed if -nojmx is not specified
+::
+if not "%NO_JMX%" == "1" (
+ for /F "tokens=*" %%A in ('""%JAVA_HOME%\bin\java" -cp %CP% org.apache.ignite.internal.util.portscanner.GridJmxPortFinder"') do (
+ set JMX_PORT=%%A
+ )
)
::
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/ignite.sh
----------------------------------------------------------------------
diff --git a/bin/ignite.sh b/bin/ignite.sh
index 660a80f..7fbca57 100755
--- a/bin/ignite.sh
+++ b/bin/ignite.sh
@@ -71,7 +71,11 @@ RESTART_SUCCESS_OPT="-DIGNITE_SUCCESS_FILE=${RESTART_SUCCESS_FILE}"
#
# You can specify IGNITE_JMX_PORT environment variable for overriding automatically found JMX port
#
-findAvailableJmxPort
+# This is executed when -nojmx is not specified
+#
+if [ "${NOJMX}" == "0" ] ; then
+ findAvailableJmxPort
+fi
# Mac OS specific support to display correct name in the dock.
osname=`uname`
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/include/parseargs.bat
----------------------------------------------------------------------
diff --git a/bin/include/parseargs.bat b/bin/include/parseargs.bat
index e8c764a..c4b35d2 100644
--- a/bin/include/parseargs.bat
+++ b/bin/include/parseargs.bat
@@ -24,6 +24,7 @@
:: QUIET
:: NO_PAUSE
:: JVM_XOPTS
+:: NOJMX
::
:: Script setups reasonable defaults (see below) for omitted arguments.
::
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/include/parseargs.sh
----------------------------------------------------------------------
diff --git a/bin/include/parseargs.sh b/bin/include/parseargs.sh
index 8045348..3ab255e 100755
--- a/bin/include/parseargs.sh
+++ b/bin/include/parseargs.sh
@@ -22,6 +22,7 @@
# INTERACTIVE
# QUIET
# JVM_XOPTS
+# NOJMX
#
# Script setups reasonable defaults (see below) for omitted arguments.
#
@@ -35,6 +36,7 @@
CONFIG=${DEFAULT_CONFIG}
INTERACTIVE="0"
+NOJMX="0"
QUIET="-DIGNITE_QUIET=true"
JVM_XOPTS=""
@@ -42,6 +44,7 @@ while [ $# -gt 0 ]
do
case "$1" in
-i) INTERACTIVE="1";;
+ -nojmx) NOJMX="1";;
-v) QUIET="-DIGNITE_QUIET=false";;
-J*) JVM_XOPTS="$JVM_XOPTS ${1:2}";;
*) CONFIG="$1";;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
index 6b2c809..ae0c587 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
@@ -56,6 +56,9 @@ public class CommandLineTransformer {
/** No pause mode. */
private boolean noPause;
+ /** No JMX mode. */
+ private boolean noJMX;
+
/** Supported parameter, parsed manually. */
private String jvmOptions = "";
@@ -132,6 +135,11 @@ public class CommandLineTransformer {
break;
+ case "-nojmx":
+ noJMX = true;
+
+ break;
+
default:
argsList.add(arg);
}
@@ -152,6 +160,7 @@ public class CommandLineTransformer {
addArgWithValue(sb, "INTERACTIVE", formatBooleanValue(interactive));
addArgWithValue(sb, "QUIET", "-DIGNITE_QUIET=" + !verbose);
addArgWithValue(sb, "NO_PAUSE", formatBooleanValue(noPause));
+ addArgWithValue(sb, "NO_JMX", formatBooleanValue(noJMX));
parseJvmOptionsAndSpringConfig(args);
[29/50] incubator-ignite git commit: # ignite-sprint-7 fixed
failNode()
Posted by sb...@apache.org.
# ignite-sprint-7 fixed failNode()
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7ea64e03
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7ea64e03
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7ea64e03
Branch: refs/heads/ignite-752
Commit: 7ea64e038fd7df6418ec98a18b3665014701587d
Parents: d3783a1
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jul 2 10:03:00 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jul 2 10:03:00 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java | 5 +++--
.../java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ea64e03/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 04276d2..3f05f59 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -339,11 +339,12 @@ class ClientImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override public void failNode(UUID nodeId, @Nullable String warning) {
- ClusterNode node = rmtNodes.get(nodeId);
+ TcpDiscoveryNode node = rmtNodes.get(nodeId);
if (node != null) {
TcpDiscoveryNodeFailedMessage msg = new TcpDiscoveryNodeFailedMessage(getLocalNodeId(),
- node.id(), node.order());
+ node.id(),
+ node.internalOrder());
msg.warning(warning);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ea64e03/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 720ce3a..94a2290 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -585,11 +585,12 @@ class ServerImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override public void failNode(UUID nodeId, @Nullable String warning) {
- ClusterNode node = ring.node(nodeId);
+ TcpDiscoveryNode node = ring.node(nodeId);
if (node != null) {
TcpDiscoveryNodeFailedMessage msg = new TcpDiscoveryNodeFailedMessage(getLocalNodeId(),
- node.id(), node.order());
+ node.id(),
+ node.internalOrder());
msg.warning(warning);
[28/50] incubator-ignite git commit: # ignite-gg-10416 Extract opne
command from visor cmd.
Posted by sb...@apache.org.
# ignite-gg-10416 Extract opne command from visor cmd.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fcff50e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fcff50e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fcff50e3
Branch: refs/heads/ignite-752
Commit: fcff50e386d7f8e7ab1c00b86921f667d646d819
Parents: ad3e6af
Author: Andrey <an...@gridgain.com>
Authored: Thu Jul 2 11:31:31 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jul 2 13:53:00 2015 +0700
----------------------------------------------------------------------
.../ignite/visor/commands/VisorConsole.scala | 3 +-
.../visor/commands/open/VisorOpenCommand.scala | 319 +++++++++++++++++++
.../scala/org/apache/ignite/visor/visor.scala | 231 +-------------
.../ignite/visor/VisorRuntimeBaseSpec.scala | 2 +
.../commands/kill/VisorKillCommandSpec.scala | 1 +
.../commands/start/VisorStartCommandSpec.scala | 1 +
.../commands/tasks/VisorTasksCommandSpec.scala | 1 +
.../commands/vvm/VisorVvmCommandSpec.scala | 1 +
8 files changed, 340 insertions(+), 219 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
index d4ac39d..bcfc6e0 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
@@ -71,6 +71,7 @@ class VisorConsole {
org.apache.ignite.visor.commands.gc.VisorGcCommand
org.apache.ignite.visor.commands.kill.VisorKillCommand
org.apache.ignite.visor.commands.node.VisorNodeCommand
+ org.apache.ignite.visor.commands.open.VisorOpenCommand
org.apache.ignite.visor.commands.ping.VisorPingCommand
org.apache.ignite.visor.commands.start.VisorStartCommand
org.apache.ignite.visor.commands.tasks.VisorTasksCommand
@@ -178,7 +179,7 @@ class VisorConsole {
buf.append(line.dropRight(1))
}
else {
- if (buf.size != 0) {
+ if (buf.nonEmpty) {
buf.append(line)
line = buf.toString()
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
new file mode 100644
index 0000000..6498baf
--- /dev/null
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
@@ -0,0 +1,319 @@
+/*
+ *
+ * * 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.visor.commands.open
+
+import org.apache.ignite.IgniteSystemProperties._
+import org.apache.ignite.configuration.IgniteConfiguration
+import org.apache.ignite.internal.IgniteComponentType._
+import org.apache.ignite.internal.IgniteEx
+import org.apache.ignite.internal.util.scala.impl
+import org.apache.ignite.internal.util.spring.IgniteSpringHelper
+import org.apache.ignite.internal.util.{IgniteUtils => U}
+import org.apache.ignite.logger.NullLogger
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi
+import org.apache.ignite.visor.commands.common.{VisorConsoleCommand, VisorTextTable}
+import org.apache.ignite.visor.visor._
+import org.apache.ignite.visor.{VisorTag, visor}
+import org.apache.ignite.{IgniteException, IgniteSystemProperties, Ignition}
+
+import java.net.URL
+
+import scala.language.{implicitConversions, reflectiveCalls}
+
+/**
+ * ==Overview==
+ * Contains Visor command `node` implementation.
+ *
+ * ==Help==
+ * {{{
+ * +--------------------------------+
+ * | node | Prints node statistics. |
+ * +--------------------------------+
+ * }}}
+ *
+ * ====Specification====
+ * {{{
+ * node "{-id8=<node-id8>|-id=<node-id>} {-a}"
+ * node
+ * }}}
+ *
+ * ====Arguments====
+ * {{{
+ * -id8=<node-id8>
+ * ID8 of node. Either '-id8' or '-id' can be specified.
+ * If neither specified - command starts in interactive mode.
+ * -id=<node-id>
+ * Full ID of node. Either '-id8' or '-id' can be specified.
+ * If neither specified - command starts in interactive mode.
+ * -a
+ * Print extended information.
+ * By default - only abbreviated statistics is printed.
+ * }}}
+ *
+ * ====Examples====
+ * {{{
+ * node
+ * Starts command in interactive mode.
+ * node "-id8=12345678"
+ * Prints statistics for specified node.
+ * node "-id8=12345678 -a"
+ * Prints full statistics for specified node.
+ * }}}
+ */
+class VisorOpenCommand extends VisorConsoleCommand {
+ @impl protected val name = "open"
+
+ /** Default configuration path relative to Ignite home. */
+ private final val DFLT_CFG = "config/default-config.xml"
+
+ /**
+ * ==Command==
+ * Connects Visor console to the default grid.
+ *
+ * ==Example==
+ * <ex>open</ex>
+ * Connects to the default grid.
+ */
+ def open() {
+ open("")
+ }
+
+ /**
+ * ==Command==
+ * Connects Visor console to default or named grid.
+ *
+ * ==Examples==
+ * <ex>open -g=mygrid</ex>
+ * Connects to 'mygrid' grid.
+ *
+ * @param args Command arguments.
+ */
+ def open(args: String) {
+ assert(args != null)
+
+ if (isConnected) {
+ warn("Visor is already connected. Disconnect first.")
+
+ return
+ }
+
+ try {
+ def configuration(path: String): IgniteConfiguration = {
+ assert(path != null)
+
+ val url =
+ try
+ new URL(path)
+ catch {
+ case e: Exception =>
+ val url = U.resolveIgniteUrl(path)
+
+ if (url == null)
+ throw new IgniteException("Ignite configuration path is invalid: " + path, e)
+
+ url
+ }
+
+ // Add no-op logger to remove no-appender warning.
+ val log4jTup =
+ if (classOf[Ignition].getClassLoader.getResource("org/apache/log4j/Appender.class") != null)
+ U.addLog4jNoOpLogger()
+ else
+ null
+
+ val spring: IgniteSpringHelper = SPRING.create(false)
+
+ val cfgs =
+ try
+ // Cache, IGFS, indexing SPI configurations should be excluded from daemon node config.
+ spring.loadConfigurations(url, "cacheConfiguration", "fileSystemConfiguration",
+ "indexingSpi").get1()
+ finally {
+ if (log4jTup != null)
+ U.removeLog4jNoOpLogger(log4jTup)
+ }
+
+ if (cfgs == null || cfgs.isEmpty)
+ throw new IgniteException("Can't find grid configuration in: " + url)
+
+ if (cfgs.size > 1)
+ throw new IgniteException("More than one grid configuration found in: " + url)
+
+ val cfg = cfgs.iterator().next()
+
+ // Setting up 'Config URL' for properly print in console.
+ System.setProperty(IgniteSystemProperties.IGNITE_CONFIG_URL, url.getPath)
+
+ var cpuCnt = Runtime.getRuntime.availableProcessors
+
+ if (cpuCnt < 4)
+ cpuCnt = 4
+
+ cfg.setConnectorConfiguration(null)
+
+ // All thread pools are overridden to have size equal to number of CPUs.
+ cfg.setPublicThreadPoolSize(cpuCnt)
+ cfg.setSystemThreadPoolSize(cpuCnt)
+ cfg.setPeerClassLoadingThreadPoolSize(cpuCnt)
+
+ var ioSpi = cfg.getCommunicationSpi
+
+ if (ioSpi == null)
+ ioSpi = new TcpCommunicationSpi()
+
+ cfg
+ }
+
+ val argLst = parseArgs(args)
+
+ val path = argValue("cpath", argLst)
+ val dflt = hasArgFlag("d", argLst)
+
+ val (cfg, cfgPath) =
+ if (path.isDefined)
+ (configuration(path.get), path.get)
+ else if (dflt)
+ (configuration(DFLT_CFG), "<default>")
+ else {
+ // If configuration file is not defined in arguments,
+ // ask to choose from the list
+ askConfigFile() match {
+ case Some(p) =>
+ nl()
+
+ (VisorTextTable() +=("Using configuration", p)) render()
+
+ nl()
+
+ (configuration(p), p)
+ case None =>
+ return
+ }
+ }
+
+ open(cfg, cfgPath)
+ }
+ catch {
+ case e: IgniteException =>
+ warn(e.getMessage)
+ warn("Type 'help open' to see how to use this command.")
+
+ status("q")
+ }
+ }
+
+ /**
+ * Connects Visor console to configuration with path.
+ *
+ * @param cfg Configuration.
+ * @param cfgPath Configuration path.
+ */
+ def open(cfg: IgniteConfiguration, cfgPath: String) = {
+ val daemon = Ignition.isDaemon
+
+ val shutdownHook = IgniteSystemProperties.getString(IGNITE_NO_SHUTDOWN_HOOK, "false")
+
+ // Make sure Visor console starts as daemon node.
+ Ignition.setDaemon(true)
+
+ // Make sure visor starts without shutdown hook.
+ System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, "true")
+
+ // Set NullLoger in quite mode.
+ if ("true".equalsIgnoreCase(sys.props.getOrElse(IGNITE_QUIET, "true")))
+ cfg.setGridLogger(new NullLogger)
+
+ val startedGridName = try {
+ Ignition.start(cfg).name
+ }
+ finally {
+ Ignition.setDaemon(daemon)
+
+ System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, shutdownHook)
+ }
+
+ ignite =
+ try
+ Ignition.ignite(startedGridName).asInstanceOf[IgniteEx]
+ catch {
+ case _: IllegalStateException =>
+ throw new IgniteException("Named grid unavailable: " + startedGridName)
+ }
+
+ visor.open(startedGridName, cfgPath)
+ }
+}
+
+/**
+ * Companion object that does initialization of the command.
+ */
+object VisorOpenCommand {
+ /** Singleton command. */
+ private val cmd = new VisorOpenCommand
+
+ // Adds command's help to visor.
+ addHelp(
+ name = "open",
+ shortInfo = "Connects Visor console to the grid.",
+ longInfo = Seq(
+ "Connects Visor console to the grid. Note that P2P class loading",
+ "should be enabled on all nodes.",
+ " ",
+ "If neither '-cpath' or '-d' are provided, command will ask",
+ "user to select Ignite configuration file in interactive mode."
+ ),
+ spec = Seq(
+ "open -cpath=<path>",
+ "open -d"
+ ),
+ args = Seq(
+ "-cpath=<path>" -> Seq(
+ "Ignite configuration path.",
+ "Can be absolute, relative to Ignite home folder or any well formed URL."
+ ),
+ "-d" -> Seq(
+ "Flag forces the command to connect to grid using default Ignite configuration file.",
+ "without interactive mode."
+ )
+ ),
+ examples = Seq(
+ "open" ->
+ "Prompts user to select Ignite configuration file in interactive mode.",
+ "open -d" ->
+ "Connects Visor console to grid using default Ignite configuration file.",
+ "open -cpath=/gg/config/mycfg.xml" ->
+ "Connects Visor console to grid using Ignite configuration from provided file."
+ ),
+ emptyArgs = cmd.open,
+ withArgs = cmd.open
+ )
+
+ /**
+ * Singleton.
+ */
+ def apply() = cmd
+
+ /**
+ * Implicit converter from visor to commands "pimp".
+ *
+ * @param vs Visor tagging trait.
+ */
+ implicit def fromNode2Visor(vs: VisorTag): VisorOpenCommand = cmd
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
index 5f63f23..67e3d70 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
@@ -17,23 +17,17 @@
package org.apache.ignite.visor
-import org.apache.ignite.IgniteSystemProperties._
import org.apache.ignite._
import org.apache.ignite.cluster.{ClusterGroup, ClusterGroupEmptyException, ClusterMetrics, ClusterNode}
-import org.apache.ignite.configuration.IgniteConfiguration
import org.apache.ignite.events.EventType._
import org.apache.ignite.events.{DiscoveryEvent, Event}
-import org.apache.ignite.internal.IgniteComponentType._
import org.apache.ignite.internal.IgniteEx
import org.apache.ignite.internal.IgniteNodeAttributes._
import org.apache.ignite.internal.cluster.ClusterGroupEmptyCheckedException
import org.apache.ignite.internal.util.lang.{GridFunc => F}
-import org.apache.ignite.internal.util.spring.IgniteSpringHelper
import org.apache.ignite.internal.util.typedef._
import org.apache.ignite.internal.util.{GridConfigurationFinder, IgniteUtils => U}
import org.apache.ignite.lang._
-import org.apache.ignite.logger.NullLogger
-import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi
import org.apache.ignite.thread.IgniteThreadPoolExecutor
import org.apache.ignite.visor.commands.common.VisorTextTable
@@ -213,9 +207,6 @@ object visor extends VisorTag {
*/
private final val DFLT_LOG_PATH = "visor/visor-log"
- /** Default configuration path relative to Ignite home. */
- private final val DFLT_CFG = "config/default-config.xml"
-
/** Log file. */
private var logFile: File = null
@@ -429,42 +420,6 @@ object visor extends VisorTag {
withArgs = status
)
- addHelp(
- name = "open",
- shortInfo = "Connects Visor console to the grid.",
- longInfo = Seq(
- "Connects Visor console to the grid. Note that P2P class loading",
- "should be enabled on all nodes.",
- " ",
- "If neither '-cpath' or '-d' are provided, command will ask",
- "user to select Ignite configuration file in interactive mode."
- ),
- spec = Seq(
- "open -cpath=<path>",
- "open -d"
- ),
- args = Seq(
- "-cpath=<path>" -> Seq(
- "Ignite configuration path.",
- "Can be absolute, relative to Ignite home folder or any well formed URL."
- ),
- "-d" -> Seq(
- "Flag forces the command to connect to grid using default Ignite configuration file.",
- "without interactive mode."
- )
- ),
- examples = Seq(
- "open" ->
- "Prompts user to select Ignite configuration file in interactive mode.",
- "open -d" ->
- "Connects Visor console to grid using default Ignite configuration file.",
- "open -cpath=/gg/config/mycfg.xml" ->
- "Connects Visor console to grid using Ignite configuration from provided file."
- ),
- emptyArgs = open,
- withArgs = open
- )
-
/**
* @param name - command name.
*/
@@ -980,7 +935,7 @@ object visor extends VisorTag {
val sb = new StringBuilder()
- for (i <- 0 until lst.size if lst(i).nonEmpty || sb.size != 0) {
+ for (i <- 0 until lst.size if lst(i).nonEmpty || sb.nonEmpty) {
val arg = sb.toString + lst(i)
arg match {
@@ -1007,7 +962,7 @@ object visor extends VisorTag {
def hasArgValue(@Nullable v: String, args: ArgList): Boolean = {
assert(args != null)
- args.find(_._2 == v).nonEmpty
+ args.exists(_._2 == v)
}
/**
@@ -1019,7 +974,7 @@ object visor extends VisorTag {
def hasArgName(@Nullable n: String, args: ArgList): Boolean = {
assert(args != null)
- args.find(_._1 == n).nonEmpty
+ args.exists(_._1 == n)
}
/**
@@ -1032,7 +987,7 @@ object visor extends VisorTag {
def hasArgFlag(n: String, args: ArgList): Boolean = {
assert(n != null && args != null)
- args.find((a) => a._1 == n && a._2 == null).nonEmpty
+ args.exists((a) => a._1 == n && a._2 == null)
}
/**
@@ -1525,170 +1480,22 @@ object visor extends VisorTag {
private def blank(len: Int) = new String().padTo(len, ' ')
/**
- * ==Command==
- * Connects Visor console to default or named grid.
- *
- * ==Examples==
- * <ex>open -g=mygrid</ex>
- * Connects to 'mygrid' grid.
- *
- * @param args Command arguments.
- */
- def open(args: String) {
- assert(args != null)
-
- if (isConnected) {
- warn("Visor is already connected. Disconnect first.")
-
- return
- }
-
- try {
- def configuration(path: String): IgniteConfiguration = {
- assert(path != null)
-
- val url =
- try
- new URL(path)
- catch {
- case e: Exception =>
- val url = U.resolveIgniteUrl(path)
-
- if (url == null)
- throw new IgniteException("Ignite configuration path is invalid: " + path, e)
-
- url
- }
-
- // Add no-op logger to remove no-appender warning.
- val log4jTup =
- if (classOf[Ignition].getClassLoader.getResource("org/apache/log4j/Appender.class") != null)
- U.addLog4jNoOpLogger()
- else
- null
-
- val spring: IgniteSpringHelper = SPRING.create(false)
-
- val cfgs =
- try
- // Cache, IGFS, streamer and DR configurations should be excluded from daemon node config.
- spring.loadConfigurations(url, "cacheConfiguration", "fileSystemConfiguration",
- "streamerConfiguration", "drSenderConfiguration", "drReceiverConfiguration",
- "interopConfiguration", "indexingSpi").get1()
- finally {
- if (log4jTup != null)
- U.removeLog4jNoOpLogger(log4jTup)
- }
-
- if (cfgs == null || cfgs.isEmpty)
- throw new IgniteException("Can't find grid configuration in: " + url)
-
- if (cfgs.size > 1)
- throw new IgniteException("More than one grid configuration found in: " + url)
-
- val cfg = cfgs.iterator().next()
-
- // Setting up 'Config URL' for properly print in console.
- System.setProperty(IgniteSystemProperties.IGNITE_CONFIG_URL, url.getPath)
-
- var cpuCnt = Runtime.getRuntime.availableProcessors
-
- if (cpuCnt < 4)
- cpuCnt = 4
-
- cfg.setConnectorConfiguration(null)
-
- // All thread pools are overridden to have size equal to number of CPUs.
- cfg.setPublicThreadPoolSize(cpuCnt)
- cfg.setSystemThreadPoolSize(cpuCnt)
- cfg.setPeerClassLoadingThreadPoolSize(cpuCnt)
-
- var ioSpi = cfg.getCommunicationSpi
-
- if (ioSpi == null)
- ioSpi = new TcpCommunicationSpi()
-
- cfg
- }
-
- val argLst = parseArgs(args)
-
- val path = argValue("cpath", argLst)
- val dflt = hasArgFlag("d", argLst)
-
- val (cfg, cfgPath) =
- if (path.isDefined)
- (configuration(path.get), path.get)
- else if (dflt)
- (configuration(DFLT_CFG), "<default>")
- else {
- // If configuration file is not defined in arguments,
- // ask to choose from the list
- askConfigFile() match {
- case Some(p) =>
- nl()
-
- (VisorTextTable() +=("Using configuration", p)) render()
-
- nl()
-
- (configuration(p), p)
- case None =>
- return
- }
- }
-
- open(cfg, cfgPath)
- }
- catch {
- case e: IgniteException =>
- warn(e.getMessage)
- warn("Type 'help open' to see how to use this command.")
-
- status("q")
- }
- }
-
- /**
* Connects Visor console to configuration with path.
*
- * @param cfg Configuration.
+ * @param gridName Name of grid instance.
* @param cfgPath Configuration path.
*/
- def open(cfg: IgniteConfiguration, cfgPath: String) {
- val daemon = Ignition.isDaemon
-
- val shutdownHook = IgniteSystemProperties.getString(IGNITE_NO_SHUTDOWN_HOOK, "false")
-
- // Make sure Visor console starts as daemon node.
- Ignition.setDaemon(true)
-
- // Make sure visor starts without shutdown hook.
- System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, "true")
-
- // Set NullLoger in quite mode.
- if ("true".equalsIgnoreCase(sys.props.getOrElse(IGNITE_QUIET, "true")))
- cfg.setGridLogger(new NullLogger)
-
- val startedGridName = try {
- Ignition.start(cfg).name
- }
- finally {
- Ignition.setDaemon(daemon)
-
- System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, shutdownHook)
- }
-
+ def open(gridName: String, cfgPath: String) {
this.cfgPath = cfgPath
ignite =
try
- Ignition.ignite(startedGridName).asInstanceOf[IgniteEx]
+ Ignition.ignite(gridName).asInstanceOf[IgniteEx]
catch {
case _: IllegalStateException =>
this.cfgPath = null
- throw new IgniteException("Named grid unavailable: " + startedGridName)
+ throw new IgniteException("Named grid unavailable: " + gridName)
}
assert(cfgPath != null)
@@ -1824,18 +1631,6 @@ object visor extends VisorTag {
}
/**
- * ==Command==
- * Connects Visor console to the default grid.
- *
- * ==Example==
- * <ex>open</ex>
- * Connects to the default grid.
- */
- def open() {
- open("")
- }
-
- /**
* Returns string with node id8, its memory variable, if available, and its
* IP address (first internal address), if node is alive.
*
@@ -2016,7 +1811,7 @@ object visor extends VisorTag {
else if (nodes.size == 1)
Some(nodes.head.id)
else {
- (0 until nodes.size) foreach (i => {
+ nodes.indices foreach (i => {
val n = nodes(i)
val m = n.metrics
@@ -2080,7 +1875,7 @@ object visor extends VisorTag {
None
}
else {
- (0 until neighborhood.size) foreach (i => {
+ neighborhood.indices foreach (i => {
val neighbors = neighborhood(i)
var ips = immutable.Set.empty[String]
@@ -2229,7 +2024,7 @@ object visor extends VisorTag {
val ids = ignite.cluster.forRemotes().nodes().map(nid8).toList
- (0 until ids.size).foreach(i => println((i + 1) + ": " + ids(i)))
+ ids.indices.foreach(i => println((i + 1) + ": " + ids(i)))
nl()
@@ -2758,7 +2553,7 @@ object visor extends VisorTag {
help()
}
- lazy val commands = cmdLst.map(_.name) ++ cmdLst.map(_.aliases).flatten
+ lazy val commands = cmdLst.map(_.name) ++ cmdLst.flatMap(_.aliases)
def searchCmd(cmd: String) = cmdLst.find(c => c.name.equals(cmd) || (c.aliases != null && c.aliases.contains(cmd)))
@@ -2851,7 +2646,7 @@ object visor extends VisorTag {
var dec = BigDecimal.valueOf(0L)
- for (i <- 0 until octets.length) dec += octets(i).toLong * math.pow(256, octets.length - 1 - i).toLong
+ for (i <- octets.indices) dec += octets(i).toLong * math.pow(256, octets.length - 1 - i).toLong
dec
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
index f27bae3..1c5e232 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
@@ -19,6 +19,8 @@ package org.apache.ignite.visor
import org.apache.ignite.Ignition
import org.apache.ignite.configuration.IgniteConfiguration
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
+
import org.scalatest._
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
index 2c659b5..4719606 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
@@ -20,6 +20,7 @@ package org.apache.ignite.visor.commands.kill
import org.apache.ignite.visor.visor
import org.scalatest._
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
import org.apache.ignite.visor.commands.kill.VisorKillCommand._
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
index c6404b5..49a861c 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
@@ -20,6 +20,7 @@ package org.apache.ignite.visor.commands.start
import org.apache.ignite.visor.visor
import org.scalatest._
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
import org.apache.ignite.visor.commands.start.VisorStartCommand._
import org.apache.ignite.visor.commands.top.VisorTopologyCommand._
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
index db07543..fe364bc 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
@@ -26,6 +26,7 @@ import org.scalatest._
import java.util
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
import org.apache.ignite.visor.commands.tasks.VisorTasksCommand._
import scala.collection.JavaConversions._
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
index 1a4bc3e..022f6d6 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
@@ -20,6 +20,7 @@ package org.apache.ignite.visor.commands.vvm
import org.apache.ignite.visor.visor
import org.scalatest._
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
import org.apache.ignite.visor.commands.vvm.VisorVvmCommand._
/**
[07/50] incubator-ignite git commit: ignite-973-2 - read offheap
value before remove
Posted by sb...@apache.org.
ignite-973-2 - read offheap value before remove
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/260dc2dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/260dc2dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/260dc2dd
Branch: refs/heads/ignite-752
Commit: 260dc2dd4978d0a57732b7edd0aa0b043d4eff4c
Parents: 285d790
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Jun 23 15:28:24 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Jun 23 15:28:24 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheSwapManager.java | 192 +++++++++++--------
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 8 +-
2 files changed, 118 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/260dc2dd/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 f709e03..e45ec2d 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
@@ -535,21 +535,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// First try removing from offheap.
if (offheapEnabled) {
- byte[] entryBytes = offheap.remove(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
-
- if (cctx.config().isStatisticsEnabled()) {
- if (entryBytes != null)
- cctx.cache().metrics0().onOffHeapRemove();
-
- cctx.cache().metrics0().onOffHeapRead(entryBytes != null);
- }
-
- if (entryBytes != null) {
- GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
-
- if (entry == null)
- return null;
+ GridCacheSwapEntry entry = removeFromOffheap(key, key.valueBytes(cctx.cacheObjectContext()), part);
+ if (entry != null) {
// Always fire this event, since preloading depends on it.
onOffHeaped(part, key, entry);
@@ -569,11 +557,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
null,
null);
- GridCacheQueryManager qryMgr = cctx.queries();
-
- if (qryMgr != null)
- qryMgr.onUnswap(key, entry.value());
-
return entry;
}
}
@@ -737,6 +720,47 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/**
+ * @param key Key.
+ * @param keyBytes Key bytes.
+ * @param part Partition.
+ * @return Swap entry.
+ * @throws IgniteCheckedException If failed.
+ */
+ @Nullable private GridCacheSwapEntry removeFromOffheap(KeyCacheObject key, byte[] keyBytes, int part)
+ throws IgniteCheckedException {
+ final GridCacheQueryManager qryMgr = cctx.queries();
+
+ GridCacheSwapEntry entry;
+
+ if (qryMgr != null) {
+ entry = readOffheapBeforeRemove(key, keyBytes, part);
+
+ if (entry != null) {
+ if (offheap.removex(spaceName, part, key, keyBytes)) {
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRemove();
+ }
+ else
+ entry = null; // Failed to remove -> reset to null.
+ }
+ }
+ else {
+ byte[] entryBytes = offheap.remove(spaceName, part, key, keyBytes);
+
+ if (entryBytes != null) {
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRemove();
+
+ entry = swapEntry(unmarshalSwapEntry(entryBytes));
+ }
+ else
+ entry = null;
+ }
+
+ return entry;
+ }
+
+ /**
* @param keys Collection of keys to remove from swap.
* @return Collection of swap entries.
* @throws IgniteCheckedException If failed,
@@ -759,40 +783,30 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
for (KeyCacheObject key : keys) {
int part = cctx.affinity().partition(key);
- byte[] entryBytes = offheap.remove(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ GridCacheSwapEntry entry = removeFromOffheap(key, key.valueBytes(cctx.cacheObjectContext()), part);
- if(entryBytes != null && cctx.config().isStatisticsEnabled())
- cctx.cache().metrics0().onOffHeapRemove();
+ if (entry != null) {
+ // Always fire this event, since preloading depends on it.
+ onOffHeaped(part, key, entry);
- if (entryBytes != null) {
- GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
+ if (cctx.events().isRecordable(EVT_CACHE_OBJECT_FROM_OFFHEAP))
+ cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid)null, null,
+ EVT_CACHE_OBJECT_FROM_OFFHEAP, null, false, null, true, null, null, null);
- if (entry != null) {
- // Always fire this event, since preloading depends on it.
- onOffHeaped(part, key, entry);
-
- if (cctx.events().isRecordable(EVT_CACHE_OBJECT_FROM_OFFHEAP))
- cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid)null, null,
- EVT_CACHE_OBJECT_FROM_OFFHEAP, null, false, null, true, null, null, null);
-
- if (qryMgr != null)
- qryMgr.onUnswap(key, entry.value());
-
- GridCacheBatchSwapEntry unswapped = new GridCacheBatchSwapEntry(key,
- part,
- ByteBuffer.wrap(entry.valueBytes()),
- entry.type(),
- entry.version(), entry.ttl(),
- entry.expireTime(),
- entry.keyClassLoaderId(),
- entry.valueClassLoaderId());
+ GridCacheBatchSwapEntry unswapped = new GridCacheBatchSwapEntry(key,
+ part,
+ ByteBuffer.wrap(entry.valueBytes()),
+ entry.type(),
+ entry.version(), entry.ttl(),
+ entry.expireTime(),
+ entry.keyClassLoaderId(),
+ entry.valueClassLoaderId());
- unswapped.value(entry.value());
+ unswapped.value(entry.value());
- res.add(unswapped);
+ res.add(unswapped);
- continue;
- }
+ continue;
}
if (swapEnabled) {
@@ -940,6 +954,34 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/**
+ * Reads value from offheap and unswaps it for indexing.
+ *
+ * @param key Key.
+ * @param keyBytes Key bytes.
+ * @param part Partition.
+ * @return Swap entry.
+ * @throws IgniteCheckedException If failed.
+ */
+ public GridCacheSwapEntry readOffheapBeforeRemove(KeyCacheObject key, byte[] keyBytes, int part)
+ throws IgniteCheckedException {
+ assert cctx.queries() != null;
+
+ byte[] val = offheap.get(spaceName, part, key, keyBytes);
+
+ if (val != null) {
+ GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(val));
+
+ if (entry != null) {
+ cctx.queries().onUnswap(key, entry.value());
+
+ return entry;
+ }
+ }
+
+ return null;
+ }
+
+ /**
* @param key Key to remove.
* @throws IgniteCheckedException If failed.
*/
@@ -951,42 +993,17 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
final GridCacheQueryManager qryMgr = cctx.queries();
- CI1<byte[]> c = qryMgr == null ? null : new CI1<byte[]>() {
- @Override public void apply(byte[] rmv) {
- if (rmv == null)
- return;
-
- try {
- if (cctx.config().isStatisticsEnabled())
- cctx.cache().metrics0().onSwapRemove();
-
- GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(rmv));
-
- if (entry == null)
- return;
-
- qryMgr.onUnswap(key, entry.value());
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
- };
-
int part = cctx.affinity().partition(key);
// First try offheap.
if (offheapEnabled) {
- // TODO Pass closure c to offheap.remove and apply it before the actual remove.
- byte[] val = offheap.remove(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ byte[] keyBytes = key.valueBytes(cctx.cacheObjectContext());
- if (val != null) {
+ if ((qryMgr == null || readOffheapBeforeRemove(key, keyBytes, part) != null) &&
+ offheap.removex(spaceName, part, key, keyBytes)) {
if (cctx.config().isStatisticsEnabled())
cctx.cache().metrics0().onOffHeapRemove();
- if (c != null)
- c.apply(val);
-
return;
}
}
@@ -998,7 +1015,30 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
swapMgr.remove(spaceName,
swapKey,
- c,
+ new CI1<byte[]>() {
+ @Override public void apply(byte[] rmv) {
+ if (rmv == null)
+ return;
+
+ try {
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapRemove();
+
+ if (qryMgr == null)
+ return;
+
+ GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(rmv));
+
+ if (entry == null)
+ return;
+
+ qryMgr.onUnswap(key, entry.value());
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+ },
cctx.deploy().globalLoader());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/260dc2dd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
index f89591a..1f54713 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
@@ -236,12 +236,8 @@ public class GridH2KeyValueRowOffheap extends GridH2AbstractKeyValueRow {
try {
GridUnsafeMemory mem = desc.memory();
- if (mem.readLongVolatile(p + OFFSET_VALUE_REF) != 0) {
- if (beforeRmv)
- return; // The offheap value is in its place, nothing to do here.
- else
- throw new IllegalStateException("Unswap without swap: " + p);
- }
+ if (mem.readLongVolatile(p + OFFSET_VALUE_REF) != 0)
+ return; // The offheap value is in its place, nothing to do here.
Value v = peekValue(VAL_COL);
[06/50] incubator-ignite git commit: Merge branch 'ignite-sprint-6'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a4e31be6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a4e31be6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a4e31be6
Branch: refs/heads/ignite-752
Commit: a4e31be6a018f1711ec0cb385c6b88b35c9dffed
Parents: c94c0c4 285d790
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Mon Jun 22 15:29:47 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Mon Jun 22 15:29:47 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../ignite/internal/MarshallerContextImpl.java | 12 +-
.../processors/cache/GridCacheIoManager.java | 64 ++++--
.../GridCachePartitionExchangeManager.java | 70 +++----
.../processors/cache/GridCacheSwapManager.java | 12 +-
.../GridDhtPartitionsExchangeFuture.java | 49 +++--
.../offheap/GridOffHeapProcessor.java | 19 +-
.../apache/ignite/internal/util/GridDebug.java | 37 ++--
.../communication/tcp/TcpCommunicationSpi.java | 61 +++---
.../tcp/TcpCommunicationSpiMBean.java | 8 +
.../ignite/spi/discovery/tcp/ClientImpl.java | 68 ++++---
.../GridCacheAbstractFailoverSelfTest.java | 6 +-
.../cache/GridCacheDaemonNodeStopSelfTest.java | 119 +++++++++++
.../GridTcpCommunicationSpiConfigSelfTest.java | 1 -
.../testsuites/IgniteCacheTestSuite3.java | 1 +
.../processors/query/h2/IgniteH2Indexing.java | 2 +
.../query/h2/twostep/GridMapQueryExecutor.java | 23 ++-
.../cache/IgniteCacheOffheapEvictQueryTest.java | 196 +++++++++++++++++++
.../IgniteCacheQuerySelfTestSuite.java | 1 +
19 files changed, 590 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
[17/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/45b0f092
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/45b0f092
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/45b0f092
Branch: refs/heads/ignite-752
Commit: 45b0f0925fe1da0fb41c06a2dce6440a26490f93
Parents: c2c90b5 3e8ddb4
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jun 25 17:06:46 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jun 25 17:06:46 2015 -0700
----------------------------------------------------------------------
.../ClientAbstractConnectivitySelfTest.java | 4 +-
.../org/apache/ignite/cluster/ClusterGroup.java | 9 +
.../org/apache/ignite/cluster/ClusterNode.java | 2 +
.../ignite/compute/ComputeTaskSplitAdapter.java | 2 +-
.../ignite/internal/GridKernalContextImpl.java | 3 +
.../internal/cluster/ClusterGroupAdapter.java | 38 +
.../cluster/IgniteClusterAsyncImpl.java | 5 +
.../processors/plugin/CachePluginManager.java | 10 +-
.../internal/util/GridConfigurationFinder.java | 55 +-
.../ignite/internal/util/IgniteUtils.java | 6 +-
.../internal/ClusterForHostsSelfTest.java | 113 +++
.../internal/ClusterGroupAbstractTest.java | 777 ++++++++++++++++++
.../ignite/internal/ClusterGroupSelfTest.java | 251 ++++++
.../internal/GridProjectionAbstractTest.java | 784 -------------------
.../ignite/internal/GridProjectionSelfTest.java | 251 ------
.../apache/ignite/internal/GridSelfTest.java | 2 +-
.../internal/util/IgniteUtilsSelfTest.java | 22 +
.../ignite/testsuites/IgniteBasicTestSuite.java | 6 +-
.../p2p/GridP2PContinuousDeploymentTask1.java | 2 +-
.../commands/cache/VisorCacheCommand.scala | 7 +-
scripts/git-patch-prop.sh | 2 +-
21 files changed, 1273 insertions(+), 1078 deletions(-)
----------------------------------------------------------------------
[02/50] incubator-ignite git commit: # ignite-gg-10416 Exclude nested
beans only if exclude properties exists(visor).
Posted by sb...@apache.org.
# ignite-gg-10416 Exclude nested beans only if exclude properties exists(visor).
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0acdc2f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0acdc2f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0acdc2f9
Branch: refs/heads/ignite-752
Commit: 0acdc2f9f56d1c1f104de82211b38e36388ddb43
Parents: e5fba8b
Author: Andrey <an...@gridgain.com>
Authored: Thu Jun 18 18:15:53 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jun 18 18:21:49 2015 +0700
----------------------------------------------------------------------
.../util/spring/IgniteSpringHelperImpl.java | 93 +++++++++++---------
.../IgniteExcludeInConfigurationTest.java | 78 ++++++++++++++++
.../IgniteStartExcludesConfigurationTest.java | 80 -----------------
.../testsuites/IgniteSpringTestSuite.java | 2 +-
4 files changed, 129 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
index df53ca7..6cfca36 100644
--- a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
+++ b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
@@ -421,63 +421,70 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
private static GenericApplicationContext prepareSpringContext(final String... excludedProps){
GenericApplicationContext springCtx = new GenericApplicationContext();
- BeanFactoryPostProcessor postProc = new BeanFactoryPostProcessor() {
- /**
- * @param def Registered BeanDefinition.
- * @throws BeansException in case of errors.
- */
- private void processNested(BeanDefinition def) throws BeansException {
- MutablePropertyValues vals = def.getPropertyValues();
-
- for (PropertyValue val : new ArrayList<>(vals.getPropertyValueList())) {
- for (String excludedProp : excludedProps) {
- if (val.getName().equals(excludedProp)) {
- vals.removePropertyValue(val);
-
- return;
+ if (excludedProps.length > 0) {
+ BeanFactoryPostProcessor postProc = new BeanFactoryPostProcessor() {
+ /**
+ * @param def Registered BeanDefinition.
+ * @throws BeansException in case of errors.
+ */
+ private void processNested(BeanDefinition def) throws BeansException {
+ Iterator<PropertyValue> iterVals = def.getPropertyValues().getPropertyValueList().iterator();
+
+ while (iterVals.hasNext()) {
+ PropertyValue val = iterVals.next();
+
+ for (String excludedProp : excludedProps) {
+ if (val.getName().equals(excludedProp)) {
+ iterVals.remove();
+
+ return;
+ }
}
- }
- if (val.getValue() instanceof Collection) {
- Collection<?> nestedVals = (Collection) val.getValue();
+ if (val.getValue() instanceof Iterable) {
+ Iterator iterNested = ((Iterable)val.getValue()).iterator();
- for (Object item : new ArrayList<>(nestedVals))
- if (item instanceof BeanDefinitionHolder) {
- BeanDefinitionHolder holder = (BeanDefinitionHolder)item;
+ while (iterNested.hasNext()) {
+ Object item = iterNested.next();
- try {
- if (holder.getBeanDefinition().getBeanClassName() != null)
- Class.forName(holder.getBeanDefinition().getBeanClassName());
+ if (item instanceof BeanDefinitionHolder) {
+ BeanDefinitionHolder h = (BeanDefinitionHolder)item;
- processNested(holder.getBeanDefinition());
- }
- catch (ClassNotFoundException ignored) {
- nestedVals.remove(item);
+ try {
+ if (h.getBeanDefinition().getBeanClassName() != null)
+ Class.forName(h.getBeanDefinition().getBeanClassName());
+
+ processNested(h.getBeanDefinition());
+ }
+ catch (ClassNotFoundException ignored) {
+ iterNested.remove();
+ }
}
}
+ }
}
}
- }
- /** {@inheritDoc} */
- @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
- throws BeansException {
- for (String beanName : beanFactory.getBeanDefinitionNames())
- try {
- BeanDefinition def = beanFactory.getBeanDefinition(beanName);
+ @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
+ throws BeansException {
+ for (String beanName : beanFactory.getBeanDefinitionNames()) {
+ try {
+ BeanDefinition def = beanFactory.getBeanDefinition(beanName);
- if (def.getBeanClassName() != null)
- Class.forName(def.getBeanClassName());
+ if (def.getBeanClassName() != null)
+ Class.forName(def.getBeanClassName());
- processNested(def);
- }
- catch (ClassNotFoundException ignored) {
- ((BeanDefinitionRegistry)beanFactory).removeBeanDefinition(beanName);
+ processNested(def);
+ }
+ catch (ClassNotFoundException ignored) {
+ ((BeanDefinitionRegistry)beanFactory).removeBeanDefinition(beanName);
+ }
}
- }
- };
+ }
+ };
- springCtx.addBeanFactoryPostProcessor(postProc);
+ springCtx.addBeanFactoryPostProcessor(postProc);
+ }
return springCtx;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java
new file mode 100644
index 0000000..1edca77
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java
@@ -0,0 +1,78 @@
+/*
+ * 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.spring;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.spring.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.net.*;
+import java.util.*;
+
+import static org.apache.ignite.internal.IgniteComponentType.*;
+
+/**
+ * Checks excluding properties, beans with not existing classes in spring.
+ */
+public class IgniteExcludeInConfigurationTest extends GridCommonAbstractTest {
+ private URL cfgLocation = U.resolveIgniteUrl(
+ "modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml");
+
+ /** Spring should exclude properties by list and ignore beans with class not existing in classpath. */
+ public void testExclude() throws Exception {
+ IgniteSpringHelper spring = SPRING.create(false);
+
+ Collection<IgniteConfiguration> cfgs = spring.loadConfigurations(cfgLocation, "typeMetadata").get1();
+
+ assertNotNull(cfgs);
+ assertEquals(1, cfgs.size());
+
+ IgniteConfiguration cfg = cfgs.iterator().next();
+
+ assertEquals(1, cfg.getCacheConfiguration().length);
+ assertNull(cfg.getCacheConfiguration()[0].getTypeMetadata());
+
+ cfgs = spring.loadConfigurations(cfgLocation, "keyType").get1();
+
+ assertNotNull(cfgs);
+ assertEquals(1, cfgs.size());
+
+ cfg = cfgs.iterator().next();
+
+ assertEquals(1, cfg.getCacheConfiguration().length);
+
+ Collection<CacheTypeMetadata> typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
+
+ assertEquals(1, typeMetadatas.size());
+ assertNull(typeMetadatas.iterator().next().getKeyType());
+ }
+
+ /** Spring should fail if bean class not exist in classpath. */
+ public void testFail() throws Exception {
+ IgniteSpringHelper spring = SPRING.create(false);
+
+ try {
+ assertNotNull(spring.loadConfigurations(cfgLocation).get1());
+ } catch (Exception e) {
+ assertTrue(X.hasCause(e, ClassNotFoundException.class));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
deleted file mode 100644
index f1332e0..0000000
--- a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
+++ /dev/null
@@ -1,80 +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.spring;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.spring.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.net.*;
-import java.util.*;
-
-import static org.apache.ignite.internal.IgniteComponentType.*;
-
-/**
- * Checks exclude properties in spring, exclude beans with not existing classes.
- */
-public class IgniteStartExcludesConfigurationTest extends GridCommonAbstractTest {
- /** Tests spring exclude properties. */
- public void testExcludes() throws Exception {
- URL cfgLocation = U.resolveIgniteUrl(
- "modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml");
-
- IgniteSpringHelper spring = SPRING.create(false);
-
- Collection<IgniteConfiguration> cfgs = spring.loadConfigurations(cfgLocation, "typeMetadata").get1();
-
- assert cfgs != null && cfgs.size() == 1;
-
- IgniteConfiguration cfg = cfgs.iterator().next();
-
- assert cfg.getCacheConfiguration().length == 1;
-
- assert cfg.getCacheConfiguration()[0].getTypeMetadata() == null;
-
- cfgs = spring.loadConfigurations(cfgLocation, "keyType").get1();
-
- assert cfgs != null && cfgs.size() == 1;
-
- cfg = cfgs.iterator().next();
-
- assert cfg.getCacheConfiguration().length == 1;
-
- Collection<CacheTypeMetadata> typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
-
- assert typeMetadatas.size() == 1;
-
- assert typeMetadatas.iterator().next().getKeyType() == null;
-
- cfgs = spring.loadConfigurations(cfgLocation).get1();
-
- assert cfgs != null && cfgs.size() == 1;
-
- cfg = cfgs.iterator().next();
-
- assert cfg.getCacheConfiguration().length == 1;
-
- typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
-
- assert typeMetadatas.size() == 1;
-
- assert "java.lang.Integer".equals(typeMetadatas.iterator().next().getKeyType());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
index 3ff927a..75d29fb 100644
--- a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
+++ b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
@@ -40,7 +40,7 @@ public class IgniteSpringTestSuite extends TestSuite {
suite.addTest(IgniteResourceSelfTestSuite.suite());
- suite.addTest(new TestSuite(IgniteStartExcludesConfigurationTest.class));
+ suite.addTest(new TestSuite(IgniteExcludeInConfigurationTest.class));
// Tests moved to this suite since they require Spring functionality.
suite.addTest(new TestSuite(GridP2PUserVersionChangeSelfTest.class));
[12/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/108788b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/108788b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/108788b9
Branch: refs/heads/ignite-752
Commit: 108788b979306fe3398996eb60057a4c3c5afc39
Parents: e1243b4 359b431
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Jun 23 23:13:27 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Jun 23 23:13:27 2015 +0300
----------------------------------------------------------------------
.../configuration/IgniteReflectionFactory.java | 81 ++++++++++++++++++--
.../distributed/dht/GridDhtLocalPartition.java | 3 +-
.../dht/atomic/GridDhtAtomicCache.java | 9 +--
3 files changed, 82 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
[18/50] incubator-ignite git commit: IGNITE-621 - Fixed compilation.
Posted by sb...@apache.org.
IGNITE-621 - Fixed compilation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d8c1cc2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d8c1cc2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d8c1cc2f
Branch: refs/heads/ignite-752
Commit: d8c1cc2f0160e80226b5e3f02130fc91843633d3
Parents: 45b0f09
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jun 25 17:19:17 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jun 25 17:19:17 2015 -0700
----------------------------------------------------------------------
.../atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d8c1cc2f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index b255558..8e69853 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@ -237,8 +237,6 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends GridCommonA
System.err.println("FINISHED PUTS");
- GridCacheMapEntry.debug = true;
-
// Start put threads.
IgniteInternalFuture<?> fut = multithreadedAsync(new Callable<Object>() {
@Override public Object call() throws Exception {
[50/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-7' into ignite-752
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-7' into ignite-752
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/84d68975
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/84d68975
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/84d68975
Branch: refs/heads/ignite-752
Commit: 84d68975891dcd52d8fa8905925639d141712f51
Parents: 22ee6e8 a577d27
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 6 11:48:41 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 6 11:48:41 2015 +0300
----------------------------------------------------------------------
bin/ignite.bat | 8 +-
bin/ignite.sh | 6 +-
bin/include/parseargs.bat | 1 +
bin/include/parseargs.sh | 3 +
.../java/org/apache/ignite/IgniteCache.java | 5 +
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../apache/ignite/internal/IgniteKernal.java | 1 -
.../managers/communication/GridIoManager.java | 124 ++++--
.../managers/communication/GridIoMessage.java | 15 +-
.../managers/communication/GridIoPolicy.java | 32 +-
.../eventstorage/GridEventStorageManager.java | 2 +-
.../processors/cache/CacheOperationContext.java | 44 ++-
.../internal/processors/cache/CacheType.java | 8 +-
.../processors/cache/GridCacheAdapter.java | 91 +++--
.../processors/cache/GridCacheAtomicFuture.java | 12 +-
.../processors/cache/GridCacheContext.java | 4 +-
.../processors/cache/GridCacheIoManager.java | 12 +-
.../processors/cache/GridCacheMvccManager.java | 8 +-
.../processors/cache/GridCacheProxyImpl.java | 10 +-
.../processors/cache/GridCacheSwapManager.java | 257 ++++++++-----
.../processors/cache/GridCacheUtils.java | 42 +++
.../processors/cache/IgniteCacheProxy.java | 36 +-
.../GridDistributedTxFinishRequest.java | 11 +-
.../GridDistributedTxPrepareRequest.java | 9 +-
.../GridDistributedTxRemoteAdapter.java | 3 +-
.../distributed/dht/GridDhtTxFinishRequest.java | 3 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 3 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 3 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 5 +-
.../dht/atomic/GridDhtAtomicCache.java | 18 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 15 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 177 ++++++++-
.../near/GridNearTxFinishRequest.java | 3 +-
.../cache/distributed/near/GridNearTxLocal.java | 3 +-
.../distributed/near/GridNearTxRemote.java | 5 +-
.../cache/transactions/IgniteInternalTx.java | 3 +-
.../cache/transactions/IgniteTxAdapter.java | 11 +-
.../transactions/IgniteTxLocalAdapter.java | 3 +-
.../datastructures/GridCacheAtomicLongImpl.java | 25 +-
.../GridCacheAtomicSequenceImpl.java | 11 +-
.../GridCacheAtomicStampedImpl.java | 21 +-
.../GridCacheCountDownLatchImpl.java | 16 +-
.../internal/processors/igfs/IgfsContext.java | 5 +-
.../plugin/IgnitePluginProcessor.java | 3 +-
.../ignite/internal/util/IgniteUtils.java | 6 +-
.../plugin/extensions/communication/IoPool.java | 42 +++
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 5 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 5 +-
.../TcpDiscoveryMulticastIpFinder.java | 2 +-
.../startup/cmdline/CommandLineStartup.java | 3 +-
.../startup/cmdline/CommandLineTransformer.java | 9 +
.../communication/GridIoManagerSelfTest.java | 2 +-
.../cache/IgniteInternalCacheTypesTest.java | 3 +-
.../IgniteCachePutRetryAbstractSelfTest.java | 147 ++++++++
.../dht/IgniteCachePutRetryAtomicSelfTest.java | 34 ++
...gniteCachePutRetryTransactionalSelfTest.java | 74 ++++
...eAtomicInvalidPartitionHandlingSelfTest.java | 5 +-
.../GridCachePartitionedFailoverSelfTest.java | 5 +
...acheAtomicReplicatedNodeRestartSelfTest.java | 10 +
.../GridCacheEvictionFilterSelfTest.java | 2 -
.../TcpDiscoveryNodeConsistentIdSelfTest.java | 80 ++++
.../inmemory/GridTestSwapSpaceSpi.java | 3 +-
.../IgniteCacheFailoverTestSuite.java | 3 +
.../IgniteSpiDiscoverySelfTestSuite.java | 2 +
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 8 +-
.../processors/query/h2/opt/GridH2Table.java | 2 +-
.../cache/IgniteCacheOffheapEvictQueryTest.java | 2 +-
.../IgniteCacheQueryMultiThreadedSelfTest.java | 4 +-
...QueryOffheapEvictsMultiThreadedSelfTest.java | 5 -
.../IgniteCacheQueryNodeRestartSelfTest2.java | 5 +
modules/kafka/pom.xml | 116 ++++++
.../ignite/stream/kafka/KafkaStreamer.java | 220 +++++++++++
.../kafka/IgniteKafkaStreamerSelfTestSuite.java | 37 ++
.../stream/kafka/KafkaEmbeddedBroker.java | 378 +++++++++++++++++++
.../kafka/KafkaIgniteStreamerSelfTest.java | 227 +++++++++++
.../ignite/stream/kafka/SimplePartitioner.java | 53 +++
.../util/spring/IgniteSpringHelperImpl.java | 72 +++-
.../IgniteExcludeInConfigurationTest.java | 78 ++++
.../org/apache/ignite/spring/sprint-exclude.xml | 57 +++
.../testsuites/IgniteSpringTestSuite.java | 2 +
modules/urideploy/pom.xml | 14 -
.../ignite/visor/commands/VisorConsole.scala | 3 +-
.../visor/commands/open/VisorOpenCommand.scala | 319 ++++++++++++++++
.../scala/org/apache/ignite/visor/visor.scala | 230 +----------
.../ignite/visor/VisorRuntimeBaseSpec.scala | 2 +
.../commands/kill/VisorKillCommandSpec.scala | 1 +
.../commands/start/VisorStartCommandSpec.scala | 1 +
.../commands/tasks/VisorTasksCommandSpec.scala | 1 +
.../commands/vvm/VisorVvmCommandSpec.scala | 1 +
pom.xml | 1 +
91 files changed, 2743 insertions(+), 620 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/84d68975/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/84d68975/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/84d68975/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
[31/50] incubator-ignite git commit: # ignite-sprint-7 warning in
AddressSender
Posted by sb...@apache.org.
# ignite-sprint-7 warning in AddressSender
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/91e1cb21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/91e1cb21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/91e1cb21
Branch: refs/heads/ignite-752
Commit: 91e1cb211f9fbd56ab37fa278866f80bd4239106
Parents: 872fc38
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jul 2 12:46:20 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jul 2 12:46:20 2015 +0300
----------------------------------------------------------------------
.../tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/91e1cb21/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index 014d937..bdc7865 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -777,7 +777,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
}
catch (IOException e) {
if (!isInterrupted()) {
- U.error(log, "Failed to send/receive address message (will try to reconnect).", e);
+ LT.warn(log, e, "Failed to send/receive address message (will try to reconnect).");
synchronized (this) {
U.close(sock);
[26/50] incubator-ignite git commit: ignite-973-2 - stop nodes after
test
Posted by sb...@apache.org.
ignite-973-2 - stop nodes after 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/cbbb6a11
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cbbb6a11
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cbbb6a11
Branch: refs/heads/ignite-752
Commit: cbbb6a1198426398ad344282854f9c5e65054f6c
Parents: 1a465a2
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jul 1 15:59:51 2015 -0700
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jul 1 15:59:51 2015 -0700
----------------------------------------------------------------------
.../distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbbb6a11/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
index 93831cc..e65d152 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
@@ -325,6 +325,11 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
info("Queries stopped.");
}
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
/**
*
*/
[03/50] incubator-ignite git commit: IGNITE-621 - Added automatic
retries.
Posted by sb...@apache.org.
IGNITE-621 - Added automatic retries.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3787a9d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3787a9d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3787a9d3
Branch: refs/heads/ignite-752
Commit: 3787a9d3353c0c146141a79e3e87e1bbc5128031
Parents: 415264e
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Fri Jun 19 17:15:02 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Fri Jun 19 17:15:02 2015 -0700
----------------------------------------------------------------------
.../java/org/apache/ignite/IgniteCache.java | 5 +
.../processors/cache/CacheOperationContext.java | 44 +++++-
.../processors/cache/GridCacheAdapter.java | 91 +++++++------
.../processors/cache/GridCacheProxyImpl.java | 10 +-
.../processors/cache/IgniteCacheProxy.java | 36 ++++-
.../dht/atomic/GridDhtAtomicCache.java | 18 ++-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 87 ++++++++++--
.../IgniteCachePutRetryAbstractSelfTest.java | 134 +++++++++++++++++++
.../dht/IgniteCachePutRetryAtomicSelfTest.java | 34 +++++
...gniteCachePutRetryTransactionalSelfTest.java | 35 +++++
10 files changed, 422 insertions(+), 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index 2b97e55..c8d6d7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -106,6 +106,11 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
public IgniteCache<K, V> withSkipStore();
/**
+ * @return Cache with no-retries behavior enabled.
+ */
+ public IgniteCache<K, V> withNoRetries();
+
+ /**
* Executes {@link #localLoadCache(IgniteBiPredicate, Object...)} on all cache nodes.
*
* @param p Optional predicate (may be {@code null}). If provided, will be used to
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
index 34d2bf4..343a2f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
@@ -36,6 +36,10 @@ public class CacheOperationContext implements Serializable {
@GridToStringInclude
private final boolean skipStore;
+ /** No retries flag. */
+ @GridToStringInclude
+ private final boolean noRetries;
+
/** Client ID which operates over this projection. */
private final UUID subjId;
@@ -56,6 +60,8 @@ public class CacheOperationContext implements Serializable {
keepPortable = false;
expiryPlc = null;
+
+ noRetries = false;
}
/**
@@ -68,7 +74,8 @@ public class CacheOperationContext implements Serializable {
boolean skipStore,
@Nullable UUID subjId,
boolean keepPortable,
- @Nullable ExpiryPolicy expiryPlc) {
+ @Nullable ExpiryPolicy expiryPlc,
+ boolean noRetries) {
this.skipStore = skipStore;
this.subjId = subjId;
@@ -76,6 +83,8 @@ public class CacheOperationContext implements Serializable {
this.keepPortable = keepPortable;
this.expiryPlc = expiryPlc;
+
+ this.noRetries = noRetries;
}
/**
@@ -95,7 +104,8 @@ public class CacheOperationContext implements Serializable {
skipStore,
subjId,
true,
- expiryPlc);
+ expiryPlc,
+ noRetries);
}
/**
@@ -118,7 +128,8 @@ public class CacheOperationContext implements Serializable {
skipStore,
subjId,
keepPortable,
- expiryPlc);
+ expiryPlc,
+ noRetries);
}
/**
@@ -139,7 +150,8 @@ public class CacheOperationContext implements Serializable {
skipStore,
subjId,
keepPortable,
- expiryPlc);
+ expiryPlc,
+ noRetries);
}
/**
@@ -160,7 +172,29 @@ public class CacheOperationContext implements Serializable {
skipStore,
subjId,
true,
- plc);
+ plc,
+ noRetries);
+ }
+
+ /**
+ * @param noRetries No retries flag.
+ * @return Operation context.
+ */
+ public CacheOperationContext setNoRetries(boolean noRetries) {
+ return new CacheOperationContext(
+ skipStore,
+ subjId,
+ keepPortable,
+ expiryPlc,
+ noRetries
+ );
+ }
+
+ /**
+ * @return No retries flag.
+ */
+ public boolean noRetries() {
+ return noRetries;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/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 7335d72..f993527 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
@@ -78,6 +78,9 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** clearLocally() split threshold. */
public static final int CLEAR_ALL_SPLIT_THRESHOLD = 10000;
+ /** Maximum number of retries when topology changes. */
+ public static final int MAX_RETRIES = 100;
+
/** Deserialization stash. */
private static final ThreadLocal<IgniteBiTuple<String, String>> stash = new ThreadLocal<IgniteBiTuple<String,
String>>() {
@@ -363,7 +366,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public GridCacheProxyImpl<K, V> forSubjectId(UUID subjId) {
- CacheOperationContext opCtx = new CacheOperationContext(false, subjId, false, null);
+ CacheOperationContext opCtx = new CacheOperationContext(false, subjId, false, null, false);
return new GridCacheProxyImpl<>(ctx, this, opCtx);
}
@@ -375,14 +378,14 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public GridCacheProxyImpl<K, V> setSkipStore(boolean skipStore) {
- CacheOperationContext opCtx = new CacheOperationContext(true, null, false, null);
+ CacheOperationContext opCtx = new CacheOperationContext(true, null, false, null, false);
return new GridCacheProxyImpl<>(ctx, this, opCtx);
}
/** {@inheritDoc} */
@Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepPortable() {
- CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null);
+ CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false);
return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx, (GridCacheAdapter<K1, V1>)this, opCtx);
}
@@ -399,7 +402,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
assert !CU.isAtomicsCache(ctx.name());
assert !CU.isMarshallerCache(ctx.name());
- CacheOperationContext opCtx = new CacheOperationContext(false, null, false, plc);
+ CacheOperationContext opCtx = new CacheOperationContext(false, null, false, plc, false);
return new GridCacheProxyImpl<>(ctx, this, opCtx);
}
@@ -2301,7 +2304,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @return Putx operation future.
*/
public IgniteInternalFuture<Boolean> putAsync0(final K key, final V val,
- @Nullable final CacheEntryPredicate... filter) {
+ @Nullable final CacheEntryPredicate... filter) {
A.notNull(key, "key", val, "val");
if (keyCheck)
@@ -3930,51 +3933,63 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (tx == null || tx.implicit()) {
TransactionConfiguration tCfg = ctx.gridConfig().getTransactionConfiguration();
- tx = ctx.tm().newTx(
- true,
- op.single(),
- ctx.systemTx() ? ctx : null,
- OPTIMISTIC,
- READ_COMMITTED,
- tCfg.getDefaultTxTimeout(),
- !ctx.skipStore(),
- 0
- );
+ CacheOperationContext opCtx = ctx.operationContextPerCall();
- assert tx != null;
+ int retries = opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES;
- try {
- T t = op.op(tx);
+ for (int i = 0; i < retries; i++) {
+ tx = ctx.tm().newTx(
+ true,
+ op.single(),
+ ctx.systemTx() ? ctx : null,
+ OPTIMISTIC,
+ READ_COMMITTED,
+ tCfg.getDefaultTxTimeout(),
+ !ctx.skipStore(),
+ 0
+ );
- assert tx.done() : "Transaction is not done: " + tx;
+ assert tx != null;
- return t;
- }
- catch (IgniteInterruptedCheckedException | IgniteTxHeuristicCheckedException |
- IgniteTxRollbackCheckedException e) {
- throw e;
- }
- catch (IgniteCheckedException e) {
try {
- tx.rollback();
+ T t = op.op(tx);
- e = new IgniteTxRollbackCheckedException("Transaction has been rolled back: " +
- tx.xid(), e);
+ assert tx.done() : "Transaction is not done: " + tx;
+
+ return t;
+ }
+ catch (IgniteInterruptedCheckedException | IgniteTxHeuristicCheckedException |
+ IgniteTxRollbackCheckedException e) {
+ throw e;
}
- catch (IgniteCheckedException | AssertionError | RuntimeException e1) {
- U.error(log, "Failed to rollback transaction (cache may contain stale locks): " + tx, e1);
+ catch (IgniteCheckedException e) {
+ try {
+ tx.rollback();
+
+ e = new IgniteTxRollbackCheckedException("Transaction has been rolled back: " +
+ tx.xid(), e);
+ }
+ catch (IgniteCheckedException | AssertionError | RuntimeException e1) {
+ U.error(log, "Failed to rollback transaction (cache may contain stale locks): " + tx, e1);
+
+ U.addLastCause(e, e1, log);
+ }
+
+ if (X.hasCause(e, ClusterTopologyCheckedException.class) && i != retries - 1)
+ continue;
- U.addLastCause(e, e1, log);
+ throw e;
}
+ finally {
+ ctx.tm().resetContext();
- throw e;
+ if (ctx.isNear())
+ ctx.near().dht().context().tm().resetContext();
+ }
}
- finally {
- ctx.tm().resetContext();
- if (ctx.isNear())
- ctx.near().dht().context().tm().resetContext();
- }
+ // Should not happen.
+ throw new IgniteCheckedException("Failed to perform cache operation (maximum number of retries exceeded).");
}
else
return op.op(tx);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 63ba242..cec8c53 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -118,7 +118,7 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
CacheOperationContext prev = gate.enter(opCtx);
try {
- return opCtx != null ? opCtx.skipStore() : false;
+ return opCtx != null && opCtx.skipStore();
}
finally {
gate.leave(prev);
@@ -198,7 +198,7 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
/** {@inheritDoc} */
@Override public GridCacheProxyImpl<K, V> forSubjectId(UUID subjId) {
return new GridCacheProxyImpl<>(ctx, delegate,
- opCtx != null ? opCtx.forSubjectId(subjId) : new CacheOperationContext(false, subjId, false, null));
+ opCtx != null ? opCtx.forSubjectId(subjId) : new CacheOperationContext(false, subjId, false, null, false));
}
/** {@inheritDoc} */
@@ -210,7 +210,7 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
return this;
return new GridCacheProxyImpl<>(ctx, delegate,
- opCtx != null ? opCtx.setSkipStore(skipStore) : new CacheOperationContext(true, null, false, null));
+ opCtx != null ? opCtx.setSkipStore(skipStore) : new CacheOperationContext(true, null, false, null, false));
}
finally {
gate.leave(prev);
@@ -224,7 +224,7 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx,
(GridCacheAdapter<K1, V1>)delegate,
- opCtx != null ? opCtx.keepPortable() : new CacheOperationContext(false, null, true, null));
+ opCtx != null ? opCtx.keepPortable() : new CacheOperationContext(false, null, true, null, false));
}
/** {@inheritDoc} */
@@ -1515,7 +1515,7 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
try {
return new GridCacheProxyImpl<>(ctx, delegate,
- opCtx != null ? opCtx.withExpiryPolicy(plc) : new CacheOperationContext(false, null, false, plc));
+ opCtx != null ? opCtx.withExpiryPolicy(plc) : new CacheOperationContext(false, null, false, plc, false));
}
finally {
gate.leave(prev);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 48fd259..0ad2a9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -246,7 +246,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
try {
CacheOperationContext prj0 = opCtx != null ? opCtx.withExpiryPolicy(plc) :
- new CacheOperationContext(false, null, false, plc);
+ new CacheOperationContext(false, null, false, plc, false);
return new IgniteCacheProxy<>(ctx, delegate, prj0, isAsync(), lock);
}
@@ -261,6 +261,30 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
}
/** {@inheritDoc} */
+ @Override public IgniteCache<K, V> withNoRetries() {
+ CacheOperationContext prev = onEnter(opCtx);
+
+ try {
+ boolean noRetries = opCtx != null && opCtx.noRetries();
+
+ if (noRetries)
+ return this;
+
+ CacheOperationContext opCtx0 = opCtx != null ? opCtx.setNoRetries(true) :
+ new CacheOperationContext(false, null, false, null, true);
+
+ return new IgniteCacheProxy<>(ctx,
+ delegate,
+ opCtx0,
+ isAsync(),
+ lock);
+ }
+ finally {
+ onLeave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public void loadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object... args) {
try {
CacheOperationContext prev = onEnter(opCtx);
@@ -1498,10 +1522,11 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
try {
CacheOperationContext opCtx0 =
new CacheOperationContext(
- opCtx != null ? opCtx.skipStore() : false,
+ opCtx != null && opCtx.skipStore(),
opCtx != null ? opCtx.subjectId() : null,
true,
- opCtx != null ? opCtx.expiry() : null);
+ opCtx != null ? opCtx.expiry() : null,
+ opCtx != null && opCtx.noRetries());
return new IgniteCacheProxy<>((GridCacheContext<K1, V1>)ctx,
(GridCacheAdapter<K1, V1>)delegate,
@@ -1529,8 +1554,9 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
CacheOperationContext opCtx0 =
new CacheOperationContext(true,
opCtx != null ? opCtx.subjectId() : null,
- opCtx != null ? opCtx.isKeepPortable() : false,
- opCtx != null ? opCtx.expiry() : null);
+ opCtx != null && opCtx.isKeepPortable(),
+ opCtx != null ? opCtx.expiry() : null,
+ opCtx != null && opCtx.noRetries());
return new IgniteCacheProxy<>(ctx,
delegate,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 8630421..2863ae8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -767,11 +767,13 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
filter,
subjId,
taskNameHash,
- opCtx != null && opCtx.skipStore());
+ opCtx != null && opCtx.skipStore(),
+ opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
+ waitTopFut);
return asyncOp(new CO<IgniteInternalFuture<Object>>() {
@Override public IgniteInternalFuture<Object> apply() {
- updateFut.map(waitTopFut);
+ updateFut.map();
return updateFut;
}
@@ -830,14 +832,16 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
filter,
subjId,
taskNameHash,
- opCtx != null && opCtx.skipStore());
+ opCtx != null && opCtx.skipStore(),
+ opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
+ true);
if (statsEnabled)
updateFut.listen(new UpdateRemoveTimeStatClosure<>(metrics0(), start));
return asyncOp(new CO<IgniteInternalFuture<Object>>() {
@Override public IgniteInternalFuture<Object> apply() {
- updateFut.map(true);
+ updateFut.map();
return updateFut;
}
@@ -2273,9 +2277,11 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
req.filter(),
req.subjectId(),
req.taskNameHash(),
- req.skipStore());
+ req.skipStore(),
+ MAX_RETRIES,
+ true);
- updateFut.map(true);
+ updateFut.map();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 07f5ecf..53150cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -90,7 +90,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** Mappings. */
@GridToStringInclude
- private final ConcurrentMap<UUID, GridNearAtomicUpdateRequest> mappings;
+ private ConcurrentMap<UUID, GridNearAtomicUpdateRequest> mappings;
/** Error. */
private volatile CachePartialUpdateCheckedException err;
@@ -123,7 +123,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
private GridNearAtomicUpdateRequest singleReq;
/** Raw return value flag. */
- private boolean rawRetval;
+ private final boolean rawRetval;
/** Fast map flag. */
private final boolean fastMap;
@@ -149,6 +149,12 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** Skip store flag. */
private final boolean skipStore;
+ /** Wait for topology future flag. */
+ private final boolean waitTopFut;
+
+ /** Remap count. */
+ private AtomicInteger remapCnt;
+
/**
* @param cctx Cache context.
* @param cache Cache instance.
@@ -183,7 +189,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
final CacheEntryPredicate[] filter,
UUID subjId,
int taskNameHash,
- boolean skipStore
+ boolean skipStore,
+ int remapCnt,
+ boolean waitTopFut
) {
this.rawRetval = rawRetval;
@@ -207,6 +215,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
this.subjId = subjId;
this.taskNameHash = taskNameHash;
this.skipStore = skipStore;
+ this.waitTopFut = waitTopFut;
if (log == null)
log = U.logger(cctx.kernalContext(), logRef, GridFutureAdapter.class);
@@ -218,6 +227,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
!(cctx.writeThrough() && cctx.config().getInterceptor() != null);
nearEnabled = CU.isNearEnabled(cctx);
+
+ this.remapCnt = new AtomicInteger(remapCnt);
}
/** {@inheritDoc} */
@@ -295,10 +306,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/**
* Performs future mapping.
- *
- * @param waitTopFut Whether to wait for topology future.
*/
- public void map(boolean waitTopFut) {
+ public void map() {
AffinityTopologyVersion topVer = null;
IgniteInternalTx tx = cctx.tm().anyActiveThreadTx();
@@ -310,14 +319,62 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
topVer = cctx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId());
if (topVer == null)
- mapOnTopology(null, false, null, waitTopFut);
+ mapOnTopology(null, false, null);
else {
topLocked = true;
+ // Cannot remap.
+ remapCnt.set(1);
+
map0(topVer, null, false, null);
}
}
+ /**
+ * @param failed Keys to remap.
+ */
+ private void remap(Collection<?> failed) {
+ if (futVer != null)
+ cctx.mvcc().removeAtomicFuture(version());
+
+ Collection<Object> remapKeys = new ArrayList<>(failed.size());
+ Collection<Object> remapVals = new ArrayList<>(failed.size());
+
+ Iterator<?> keyIt = keys.iterator();
+ Iterator<?> valsIt = vals.iterator();
+
+ for (Object key : failed) {
+ while (keyIt.hasNext()) {
+ Object nextKey = keyIt.next();
+ Object nextVal = valsIt.next();
+
+ if (F.eq(key, nextKey)) {
+ remapKeys.add(nextKey);
+ remapVals.add(nextVal);
+
+ break;
+ }
+ }
+ }
+
+ keys = remapKeys;
+ vals = remapVals;
+
+ mappings = new ConcurrentHashMap8<>(keys.size(), 1.0f);
+ single = null;
+ futVer = null;
+ err = null;
+ opRes = null;
+ topVer = AffinityTopologyVersion.ZERO;
+ singleNodeId = null;
+ singleReq = null;
+ fastMapRemap = false;
+ updVer = null;
+ topLocked = false;
+
+ map();
+ }
+
/** {@inheritDoc} */
@SuppressWarnings("ConstantConditions")
@Override public boolean onDone(@Nullable Object res, @Nullable Throwable err) {
@@ -331,6 +388,12 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (op == TRANSFORM && retval == null)
retval = Collections.emptyMap();
+ if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) && remapCnt.decrementAndGet() > 0) {
+ remap(X.cause(err, CachePartialUpdateCheckedException.class).failedKeys());
+
+ return false;
+ }
+
if (super.onDone(retval, err)) {
if (futVer != null)
cctx.mvcc().removeAtomicFuture(version());
@@ -353,7 +416,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
Collection<KeyCacheObject> remapKeys = fastMap ? null : res.remapKeys();
- mapOnTopology(remapKeys, true, nodeId, true);
+ mapOnTopology(remapKeys, true, nodeId);
return;
}
@@ -431,10 +494,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* @param keys Keys to map.
* @param remap Boolean flag indicating if this is partial future remap.
* @param oldNodeId Old node ID if remap.
- * @param waitTopFut Whether to wait for topology future.
*/
- private void mapOnTopology(final Collection<?> keys, final boolean remap, final UUID oldNodeId,
- final boolean waitTopFut) {
+ private void mapOnTopology(final Collection<?> keys, final boolean remap, final UUID oldNodeId) {
cache.topology().readLock();
AffinityTopologyVersion topVer = null;
@@ -465,7 +526,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> t) {
cctx.kernalContext().closure().runLocalSafe(new Runnable() {
@Override public void run() {
- mapOnTopology(keys, remap, oldNodeId, waitTopFut);
+ mapOnTopology(keys, remap, oldNodeId);
}
});
}
@@ -509,7 +570,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
if (remap)
- mapOnTopology(null, true, null, true);
+ mapOnTopology(null, true, null);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
new file mode 100644
index 0000000..89d1040
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ *
+ */
+public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 4;
+ }
+
+ /**
+ * @return Keys count for the test.
+ */
+ protected abstract int keysCount();
+
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+ CacheConfiguration cfg = super.cacheConfiguration(gridName);
+
+ cfg.setBackups(1);
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPut() throws Exception {
+ final AtomicBoolean finished = new AtomicBoolean();
+
+ IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ while (!finished.get()) {
+ stopGrid(3);
+
+ U.sleep(300);
+
+ startGrid(3);
+ }
+
+ return null;
+ }
+ });
+
+ int keysCnt = keysCount();
+
+ for (int i = 0; i < keysCnt; i++)
+ ignite(0).cache(null).put(i, i);
+
+ finished.set(true);
+ fut.get();
+
+ for (int i = 0; i < keysCnt; i++)
+ assertEquals(i, ignite(0).cache(null).get(i));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testFailWithNoRetries() throws Exception {
+ final AtomicBoolean finished = new AtomicBoolean();
+
+ IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ while (!finished.get()) {
+ stopGrid(3);
+
+ U.sleep(300);
+
+ startGrid(3);
+ }
+
+ return null;
+ }
+ });
+
+ int keysCnt = keysCount();
+
+ boolean exceptionThrown = false;
+
+ for (int i = 0; i < keysCnt; i++) {
+ try {
+ ignite(0).cache(null).withNoRetries().put(i, i);
+ }
+ catch (Exception e) {
+ assertTrue("Invalid exception: " + e, X.hasCause(e, ClusterTopologyCheckedException.class) || X.hasCause(e, CachePartialUpdateException.class));
+
+ exceptionThrown = true;
+
+ break;
+ }
+ }
+
+ assertTrue(exceptionThrown);
+
+ finished.set(true);
+ fut.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return 3 * 60 * 1000;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java
new file mode 100644
index 0000000..e76663a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.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.processors.cache.distributed.dht;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class IgniteCachePutRetryAtomicSelfTest extends IgniteCachePutRetryAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.ATOMIC;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int keysCount() {
+ return 60_000;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3787a9d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
new file mode 100644
index 0000000..e65459a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class IgniteCachePutRetryTransactionalSelfTest extends IgniteCachePutRetryAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int keysCount() {
+ return 20_000;
+ }
+}
[10/50] incubator-ignite git commit: ignite-973-2 - enabled test
Posted by sb...@apache.org.
ignite-973-2 - enabled 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/e0b573b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e0b573b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e0b573b1
Branch: refs/heads/ignite-752
Commit: e0b573b1337b88691f2d69087ac64cad531c8b9e
Parents: b7bb251
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Jun 23 15:30:59 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Jun 23 15:30:59 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java | 5 -----
1 file changed, 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e0b573b1/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java
index e131470..dc25af5 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java
@@ -22,11 +22,6 @@ package org.apache.ignite.internal.processors.cache;
*/
public class IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest extends IgniteCacheQueryOffheapMultiThreadedSelfTest {
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-971");
- }
-
- /** {@inheritDoc} */
@Override protected boolean evictsEnabled() {
return true;
}
[11/50] incubator-ignite git commit: ignite-973-2 - swap read before
remove
Posted by sb...@apache.org.
ignite-973-2 - swap read before remove
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e1243b40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e1243b40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e1243b40
Branch: refs/heads/ignite-752
Commit: e1243b40537ac883271eb7cab492e8ef86f7b330
Parents: e0b573b
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Jun 23 23:13:03 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Jun 23 23:13:03 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheSwapManager.java | 98 +++++++++++++-------
.../inmemory/GridTestSwapSpaceSpi.java | 3 +-
.../processors/query/h2/opt/GridH2Table.java | 2 +-
.../cache/IgniteCacheOffheapEvictQueryTest.java | 2 +-
4 files changed, 66 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1243b40/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 e45ec2d..7595a1d 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
@@ -582,6 +582,13 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
part,
key.valueBytes(cctx.cacheObjectContext()));
+ ClassLoader ldr = cctx.deploy().globalLoader();
+
+ GridCacheQueryManager qryMgr = cctx.queries();
+
+ if (qryMgr != null && !readSwapBeforeRemove(key, swapKey, ldr))
+ return null; // Not found.
+
swapMgr.remove(spaceName, swapKey, new CI1<byte[]>() {
@Override public void apply(byte[] rmv) {
if (cctx.config().isStatisticsEnabled())
@@ -597,7 +604,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
t.set(entry);
CacheObject v = entry.value();
- byte[] valBytes = entry.valueBytes();
// Event notification.
if (cctx.events().isRecordable(EVT_CACHE_OBJECT_UNSWAPPED)) {
@@ -621,18 +627,13 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// Always fire this event, since preloading depends on it.
onUnswapped(part, key, entry);
-
- GridCacheQueryManager qryMgr = cctx.queries();
-
- if (qryMgr != null)
- qryMgr.onUnswap(key, v);
}
catch (IgniteCheckedException e) {
err.set(e);
}
}
}
- }, cctx.deploy().globalLoader());
+ }, ldr);
if (err.get() != null)
throw err.get();
@@ -839,7 +840,17 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
assert swapEnabled;
assert unprocessedKeys != null;
- // Swap is enabled.
+ ClassLoader ldr = cctx.deploy().globalLoader();
+
+ if (qryMgr != null) { // Unswap for indexing.
+ Iterator<SwapKey> iter = unprocessedKeys.iterator();
+
+ while (iter.hasNext()) {
+ if (!readSwapBeforeRemove(null, iter.next(), ldr))
+ iter.remove(); // We will not do unswapping further -> need to skip the key.
+ }
+ }
+
final GridTuple<IgniteCheckedException> err = F.t1();
swapMgr.removeAll(spaceName,
@@ -891,9 +902,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// Always fire this event, since preloading depends on it.
onUnswapped(swapKey.partition(), key, entry);
-
- if (qryMgr != null)
- qryMgr.onUnswap(key, entry.value());
}
catch (IgniteCheckedException e) {
err.set(e);
@@ -901,7 +909,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
}
},
- cctx.deploy().globalLoader());
+ ldr);
if (err.get() != null)
throw err.get();
@@ -923,7 +931,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
boolean rmv = offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
- if(rmv && cctx.config().isStatisticsEnabled())
+ if (rmv && cctx.config().isStatisticsEnabled())
cctx.cache().metrics0().onOffHeapRemove();
return rmv;
@@ -982,6 +990,37 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/**
+ * Reads value from swap and unswaps it to indexing.
+ *
+ * @param key Key.
+ * @param swapKey Swap key.
+ * @param ldr Class loader.
+ * @return {@code true} If read and unswapped successfully.
+ * @throws IgniteCheckedException If failed.
+ */
+ private boolean readSwapBeforeRemove(@Nullable KeyCacheObject key, SwapKey swapKey, ClassLoader ldr)
+ throws IgniteCheckedException {
+ assert cctx.queries() != null;
+
+ byte[] entryBytes = swapMgr.read(spaceName, swapKey, ldr);
+
+ if (entryBytes == null)
+ return false;
+
+ GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
+
+ if (entry == null)
+ return false;
+
+ if (key == null)
+ key = cctx.toCacheKeyObject(swapKey.keyBytes());
+
+ cctx.queries().onUnswap(key, entry.value());
+
+ return true;
+ }
+
+ /**
* @param key Key to remove.
* @throws IgniteCheckedException If failed.
*/
@@ -1013,33 +1052,20 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
part,
key.valueBytes(cctx.cacheObjectContext()));
+ ClassLoader ldr = cctx.deploy().globalLoader();
+
+ if (qryMgr != null && !readSwapBeforeRemove(key, swapKey, ldr))
+ return; // Not found.
+
swapMgr.remove(spaceName,
swapKey,
- new CI1<byte[]>() {
+ cctx.config().isStatisticsEnabled() ? new CI1<byte[]>() {
@Override public void apply(byte[] rmv) {
- if (rmv == null)
- return;
-
- try {
- if (cctx.config().isStatisticsEnabled())
- cctx.cache().metrics0().onSwapRemove();
-
- if (qryMgr == null)
- return;
-
- GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(rmv));
-
- if (entry == null)
- return;
-
- qryMgr.onUnswap(key, entry.value());
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException(e);
- }
+ if (rmv != null)
+ cctx.cache().metrics0().onSwapRemove();
}
- },
- cctx.deploy().globalLoader());
+ } : null,
+ ldr);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1243b40/modules/core/src/test/java/org/apache/ignite/spi/swapspace/inmemory/GridTestSwapSpaceSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/swapspace/inmemory/GridTestSwapSpaceSpi.java b/modules/core/src/test/java/org/apache/ignite/spi/swapspace/inmemory/GridTestSwapSpaceSpi.java
index d8303a4..2a3c940 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/swapspace/inmemory/GridTestSwapSpaceSpi.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/swapspace/inmemory/GridTestSwapSpaceSpi.java
@@ -285,7 +285,8 @@ public class GridTestSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceS
byte[] val = data.remove(key);
if (val != null) {
- c.apply(val);
+ if (c != null)
+ c.apply(val);
fireEvent(EVT_SWAP_SPACE_DATA_REMOVED, name, key.keyBytes());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1243b40/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
index 92991af..86dbf06 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
@@ -393,7 +393,7 @@ public class GridH2Table extends TableBase {
for (int i = 2, len = idxs.size(); i < len; i++) {
Row res = index(i).remove(old);
- assert eq(pk, res, old): "\n" + old + "\n" + res;
+ assert eq(pk, res, old): "\n" + old + "\n" + res + "\n" + i + " -> " + index(i).getName();
}
}
else
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1243b40/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
index 45d744e..f9ff69e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
@@ -86,7 +86,7 @@ public class IgniteCacheOffheapEvictQueryTest extends GridCommonAbstractTest {
*/
public void testEvictAndRemove() throws Exception {
final int KEYS_CNT = 3000;
- final int THREADS_CNT = 50;
+ final int THREADS_CNT = 250;
final IgniteCache<Integer,Integer> c = startGrid().cache(null);
[23/50] incubator-ignite git commit: Merge branches 'ignite-973-2'
and 'ignite-sprint-7' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Posted by sb...@apache.org.
Merge branches 'ignite-973-2' and 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/712e7d5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/712e7d5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/712e7d5c
Branch: refs/heads/ignite-752
Commit: 712e7d5c070db6d3cb189343cbb585a72a7d2717
Parents: 211ad65 e91bc48
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Jun 30 18:27:33 2015 -0700
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Jun 30 18:27:33 2015 -0700
----------------------------------------------------------------------
.../ClientAbstractConnectivitySelfTest.java | 4 +-
.../org/apache/ignite/cluster/ClusterGroup.java | 18 +-
.../org/apache/ignite/cluster/ClusterNode.java | 2 +
.../ignite/compute/ComputeTaskSplitAdapter.java | 2 +-
.../configuration/CacheConfiguration.java | 105 +--
.../configuration/NearCacheConfiguration.java | 10 +-
.../ignite/internal/GridKernalContextImpl.java | 5 +-
.../internal/cluster/ClusterGroupAdapter.java | 50 +-
.../cluster/IgniteClusterAsyncImpl.java | 12 +-
.../discovery/GridDiscoveryManager.java | 32 +-
.../cache/GridCacheDeploymentManager.java | 10 +-
.../GridCachePartitionExchangeManager.java | 6 +-
.../processors/cache/GridCacheProcessor.java | 62 +-
.../processors/clock/GridClockServer.java | 21 +-
.../processors/plugin/CachePluginManager.java | 10 +-
.../processors/rest/GridRestProcessor.java | 4 +-
.../handlers/task/GridTaskCommandHandler.java | 12 +-
.../processors/task/GridTaskWorker.java | 4 +-
.../internal/util/GridConfigurationFinder.java | 55 +-
.../ignite/internal/util/IgniteUtils.java | 6 +-
.../shmem/IpcSharedMemoryServerEndpoint.java | 10 +-
.../apache/ignite/internal/visor/VisorJob.java | 2 +
.../internal/visor/log/VisorLogSearchTask.java | 2 +-
.../visor/node/VisorNodeDataCollectorJob.java | 4 +
.../visor/query/VisorQueryCleanupTask.java | 14 +
.../util/VisorClusterGroupEmptyException.java | 37 +
.../ignite/spi/discovery/tcp/ClientImpl.java | 151 ++--
.../ignite/spi/discovery/tcp/ServerImpl.java | 103 ++-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 3 +-
.../TcpDiscoveryMulticastIpFinder.java | 74 +-
.../core/src/test/config/spark/spark-config.xml | 46 ++
.../internal/ClusterGroupAbstractTest.java | 777 ++++++++++++++++++
.../internal/ClusterGroupHostsSelfTest.java | 141 ++++
.../ignite/internal/ClusterGroupSelfTest.java | 251 ++++++
.../internal/GridDiscoveryEventSelfTest.java | 12 +-
.../internal/GridProjectionAbstractTest.java | 784 -------------------
.../ignite/internal/GridProjectionSelfTest.java | 251 ------
.../apache/ignite/internal/GridSelfTest.java | 2 +-
.../IgniteTopologyPrintFormatSelfTest.java | 289 +++++++
.../cache/GridCacheDaemonNodeStopSelfTest.java | 119 ---
.../IgniteDaemonNodeMarshallerCacheTest.java | 192 +++++
...achePartitionedMultiNodeFullApiSelfTest.java | 4 +-
.../internal/util/IgniteUtilsSelfTest.java | 22 +
.../tcp/TcpClientDiscoverySpiSelfTest.java | 265 ++++++-
.../ignite/testsuites/IgniteBasicTestSuite.java | 7 +-
.../testsuites/IgniteCacheTestSuite3.java | 1 -
.../testsuites/IgniteKernalSelfTestSuite.java | 1 +
.../p2p/GridP2PContinuousDeploymentTask1.java | 2 +-
.../ignite/schema/model/PojoDescriptor.java | 2 +
.../apache/ignite/schema/model/PojoField.java | 1 +
.../parser/dialect/OracleMetadataDialect.java | 2 +-
.../org/apache/ignite/spark/IgniteContext.scala | 50 +-
.../org/apache/ignite/spark/IgniteRddSpec.scala | 18 +
.../commands/cache/VisorCacheCommand.scala | 7 +-
pom.xml | 12 +-
scripts/git-patch-prop.sh | 2 +-
56 files changed, 2685 insertions(+), 1405 deletions(-)
----------------------------------------------------------------------
[43/50] incubator-ignite git commit: ignite-428 Review fixes
Posted by sb...@apache.org.
ignite-428 Review fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/63fce5a4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/63fce5a4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/63fce5a4
Branch: refs/heads/ignite-752
Commit: 63fce5a4920531ad8cd9afc47d829bb2fa4bc438
Parents: 2c41739
Author: agura <ag...@gridgain.com>
Authored: Thu Jun 25 22:18:00 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 19:39:12 2015 +0300
----------------------------------------------------------------------
modules/kafka/pom.xml | 18 +-
.../ignite/stream/kafka/KafkaStreamer.java | 121 ++++++---
.../stream/kafka/KafkaEmbeddedBroker.java | 251 ++++++++++---------
.../kafka/KafkaIgniteStreamerSelfTest.java | 131 +++++-----
.../ignite/stream/kafka/SimplePartitioner.java | 27 +-
5 files changed, 293 insertions(+), 255 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 165ec1c..43909bc 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.6-SNAPSHOT</version>
<dependencies>
<dependency>
@@ -39,6 +39,7 @@
<artifactId>ignite-core</artifactId>
<version>${project.version}</version>
</dependency>
+
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.10</artifactId>
@@ -66,6 +67,7 @@
</exclusion>
</exclusions>
</dependency>
+
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
@@ -73,12 +75,6 @@
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-log4j</artifactId>
<version>${project.version}</version>
@@ -90,7 +86,6 @@
<version>4.2</version>
</dependency>
-
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
@@ -103,13 +98,6 @@
</dependency>
<dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.8.3</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-spring</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
index e0240ce..e9ad0bd 100644
--- a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
+++ b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
@@ -30,16 +30,17 @@ import java.util.*;
import java.util.concurrent.*;
/**
- * Server that subscribes to topic messages from Kafka broker, streams its to key-value pairs into {@link
- * org.apache.ignite.IgniteDataStreamer} instance.
+ * Server that subscribes to topic messages from Kafka broker and streams its to key-value pairs into
+ * {@link IgniteDataStreamer} instance.
* <p>
- * Uses Kafka's High Level Consumer API to read messages from Kafka
+ * Uses Kafka's High Level Consumer API to read messages from Kafka.
*
* @see <a href="https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example">Consumer Consumer Group
* Example</a>
*/
-public class KafkaStreamer<T, K, V>
- extends StreamAdapter<T, K, V> {
+public class KafkaStreamer<T, K, V> extends StreamAdapter<T, K, V> {
+ /** Retry timeout. */
+ private static final long DFLT_RETRY_TIMEOUT = 10000;
/** Logger. */
private IgniteLogger log;
@@ -53,61 +54,78 @@ public class KafkaStreamer<T, K, V>
/** Number of threads to process kafka streams. */
private int threads;
- /** Kafka Consumer Config. */
- private ConsumerConfig consumerConfig;
+ /** Kafka consumer config. */
+ private ConsumerConfig consumerCfg;
- /** Key Decoder. */
+ /** Key decoder. */
private Decoder<K> keyDecoder;
- /** Value Decoder. */
- private Decoder<V> valueDecoder;
+ /** Value decoder. */
+ private Decoder<V> valDecoder;
- /** Kafka Consumer connector. */
+ /** Kafka consumer connector. */
private ConsumerConnector consumer;
+ /** Retry timeout. */
+ private long retryTimeout = DFLT_RETRY_TIMEOUT;
+
+ /** Stopped. */
+ private volatile boolean stopped;
+
/**
- * Sets the topic.
+ * Sets the topic name.
*
- * @param topic Topic Name.
+ * @param topic Topic name.
*/
- public void setTopic(final String topic) {
+ public void setTopic(String topic) {
this.topic = topic;
}
/**
* Sets the threads.
*
- * @param threads Number of Threads.
+ * @param threads Number of threads.
*/
- public void setThreads(final int threads) {
+ public void setThreads(int threads) {
this.threads = threads;
}
/**
* Sets the consumer config.
*
- * @param consumerConfig Consumer configuration.
+ * @param consumerCfg Consumer configuration.
*/
- public void setConsumerConfig(final ConsumerConfig consumerConfig) {
- this.consumerConfig = consumerConfig;
+ public void setConsumerConfig(ConsumerConfig consumerCfg) {
+ this.consumerCfg = consumerCfg;
}
/**
* Sets the key decoder.
*
- * @param keyDecoder Key Decoder.
+ * @param keyDecoder Key decoder.
*/
- public void setKeyDecoder(final Decoder<K> keyDecoder) {
+ public void setKeyDecoder(Decoder<K> keyDecoder) {
this.keyDecoder = keyDecoder;
}
/**
* Sets the value decoder.
*
- * @param valueDecoder Value Decoder
+ * @param valDecoder Value decoder.
*/
- public void setValueDecoder(final Decoder<V> valueDecoder) {
- this.valueDecoder = valueDecoder;
+ public void setValueDecoder(Decoder<V> valDecoder) {
+ this.valDecoder = valDecoder;
+ }
+
+ /**
+ * Sets the retry timeout.
+ *
+ * @param retryTimeout Retry timeout.
+ */
+ public void setRetryTimeout(long retryTimeout) {
+ A.ensure(retryTimeout > 0, "retryTimeout > 0");
+
+ this.retryTimeout = retryTimeout;
}
/**
@@ -120,35 +138,56 @@ public class KafkaStreamer<T, K, V>
A.notNull(getIgnite(), "ignite");
A.notNull(topic, "topic");
A.notNull(keyDecoder, "key decoder");
- A.notNull(valueDecoder, "value decoder");
- A.notNull(consumerConfig, "kafka consumer config");
+ A.notNull(valDecoder, "value decoder");
+ A.notNull(consumerCfg, "kafka consumer config");
A.ensure(threads > 0, "threads > 0");
log = getIgnite().log();
- consumer = kafka.consumer.Consumer.createJavaConsumerConnector(consumerConfig);
+ consumer = kafka.consumer.Consumer.createJavaConsumerConnector(consumerCfg);
+
+ Map<String, Integer> topicCntMap = new HashMap<>();
- Map<String, Integer> topicCountMap = new HashMap<>();
- topicCountMap.put(topic, threads);
+ topicCntMap.put(topic, threads);
- Map<String, List<KafkaStream<K, V>>> consumerMap = consumer.createMessageStreams(topicCountMap, keyDecoder,
- valueDecoder);
+ Map<String, List<KafkaStream<K, V>>> consumerMap =
+ consumer.createMessageStreams(topicCntMap, keyDecoder, valDecoder);
List<KafkaStream<K, V>> streams = consumerMap.get(topic);
// Now launch all the consumer threads.
executor = Executors.newFixedThreadPool(threads);
+ stopped = false;
+
// Now create an object to consume the messages.
- for (final KafkaStream<K,V> stream : streams) {
+ for (final KafkaStream<K, V> stream : streams) {
executor.submit(new Runnable() {
@Override public void run() {
-
- ConsumerIterator<K, V> it = stream.iterator();
-
- while (it.hasNext()) {
- final MessageAndMetadata<K, V> messageAndMetadata = it.next();
- getStreamer().addData(messageAndMetadata.key(), messageAndMetadata.message());
+ while (!stopped) {
+ try {
+ for (ConsumerIterator<K, V> it = stream.iterator(); it.hasNext() && !stopped; ) {
+ MessageAndMetadata<K, V> msg = it.next();
+
+ try {
+ getStreamer().addData(msg.key(), msg.message());
+ }
+ catch (Exception e) {
+ U.warn(log, "Message is ignored due to an error [msg=" + msg + ']', e);
+ }
+ }
+ }
+ catch (Exception e) {
+ U.warn(log, "Message can't be consumed from stream. Retry after " +
+ retryTimeout + " ms.", e);
+
+ try {
+ Thread.sleep(retryTimeout);
+ }
+ catch (InterruptedException ie) {
+ // No-op.
+ }
+ }
}
}
});
@@ -159,6 +198,8 @@ public class KafkaStreamer<T, K, V>
* Stops streamer.
*/
public void stop() {
+ stopped = true;
+
if (consumer != null)
consumer.shutdown();
@@ -168,11 +209,11 @@ public class KafkaStreamer<T, K, V>
try {
if (!executor.awaitTermination(5000, TimeUnit.MILLISECONDS))
if (log.isDebugEnabled())
- log.debug("Timed out waiting for consumer threads to shut down, exiting uncleanly");
+ log.debug("Timed out waiting for consumer threads to shut down, exiting uncleanly.");
}
catch (InterruptedException e) {
if (log.isDebugEnabled())
- log.debug("Interrupted during shutdown, exiting uncleanly");
+ log.debug("Interrupted during shutdown, exiting uncleanly.");
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
index 28533f7..98b9e4c 100644
--- a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
@@ -17,7 +17,6 @@
package org.apache.ignite.stream.kafka;
-import org.apache.commons.io.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.zookeeper.server.*;
@@ -25,6 +24,7 @@ import kafka.admin.*;
import kafka.api.*;
import kafka.api.Request;
import kafka.producer.*;
+import kafka.serializer.*;
import kafka.server.*;
import kafka.utils.*;
import org.I0Itec.zkclient.*;
@@ -39,106 +39,104 @@ import java.util.concurrent.*;
* Kafka Embedded Broker.
*/
public class KafkaEmbeddedBroker {
-
- /** Default ZooKeeper Host. */
+ /** Default ZooKeeper host. */
private static final String ZK_HOST = "localhost";
- /** Broker Port. */
+ /** Broker port. */
private static final int BROKER_PORT = 9092;
- /** ZooKeeper Connection Timeout. */
+ /** ZooKeeper connection timeout. */
private static final int ZK_CONNECTION_TIMEOUT = 6000;
- /** ZooKeeper Session Timeout. */
+ /** ZooKeeper session timeout. */
private static final int ZK_SESSION_TIMEOUT = 6000;
/** ZooKeeper port. */
private static int zkPort = 0;
- /** Is ZooKeeper Ready. */
+ /** Is ZooKeeper ready. */
private boolean zkReady;
- /** Kafka Config. */
- private KafkaConfig brokerConfig;
+ /** Kafka config. */
+ private KafkaConfig brokerCfg;
- /** Kafka Server. */
- private KafkaServer kafkaServer;
+ /** Kafka server. */
+ private KafkaServer kafkaSrv;
- /** ZooKeeper Client. */
+ /** ZooKeeper client. */
private ZkClient zkClient;
/** Embedded ZooKeeper. */
private EmbeddedZooKeeper zooKeeper;
/**
- * Creates an embedded Kafka Broker.
+ * Creates an embedded Kafka broker.
*/
public KafkaEmbeddedBroker() {
try {
setupEmbeddedZooKeeper();
+
setupEmbeddedKafkaServer();
}
catch (IOException | InterruptedException e) {
- throw new RuntimeException("failed to start Kafka Broker " + e);
+ throw new RuntimeException("Failed to start Kafka broker " + e);
}
-
}
/**
- * @return ZooKeeper Address.
+ * @return ZooKeeper address.
*/
public static String getZKAddress() {
- return ZK_HOST + ":" + zkPort;
+ return ZK_HOST + ':' + zkPort;
}
/**
* Creates a Topic.
*
- * @param topic topic name
- * @param partitions number of paritions for the topic
- * @param replicationFactor replication factor
- * @throws TimeoutException
- * @throws InterruptedException
+ * @param topic Topic name.
+ * @param partitions Number of partitions for the topic.
+ * @param replicationFactor Replication factor.
+ * @throws TimeoutException If operation is timed out.
+ * @throws InterruptedException If interrupted.
*/
- public void createTopic(String topic, final int partitions, final int replicationFactor)
+ public void createTopic(String topic, int partitions, int replicationFactor)
throws TimeoutException, InterruptedException {
AdminUtils.createTopic(zkClient, topic, partitions, replicationFactor, new Properties());
+
waitUntilMetadataIsPropagated(topic, 0, 10000, 100);
}
/**
- * Sends message to Kafka Broker.
+ * Sends message to Kafka broker.
*
- * @param keyedMessages List of Keyed Messages.
+ * @param keyedMessages List of keyed messages.
* @return Producer used to send the message.
*/
- public Producer sendMessages(List<KeyedMessage<String, String>> keyedMessages) {
+ public Producer<String, String> sendMessages(List<KeyedMessage<String, String>> keyedMessages) {
Producer<String, String> producer = new Producer<>(getProducerConfig());
+
producer.send(scala.collection.JavaConversions.asScalaBuffer(keyedMessages));
+
return producer;
}
/**
- * Shuts down Kafka Broker.
- *
- * @throws IOException
+ * Shuts down Kafka broker.
*/
- public void shutdown()
- throws IOException {
-
+ public void shutdown() {
zkReady = false;
- if (kafkaServer != null)
- kafkaServer.shutdown();
+ if (kafkaSrv != null)
+ kafkaSrv.shutdown();
- List<String> logDirs = scala.collection.JavaConversions.asJavaList(brokerConfig.logDirs());
+ List<String> logDirs = scala.collection.JavaConversions.asJavaList(brokerCfg.logDirs());
- for (String logDir : logDirs) {
- FileUtils.deleteDirectory(new File(logDir));
- }
+ for (String logDir : logDirs)
+ U.delete(new File(logDir));
if (zkClient != null) {
zkClient.close();
+
zkClient = null;
}
@@ -148,16 +146,15 @@ public class KafkaEmbeddedBroker {
zooKeeper.shutdown();
}
catch (IOException e) {
- // ignore
+ // No-op.
}
zooKeeper = null;
}
-
}
/**
- * @return the Zookeeper Client
+ * @return ZooKeeper client.
*/
private ZkClient getZkClient() {
A.ensure(zkReady, "Zookeeper not setup yet");
@@ -169,102 +166,105 @@ public class KafkaEmbeddedBroker {
/**
* Checks if topic metadata is propagated.
*
- * @param topic topic name
- * @param partition partition
- * @return true if propagated otherwise false
+ * @param topic Topic name.
+ * @param part Partition.
+ * @return {@code True} if propagated, otherwise {@code false}.
*/
- private boolean isMetadataPropagated(final String topic, final int partition) {
- final scala.Option<PartitionStateInfo> partitionStateOption = kafkaServer.apis().metadataCache().getPartitionInfo(
- topic, partition);
- if (partitionStateOption.isDefined()) {
- final PartitionStateInfo partitionState = partitionStateOption.get();
- final LeaderAndIsr leaderAndInSyncReplicas = partitionState.leaderIsrAndControllerEpoch().leaderAndIsr();
-
- if (ZkUtils.getLeaderForPartition(getZkClient(), topic, partition) != null
- && Request.isValidBrokerId(leaderAndInSyncReplicas.leader())
- && leaderAndInSyncReplicas.isr().size() >= 1)
- return true;
+ private boolean isMetadataPropagated(String topic, int part) {
+ scala.Option<PartitionStateInfo> partStateOption =
+ kafkaSrv.apis().metadataCache().getPartitionInfo(topic, part);
- }
- return false;
+ if (!partStateOption.isDefined())
+ return false;
+
+ PartitionStateInfo partState = partStateOption.get();
+
+ LeaderAndIsr LeaderAndIsr = partState.leaderIsrAndControllerEpoch().leaderAndIsr();
+
+ return ZkUtils.getLeaderForPartition(getZkClient(), topic, part) != null &&
+ Request.isValidBrokerId(LeaderAndIsr.leader()) && LeaderAndIsr.isr().size() >= 1;
}
/**
* Waits until metadata is propagated.
*
- * @param topic topic name
- * @param partition partition
- * @param timeout timeout value in millis
- * @param interval interval in millis to sleep
- * @throws TimeoutException
- * @throws InterruptedException
+ * @param topic Topic name.
+ * @param part Partition.
+ * @param timeout Timeout value in millis.
+ * @param interval Interval in millis to sleep.
+ * @throws TimeoutException If operation is timed out.
+ * @throws InterruptedException If interrupted.
*/
- private void waitUntilMetadataIsPropagated(final String topic, final int partition, final long timeout,
- final long interval) throws TimeoutException, InterruptedException {
+ private void waitUntilMetadataIsPropagated(String topic, int part, long timeout, long interval)
+ throws TimeoutException, InterruptedException {
int attempt = 1;
- final long startTime = System.currentTimeMillis();
+
+ long startTime = System.currentTimeMillis();
while (true) {
- if (isMetadataPropagated(topic, partition))
+ if (isMetadataPropagated(topic, part))
return;
- final long duration = System.currentTimeMillis() - startTime;
+ long duration = System.currentTimeMillis() - startTime;
if (duration < timeout)
Thread.sleep(interval);
else
- throw new TimeoutException("metadata propagate timed out, attempt=" + attempt);
+ throw new TimeoutException("Metadata propagation is timed out, attempt " + attempt);
attempt++;
}
-
}
/**
- * Sets up embedded Kafka Server
+ * Sets up embedded Kafka server.
*
- * @throws IOException
+ * @throws IOException If failed.
*/
- private void setupEmbeddedKafkaServer()
- throws IOException {
+ private void setupEmbeddedKafkaServer() throws IOException {
A.ensure(zkReady, "Zookeeper should be setup before hand");
- brokerConfig = new KafkaConfig(getBrokerConfig());
- kafkaServer = new KafkaServer(brokerConfig, SystemTime$.MODULE$);
- kafkaServer.startup();
+ brokerCfg = new KafkaConfig(getBrokerConfig());
+
+ kafkaSrv = new KafkaServer(brokerCfg, SystemTime$.MODULE$);
+
+ kafkaSrv.startup();
}
/**
- * Sets up embedded zooKeeper
+ * Sets up embedded ZooKeeper.
*
- * @throws IOException
- * @throws InterruptedException
+ * @throws IOException If failed.
+ * @throws InterruptedException If interrupted.
*/
- private void setupEmbeddedZooKeeper()
- throws IOException, InterruptedException {
+ private void setupEmbeddedZooKeeper() throws IOException, InterruptedException {
EmbeddedZooKeeper zooKeeper = new EmbeddedZooKeeper(ZK_HOST, zkPort);
+
zooKeeper.startup();
+
zkPort = zooKeeper.getActualPort();
+
zkClient = new ZkClient(getZKAddress(), ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT, ZKStringSerializer$.MODULE$);
+
zkReady = true;
}
/**
- * @return Kafka Broker Address.
+ * @return Kafka broker address.
*/
private static String getBrokerAddress() {
- return ZK_HOST + ":" + BROKER_PORT;
+ return ZK_HOST + ':' + BROKER_PORT;
}
/**
- * Gets KafKa Brofer Config
+ * Gets Kafka broker config.
*
- * @return Kafka Broker Config
- * @throws IOException
+ * @return Kafka broker config.
+ * @throws IOException If failed.
*/
- private static Properties getBrokerConfig()
- throws IOException {
+ private static Properties getBrokerConfig() throws IOException {
Properties props = new Properties();
+
props.put("broker.id", "0");
props.put("host.name", ZK_HOST);
props.put("port", "" + BROKER_PORT);
@@ -272,60 +272,63 @@ public class KafkaEmbeddedBroker {
props.put("zookeeper.connect", getZKAddress());
props.put("log.flush.interval.messages", "1");
props.put("replica.socket.timeout.ms", "1500");
+
return props;
}
/**
- * @return Kafka Producer Config
+ * @return Kafka Producer config.
*/
private static ProducerConfig getProducerConfig() {
Properties props = new Properties();
+
props.put("metadata.broker.list", getBrokerAddress());
- props.put("serializer.class", "kafka.serializer.StringEncoder");
- props.put("key.serializer.class", "kafka.serializer.StringEncoder");
- props.put("partitioner.class", "org.apache.ignite.kafka.SimplePartitioner");
+ props.put("serializer.class", StringEncoder.class.getName());
+ props.put("key.serializer.class", StringEncoder.class.getName());
+ props.put("partitioner.class", SimplePartitioner.class.getName());
+
return new ProducerConfig(props);
}
/**
- * Creates Temp Directory
+ * Creates temp directory.
*
- * @param prefix prefix
- * @return Created File.
- * @throws IOException
+ * @param prefix Prefix.
+ * @return Created file.
+ * @throws IOException If failed.
*/
- private static File createTempDir(final String prefix)
- throws IOException {
- final Path path = Files.createTempDirectory(prefix);
- return path.toFile();
+ private static File createTempDir( String prefix) throws IOException {
+ Path path = Files.createTempDirectory(prefix);
+ return path.toFile();
}
/**
- * Creates Embedded ZooKeeper.
+ * Creates embedded ZooKeeper.
*/
private static class EmbeddedZooKeeper {
- /** Default ZooKeeper Host. */
+ /** Default ZooKeeper host. */
private final String zkHost;
- /** Default ZooKeeper Port. */
+ /** Default ZooKeeper port. */
private final int zkPort;
- /** NIO Context Factory. */
+ /** NIO context factory. */
private NIOServerCnxnFactory factory;
- /** Snapshot Directory. */
+ /** Snapshot directory. */
private File snapshotDir;
- /** Log Directory. */
+ /** Log directory. */
private File logDir;
/**
- * Creates an embedded Zookeeper
- * @param zkHost zookeeper host
- * @param zkPort zookeeper port
+ * Creates an embedded ZooKeeper.
+ *
+ * @param zkHost ZooKeeper host.
+ * @param zkPort ZooKeeper port.
*/
- EmbeddedZooKeeper(final String zkHost, final int zkPort) {
+ EmbeddedZooKeeper(String zkHost, int zkPort) {
this.zkHost = zkHost;
this.zkPort = zkPort;
}
@@ -333,22 +336,25 @@ public class KafkaEmbeddedBroker {
/**
* Starts up ZooKeeper.
*
- * @throws IOException
- * @throws InterruptedException
+ * @throws IOException If failed.
+ * @throws InterruptedException If interrupted.
*/
- void startup()
- throws IOException, InterruptedException {
+ void startup() throws IOException, InterruptedException {
snapshotDir = createTempDir("_ss");
+
logDir = createTempDir("_log");
- ZooKeeperServer zooServer = new ZooKeeperServer(snapshotDir, logDir, 500);
+
+ ZooKeeperServer zkSrv = new ZooKeeperServer(snapshotDir, logDir, 500);
+
factory = new NIOServerCnxnFactory();
+
factory.configure(new InetSocketAddress(zkHost, zkPort), 16);
- factory.startup(zooServer);
+
+ factory.startup(zkSrv);
}
/**
- *
- * @return actual port zookeeper is started
+ * @return Actual port ZooKeeper is started.
*/
int getActualPort() {
return factory.getLocalPort();
@@ -357,17 +363,16 @@ public class KafkaEmbeddedBroker {
/**
* Shuts down ZooKeeper.
*
- * @throws IOException
+ * @throws IOException If failed.
*/
- void shutdown()
- throws IOException {
+ void shutdown() throws IOException {
if (factory != null) {
factory.shutdown();
U.delete(snapshotDir);
+
U.delete(logDir);
}
}
}
-
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
index 5972639..2473990 100644
--- a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
@@ -32,31 +32,31 @@ import java.util.*;
import java.util.concurrent.*;
import static org.apache.ignite.events.EventType.*;
+import static org.apache.ignite.stream.kafka.KafkaEmbeddedBroker.*;
/**
* Tests {@link KafkaStreamer}.
*/
-public class KafkaIgniteStreamerSelfTest
- extends GridCommonAbstractTest {
+public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
/** Embedded Kafka. */
private KafkaEmbeddedBroker embeddedBroker;
/** Count. */
private static final int CNT = 100;
- /** Test Topic. */
+ /** Test topic. */
private static final String TOPIC_NAME = "page_visits";
- /** Kafka Partition. */
+ /** Kafka partition. */
private static final int PARTITIONS = 4;
- /** Kafka Replication Factor. */
+ /** Kafka replication factor. */
private static final int REPLICATION_FACTOR = 1;
- /** Topic Message Key Prefix. */
+ /** Topic message key prefix. */
private static final String KEY_PREFIX = "192.168.2.";
- /** Topic Message Value Url. */
+ /** Topic message value URL. */
private static final String VALUE_URL = ",www.example.com,";
/** Constructor. */
@@ -65,18 +65,15 @@ public class KafkaIgniteStreamerSelfTest
}
/** {@inheritDoc} */
- @Override
- protected void beforeTest()
- throws Exception {
+ @SuppressWarnings("unchecked")
+ @Override protected void beforeTest() throws Exception {
grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration());
embeddedBroker = new KafkaEmbeddedBroker();
}
/** {@inheritDoc} */
- @Override
- protected void afterTest()
- throws Exception {
+ @Override protected void afterTest() throws Exception {
grid().cache(null).clear();
embeddedBroker.shutdown();
@@ -85,76 +82,80 @@ public class KafkaIgniteStreamerSelfTest
/**
* Tests Kafka streamer.
*
- * @throws TimeoutException
- * @throws InterruptedException
+ * @throws TimeoutException If timed out.
+ * @throws InterruptedException If interrupted.
*/
- public void testKafkaStreamer()
- throws TimeoutException, InterruptedException {
+ public void testKafkaStreamer() throws TimeoutException, InterruptedException {
embeddedBroker.createTopic(TOPIC_NAME, PARTITIONS, REPLICATION_FACTOR);
- Map<String, String> keyValueMap = produceStream(TOPIC_NAME);
- consumerStream(TOPIC_NAME, keyValueMap);
+ Map<String, String> keyValMap = produceStream(TOPIC_NAME);
+
+ consumerStream(TOPIC_NAME, keyValMap);
}
/**
- * Produces/Sends messages to Kafka.
+ * Sends messages to Kafka.
*
* @param topic Topic name.
* @return Map of key value messages.
*/
- private Map<String, String> produceStream(final String topic) {
- final Map<String, String> keyValueMap = new HashMap<>();
-
+ private Map<String, String> produceStream(String topic) {
// Generate random subnets.
List<Integer> subnet = new ArrayList<>();
- int i = 0;
- while (i <= CNT)
- subnet.add(++i);
+ for (int i = 1; i <= CNT; i++)
+ subnet.add(i);
Collections.shuffle(subnet);
- final List<KeyedMessage<String, String>> messages = new ArrayList<>();
- for (int event = 0; event < CNT; event++) {
- long runtime = new Date().getTime();
- String ip = KEY_PREFIX + subnet.get(event);
+ List<KeyedMessage<String, String>> messages = new ArrayList<>(CNT);
+
+ Map<String, String> keyValMap = new HashMap<>();
+
+ for (int evt = 0; evt < CNT; evt++) {
+ long runtime = System.currentTimeMillis();
+
+ String ip = KEY_PREFIX + subnet.get(evt);
+
String msg = runtime + VALUE_URL + ip;
+
messages.add(new KeyedMessage<>(topic, ip, msg));
- keyValueMap.put(ip, msg);
+
+ keyValMap.put(ip, msg);
}
- final Producer<String, String> producer = embeddedBroker.sendMessages(messages);
+ Producer<String, String> producer = embeddedBroker.sendMessages(messages);
+
producer.close();
- return keyValueMap;
+ return keyValMap;
}
/**
- * Consumes Kafka Stream via ignite.
+ * Consumes Kafka stream via Ignite.
*
* @param topic Topic name.
- * @param keyValueMap Expected key value map.
- * @throws TimeoutException TimeoutException.
- * @throws InterruptedException InterruptedException.
+ * @param keyValMap Expected key value map.
+ * @throws TimeoutException If timed out.
+ * @throws InterruptedException If interrupted.
*/
- private void consumerStream(final String topic, final Map<String, String> keyValueMap)
+ private void consumerStream(String topic, Map<String, String> keyValMap)
throws TimeoutException, InterruptedException {
-
KafkaStreamer<String, String, String> kafkaStmr = null;
- final Ignite ignite = grid();
- try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(null)) {
+ Ignite ignite = grid();
+ try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(null)) {
stmr.allowOverwrite(true);
stmr.autoFlushFrequency(10);
- // Configure socket streamer.
+ // Configure Kafka streamer.
kafkaStmr = new KafkaStreamer<>();
// Get the cache.
IgniteCache<String, String> cache = ignite.cache(null);
- // Set ignite instance.
+ // Set Ignite instance.
kafkaStmr.setIgnite(ignite);
// Set data streamer instance.
@@ -167,58 +168,55 @@ public class KafkaIgniteStreamerSelfTest
kafkaStmr.setThreads(4);
// Set the consumer configuration.
- kafkaStmr.setConsumerConfig(createDefaultConsumerConfig(KafkaEmbeddedBroker.getZKAddress(),
- "groupX"));
+ kafkaStmr.setConsumerConfig(createDefaultConsumerConfig(getZKAddress(), "groupX"));
// Set the decoders.
- StringDecoder stringDecoder = new StringDecoder(new VerifiableProperties());
- kafkaStmr.setKeyDecoder(stringDecoder);
- kafkaStmr.setValueDecoder(stringDecoder);
+ StringDecoder strDecoder = new StringDecoder(new VerifiableProperties());
+
+ kafkaStmr.setKeyDecoder(strDecoder);
+ kafkaStmr.setValueDecoder(strDecoder);
// Start kafka streamer.
kafkaStmr.start();
final CountDownLatch latch = new CountDownLatch(CNT);
+
IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
- @Override
- public boolean apply(UUID uuid, CacheEvent evt) {
+ @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);
- latch.await();
- for (Map.Entry<String, String> entry : keyValueMap.entrySet()) {
- final String key = entry.getKey();
- final String value = entry.getValue();
+ latch.await();
- final String cacheValue = cache.get(key);
- assertEquals(value, cacheValue);
- }
+ for (Map.Entry<String, String> entry : keyValMap.entrySet())
+ assertEquals(entry.getValue(), cache.get(entry.getKey()));
}
-
finally {
- // Shutdown kafka streamer.
- kafkaStmr.stop();
+ if (kafkaStmr != null)
+ kafkaStmr.stop();
}
}
/**
* Creates default consumer config.
*
- * @param zooKeeper Zookeeper address <server:port>.
- * @param groupId Group Id for kafka subscriber.
- * @return {@link ConsumerConfig} kafka consumer configuration.
+ * @param zooKeeper ZooKeeper address <server:port>.
+ * @param grpId Group Id for kafka subscriber.
+ * @return Kafka consumer configuration.
*/
- private ConsumerConfig createDefaultConsumerConfig(String zooKeeper, String groupId) {
+ private ConsumerConfig createDefaultConsumerConfig(String zooKeeper, String grpId) {
A.notNull(zooKeeper, "zookeeper");
- A.notNull(groupId, "groupId");
+ A.notNull(grpId, "groupId");
Properties props = new Properties();
+
props.put("zookeeper.connect", zooKeeper);
- props.put("group.id", groupId);
+ props.put("group.id", grpId);
props.put("zookeeper.session.timeout.ms", "400");
props.put("zookeeper.sync.time.ms", "200");
props.put("auto.commit.interval.ms", "1000");
@@ -226,5 +224,4 @@ public class KafkaIgniteStreamerSelfTest
return new ConsumerConfig(props);
}
-
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
index b836b44..1ef4f77 100644
--- a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
@@ -18,29 +18,36 @@
package org.apache.ignite.stream.kafka;
import kafka.producer.*;
+import kafka.utils.*;
/**
- * Simple Partitioner for Kafka.
+ * Simple partitioner for Kafka.
*/
@SuppressWarnings("UnusedDeclaration")
-public class SimplePartitioner
- implements Partitioner {
+public class SimplePartitioner implements Partitioner {
+ /**
+ * Constructs instance.
+ *
+ * @param props Properties.
+ */
+ public SimplePartitioner(VerifiableProperties props) {
+ // No-op.
+ }
/**
* Partitions the key based on the key value.
*
* @param key Key.
- * @param partitionSize Partition size.
+ * @param partSize Partition size.
* @return partition Partition.
*/
- public int partition(Object key, int partitionSize) {
- int partition = 0;
+ public int partition(Object key, int partSize) {
String keyStr = (String)key;
+
String[] keyValues = keyStr.split("\\.");
+
Integer intKey = Integer.parseInt(keyValues[3]);
- if (intKey > 0) {
- partition = intKey % partitionSize;
- }
- return partition;
+
+ return intKey > 0 ? intKey % partSize : 0;
}
}
[48/50] incubator-ignite git commit: disable failing test
Posted by sb...@apache.org.
disable failing 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/3a4d008b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3a4d008b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3a4d008b
Branch: refs/heads/ignite-752
Commit: 3a4d008b07ec9971e229e5bdb99bab38858634e5
Parents: b1342ba
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 6 10:32:06 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 6 10:32:06 2015 +0300
----------------------------------------------------------------------
.../replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a4d008b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index c802d7c..54409d1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -27,7 +27,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheReplicatedNodeRestartSelfTest {
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
- //fail("https://issues.apache.org/jira/browse/IGNITE-747");
+ fail("https://issues.apache.org/jira/browse/IGNITE-747");
}
/** {@inheritDoc} */
[45/50] incubator-ignite git commit: Kafka streamer test suite added
Posted by sb...@apache.org.
Kafka streamer test suite added
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f72b2914
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f72b2914
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f72b2914
Branch: refs/heads/ignite-752
Commit: f72b291498d413d870669e8dcd7cc2a5f3b81b51
Parents: b6803e7
Author: agura <ag...@gridgain.com>
Authored: Fri Jul 3 21:18:57 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 21:18:57 2015 +0300
----------------------------------------------------------------------
.../kafka/IgniteKafkaStreamerSelfTestSuite.java | 37 ++++++++++++++++++++
1 file changed, 37 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f72b2914/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.java
new file mode 100644
index 0000000..a2dfd17
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.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.stream.kafka;
+
+import junit.framework.*;
+
+/**
+ * Apache Kafka streamer tests.
+ */
+public class IgniteKafkaStreamerSelfTestSuite extends TestSuite {
+ /**
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Apache Kafka streamer Test Suite");
+
+ suite.addTest(new TestSuite(KafkaIgniteStreamerSelfTest.class));
+
+ return suite;
+ }
+}
[41/50] incubator-ignite git commit: Merge branch 'ignite-1055' into
ignite-sprint-7
Posted by sb...@apache.org.
Merge branch 'ignite-1055' into ignite-sprint-7
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9f6a7f9b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9f6a7f9b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9f6a7f9b
Branch: refs/heads/ignite-752
Commit: 9f6a7f9bed05bd15807c534eb14d801bedd37970
Parents: 7828d19 251f0c8
Author: ashutak <as...@gridgain.com>
Authored: Fri Jul 3 17:52:00 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Jul 3 17:52:00 2015 +0300
----------------------------------------------------------------------
bin/ignite.bat | 8 ++++++--
bin/ignite.sh | 6 +++++-
bin/include/parseargs.bat | 1 +
bin/include/parseargs.sh | 3 +++
.../apache/ignite/startup/cmdline/CommandLineStartup.java | 3 ++-
.../ignite/startup/cmdline/CommandLineTransformer.java | 9 +++++++++
6 files changed, 26 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[49/50] incubator-ignite git commit: #ignite-1086:
ClusterNode.consistentId() should be the same after restart.
Posted by sb...@apache.org.
#ignite-1086: ClusterNode.consistentId() should be the same after restart.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a577d27b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a577d27b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a577d27b
Branch: refs/heads/ignite-752
Commit: a577d27b6a857e80d4ddf48a635dce09123eec8a
Parents: 3a4d008
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 6 11:19:00 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 6 11:19:00 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/util/IgniteUtils.java | 6 +-
.../TcpDiscoveryNodeConsistentIdSelfTest.java | 80 ++++++++++++++++++++
.../IgniteSpiDiscoverySelfTestSuite.java | 2 +
3 files changed, 87 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a577d27b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index f457d6c..46a23d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -8048,9 +8048,13 @@ public abstract class IgniteUtils {
public static String consistentId(Collection<String> addrs, int port) {
assert !F.isEmpty(addrs);
+ List<String> sortedAddrs = new ArrayList<>(addrs);
+
+ Collections.sort(sortedAddrs);
+
StringBuilder sb = new StringBuilder();
- for (String addr : addrs)
+ for (String addr : sortedAddrs)
sb.append(addr).append(',');
sb.delete(sb.length() - 1, sb.length());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a577d27b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java
new file mode 100644
index 0000000..d159d72
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java
@@ -0,0 +1,80 @@
+/*
+ * 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.spi.discovery.tcp;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.discovery.tcp.internal.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ * Test for {@link TcpDiscoveryNode#consistentId()}
+ */
+public class TcpDiscoveryNodeConsistentIdSelfTest extends GridCommonAbstractTest {
+ /** IP finder. */
+ private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setLocalHost("0.0.0.0");
+
+ cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ startGrids(1);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testConsistentId() throws Exception {
+ Object id0 = grid(0).localNode().consistentId();
+
+ int port0 = getDiscoveryPort(grid(0));
+
+ for (int i = 0; i < 10; ++i) {
+ stopAllGrids();
+
+ startGrids(1);
+
+ if (port0 == getDiscoveryPort(grid(0)))
+ assertEquals(id0, grid(0).localNode().consistentId());
+ }
+ }
+
+ /**
+ * @param ignite Ignite.
+ * @return Discovery port.
+ */
+ private int getDiscoveryPort(Ignite ignite) {
+ return ((TcpDiscoveryNode) ignite.cluster().localNode()).discoveryPort();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a577d27b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
index ea5a7ac..498f50c 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
@@ -55,6 +55,8 @@ public class IgniteSpiDiscoverySelfTestSuite extends TestSuite {
suite.addTest(new TestSuite(TcpClientDiscoveryMarshallerCheckSelfTest.class));
suite.addTest(new TestSuite(TcpClientDiscoverySpiMulticastTest.class));
+ suite.addTest(new TestSuite(TcpDiscoveryNodeConsistentIdSelfTest.class));
+
return suite;
}
}
[15/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-621
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a9d0662b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a9d0662b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a9d0662b
Branch: refs/heads/ignite-752
Commit: a9d0662b1d084a770b1364295c48aa61e2c0dcfa
Parents: a4e31be b29ff1c
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Wed Jun 24 15:25:40 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Wed Jun 24 15:25:40 2015 -0700
----------------------------------------------------------------------
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 +-
.../configuration/IgniteReflectionFactory.java | 81 +++-
.../processors/cache/GridCacheContext.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 3 +-
.../distributed/dht/GridDhtLockFuture.java | 2 +-
.../dht/atomic/GridDhtAtomicCache.java | 9 +-
.../GridDhtPartitionsExchangeFuture.java | 46 +-
.../datastructures/DataStructuresProcessor.java | 64 +--
.../processors/hadoop/HadoopJobInfo.java | 4 +-
.../hadoop/counter/HadoopCounterWriter.java | 5 +-
.../processors/task/GridTaskProcessor.java | 23 +-
.../core/src/main/resources/ignite.properties | 2 +-
.../GridTaskFailoverAffinityRunTest.java | 170 +++++++
.../CacheReadThroughAtomicRestartSelfTest.java | 32 ++
...heReadThroughLocalAtomicRestartSelfTest.java | 32 ++
.../CacheReadThroughLocalRestartSelfTest.java | 32 ++
...dThroughReplicatedAtomicRestartSelfTest.java | 32 ++
...cheReadThroughReplicatedRestartSelfTest.java | 32 ++
.../cache/CacheReadThroughRestartSelfTest.java | 133 ++++++
.../cache/GridCacheAbstractSelfTest.java | 2 +-
...eDynamicCacheStartNoExchangeTimeoutTest.java | 466 +++++++++++++++++++
.../cache/IgniteDynamicCacheStartSelfTest.java | 37 ++
...GridCacheQueueMultiNodeAbstractSelfTest.java | 4 +-
.../GridCacheSetAbstractSelfTest.java | 22 +-
.../IgniteDataStructureWithJobTest.java | 111 +++++
...ridCachePartitionNotLoadedEventSelfTest.java | 82 ++++
.../distributed/IgniteCache150ClientsTest.java | 189 ++++++++
...teCacheClientNodePartitionsExchangeTest.java | 1 +
.../distributed/IgniteCacheManyClientsTest.java | 2 +
.../IgniteCacheTxMessageRecoveryTest.java | 5 +
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 5 -
...achePartitionedMultiNodeFullApiSelfTest.java | 49 +-
.../GridCacheReplicatedFailoverSelfTest.java | 5 +
.../IgniteCacheTxStoreSessionTest.java | 4 +
.../testframework/junits/GridAbstractTest.java | 2 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 1 +
.../ignite/testsuites/IgniteCacheTestSuite.java | 4 +-
.../testsuites/IgniteCacheTestSuite4.java | 8 +
.../testsuites/IgniteClientTestSuite.java | 38 ++
.../testsuites/IgniteComputeGridTestSuite.java | 1 +
.../ignite/util/TestTcpCommunicationSpi.java | 21 +
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 | 80 +---
.../fs/IgniteHadoopFileSystemCounterWriter.java | 9 +-
.../processors/hadoop/HadoopClassLoader.java | 29 ++
.../processors/hadoop/HadoopDefaultJobInfo.java | 27 +-
.../internal/processors/hadoop/HadoopUtils.java | 237 ----------
.../hadoop/SecondaryFileSystemProvider.java | 3 +-
.../hadoop/fs/HadoopFileSystemCacheUtils.java | 241 ++++++++++
.../hadoop/fs/HadoopFileSystemsUtils.java | 11 +
.../hadoop/fs/HadoopLazyConcurrentMap.java | 5 +
.../hadoop/jobtracker/HadoopJobTracker.java | 25 +-
.../child/HadoopChildProcessRunner.java | 3 +-
.../processors/hadoop/v2/HadoopV2Job.java | 84 +++-
.../hadoop/v2/HadoopV2JobResourceManager.java | 22 +-
.../hadoop/v2/HadoopV2TaskContext.java | 37 +-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 5 +-
.../processors/hadoop/HadoopMapReduceTest.java | 2 +-
.../processors/hadoop/HadoopTasksV1Test.java | 7 +-
.../processors/hadoop/HadoopTasksV2Test.java | 7 +-
.../processors/hadoop/HadoopV2JobSelfTest.java | 6 +-
.../collections/HadoopAbstractMapTest.java | 3 +-
.../testsuites/IgniteHadoopTestSuite.java | 2 +-
.../IgniteIgfsLinuxAndMacOSTestSuite.java | 3 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
...QueryOffheapEvictsMultiThreadedSelfTest.java | 5 +
.../IgniteCacheQuerySelfTestSuite.java | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/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/spark-2.10/pom.xml | 2 +-
modules/spark/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-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
100 files changed, 2169 insertions(+), 521 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d0662b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
[44/50] incubator-ignite git commit: Kafka module version changed
Posted by sb...@apache.org.
Kafka module 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/b6803e7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b6803e7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b6803e7e
Branch: refs/heads/ignite-752
Commit: b6803e7e1d71d6f6b54b0e9cd769ec6ca91d0564
Parents: 63fce5a
Author: agura <ag...@gridgain.com>
Authored: Fri Jul 3 19:54:19 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 19:54:19 2015 +0300
----------------------------------------------------------------------
modules/kafka/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6803e7e/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 43909bc..d0e9cd9 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>1.1.6-SNAPSHOT</version>
+ <version>1.2.1-SNAPSHOT</version>
<dependencies>
<dependency>
[08/50] incubator-ignite git commit: ignite-973-2 - simplify test
Posted by sb...@apache.org.
ignite-973-2 - simplify 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/4b5e89fa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4b5e89fa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4b5e89fa
Branch: refs/heads/ignite-752
Commit: 4b5e89fa8246c36322b6f66af10379f6941091c6
Parents: 260dc2d
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Jun 23 15:28:51 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Jun 23 15:28:51 2015 +0300
----------------------------------------------------------------------
.../processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b5e89fa/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
index 3e50443..97426c9 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
@@ -32,7 +32,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
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.spi.swapspace.file.*;
+import org.apache.ignite.spi.swapspace.inmemory.*;
import org.apache.ignite.testframework.junits.common.*;
import org.jetbrains.annotations.*;
@@ -82,7 +82,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
cfg.setDiscoverySpi(disco);
- cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+ cfg.setSwapSpaceSpi(new GridTestSwapSpaceSpi());
cfg.setCacheConfiguration(cacheConfiguration());
[37/50] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-sprint-7' into ignite-sprint-7
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-7' into ignite-sprint-7
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ea90d863
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ea90d863
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ea90d863
Branch: refs/heads/ignite-752
Commit: ea90d8633265723076f729b2dca02873c033ce55
Parents: 1427d75 a0a31e2
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jul 2 12:10:38 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jul 2 12:10:38 2015 -0700
----------------------------------------------------------------------
.../processors/cache/GridCacheSwapManager.java | 257 ++++++++++++-------
.../inmemory/GridTestSwapSpaceSpi.java | 3 +-
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 8 +-
.../processors/query/h2/opt/GridH2Table.java | 2 +-
.../cache/IgniteCacheOffheapEvictQueryTest.java | 2 +-
.../IgniteCacheQueryMultiThreadedSelfTest.java | 4 +-
...QueryOffheapEvictsMultiThreadedSelfTest.java | 5 -
.../IgniteCacheQueryNodeRestartSelfTest2.java | 5 +
8 files changed, 179 insertions(+), 107 deletions(-)
----------------------------------------------------------------------
[09/50] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b7bb2514
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b7bb2514
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b7bb2514
Branch: refs/heads/ignite-752
Commit: b7bb251493e314ab05227052eab7a1eda9402ee5
Parents: 4b5e89f 2bb6e0f
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Jun 23 15:29:32 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Jun 23 15:29:32 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 +-
.../processors/hadoop/HadoopJobInfo.java | 4 +-
.../hadoop/counter/HadoopCounterWriter.java | 5 +-
.../processors/task/GridTaskProcessor.java | 23 +-
.../core/src/main/resources/ignite.properties | 2 +-
.../GridTaskFailoverAffinityRunTest.java | 170 +++++++++++++
...ridCachePartitionNotLoadedEventSelfTest.java | 82 +++++++
.../distributed/IgniteCacheManyClientsTest.java | 1 +
.../IgniteCacheTxMessageRecoveryTest.java | 5 +
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 2 +-
.../GridCacheReplicatedFailoverSelfTest.java | 5 +
.../testframework/junits/GridAbstractTest.java | 2 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 4 +-
.../testsuites/IgniteComputeGridTestSuite.java | 1 +
.../ignite/util/TestTcpCommunicationSpi.java | 21 ++
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 | 80 +-----
.../fs/IgniteHadoopFileSystemCounterWriter.java | 9 +-
.../processors/hadoop/HadoopClassLoader.java | 29 +++
.../processors/hadoop/HadoopDefaultJobInfo.java | 27 +--
.../internal/processors/hadoop/HadoopUtils.java | 237 ------------------
.../hadoop/SecondaryFileSystemProvider.java | 3 +-
.../hadoop/fs/HadoopFileSystemCacheUtils.java | 241 +++++++++++++++++++
.../hadoop/fs/HadoopFileSystemsUtils.java | 11 +
.../hadoop/fs/HadoopLazyConcurrentMap.java | 5 +
.../hadoop/jobtracker/HadoopJobTracker.java | 25 +-
.../child/HadoopChildProcessRunner.java | 3 +-
.../processors/hadoop/v2/HadoopV2Job.java | 84 ++++++-
.../hadoop/v2/HadoopV2JobResourceManager.java | 22 +-
.../hadoop/v2/HadoopV2TaskContext.java | 37 ++-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 5 +-
.../processors/hadoop/HadoopMapReduceTest.java | 2 +-
.../processors/hadoop/HadoopTasksV1Test.java | 7 +-
.../processors/hadoop/HadoopTasksV2Test.java | 7 +-
.../processors/hadoop/HadoopV2JobSelfTest.java | 6 +-
.../collections/HadoopAbstractMapTest.java | 3 +-
.../testsuites/IgniteHadoopTestSuite.java | 2 +-
.../IgniteIgfsLinuxAndMacOSTestSuite.java | 3 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
...QueryOffheapEvictsMultiThreadedSelfTest.java | 5 +
.../IgniteCacheQuerySelfTestSuite.java | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/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/spark-2.10/pom.xml | 2 +-
modules/spark/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-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
74 files changed, 825 insertions(+), 429 deletions(-)
----------------------------------------------------------------------
[24/50] incubator-ignite git commit: Merge branches 'ignite-973-2'
and 'ignite-sprint-7' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Posted by sb...@apache.org.
Merge branches 'ignite-973-2' and 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-973-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/234a8095
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/234a8095
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/234a8095
Branch: refs/heads/ignite-752
Commit: 234a809597bb07a7b78a51f4810ad217d9ab45a4
Parents: 712e7d5 44b187d
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jul 1 10:39:44 2015 -0700
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jul 1 10:39:44 2015 -0700
----------------------------------------------------------------------
assembly/dependencies-fabric.xml | 1 +
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 +-
.../ignite/compute/ComputeTaskSplitAdapter.java | 2 +-
.../managers/communication/GridIoManager.java | 49 ++++++-----
.../processors/cache/IgniteCacheFutureImpl.java | 42 ++++++++++
.../processors/cache/IgniteCacheProxy.java | 2 +-
.../internal/util/future/IgniteFutureImpl.java | 18 ++++-
.../util/nio/GridNioMessageTracker.java | 23 +++++-
.../ignite/spi/discovery/tcp/ServerImpl.java | 2 +-
.../core/src/main/resources/ignite.properties | 2 +-
modules/core/src/test/config/tests.properties | 6 +-
.../GridP2PContinuousDeploymentSelfTest.java | 2 -
modules/core/src/test/resources/helloworld.gar | Bin 6092 -> 0 bytes
modules/core/src/test/resources/helloworld1.gar | Bin 6092 -> 0 bytes
modules/core/src/test/resources/readme.txt | 6 --
modules/docker/Dockerfile | 55 +++++++++++++
modules/docker/README.txt | 11 +++
modules/docker/build_users_libs.sh | 39 +++++++++
modules/docker/download_ignite.sh | 49 +++++++++++
modules/docker/execute.sh | 62 ++++++++++++++
modules/docker/run.sh | 34 ++++++++
modules/extdata/p2p/pom.xml | 4 +-
modules/extdata/uri/META-INF/ignite.xml | 38 +++++++++
.../extdata/uri/modules/uri-dependency/pom.xml | 42 ++++++++++
.../deployment/uri/tasks/GarHelloWorldBean.java | 60 ++++++++++++++
.../src/main/resources/gar-example.properties | 18 +++++
modules/extdata/uri/pom.xml | 62 ++++++++++++--
.../deployment/uri/tasks/GarHelloWorldTask.java | 81 +++++++++++++++++++
.../deployment/uri/tasks/gar-spring-bean.xml | 29 +++++++
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/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/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/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 16 +++-
.../GridTaskUriDeploymentDeadlockSelfTest.java | 13 +--
.../ignite/p2p/GridP2PDisabledSelfTest.java | 2 +-
modules/visor-console-2.10/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 | 14 ++--
64 files changed, 747 insertions(+), 101 deletions(-)
----------------------------------------------------------------------
[13/50] incubator-ignite git commit: ignite-973-2 - metrics tests
Posted by sb...@apache.org.
ignite-973-2 - metrics tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4902e8f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4902e8f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4902e8f6
Branch: refs/heads/ignite-752
Commit: 4902e8f657b02531afb72b097a85ffc951e61f9d
Parents: 108788b
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 24 18:41:38 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 24 18:41:38 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheSwapManager.java | 31 +++++++++++++-------
1 file changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4902e8f6/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 7595a1d..9e9c958 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
@@ -584,14 +584,14 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
ClassLoader ldr = cctx.deploy().globalLoader();
- GridCacheQueryManager qryMgr = cctx.queries();
+ final GridCacheQueryManager qryMgr = cctx.queries();
if (qryMgr != null && !readSwapBeforeRemove(key, swapKey, ldr))
return null; // Not found.
swapMgr.remove(spaceName, swapKey, new CI1<byte[]>() {
@Override public void apply(byte[] rmv) {
- if (cctx.config().isStatisticsEnabled())
+ if (qryMgr == null && cctx.config().isStatisticsEnabled())
cctx.cache().metrics0().onSwapRead(rmv != null);
if (rmv != null) {
@@ -748,14 +748,14 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
else {
byte[] entryBytes = offheap.remove(spaceName, part, key, keyBytes);
- if (entryBytes != null) {
- if (cctx.config().isStatisticsEnabled())
- cctx.cache().metrics0().onOffHeapRemove();
+ if (cctx.config().isStatisticsEnabled()) {
+ cctx.cache().metrics0().onOffHeapRead(entryBytes != null);
- entry = swapEntry(unmarshalSwapEntry(entryBytes));
+ if (entryBytes != null)
+ cctx.cache().metrics0().onOffHeapRemove();
}
- else
- entry = null;
+
+ entry = entryBytes == null ? null : swapEntry(unmarshalSwapEntry(entryBytes));
}
return entry;
@@ -857,6 +857,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
unprocessedKeys,
new IgniteBiInClosure<SwapKey, byte[]>() {
@Override public void apply(SwapKey swapKey, byte[] rmv) {
+ if (qryMgr == null && cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapRead(rmv != null);
+
if (rmv != null) {
try {
GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(rmv));
@@ -974,10 +977,13 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
throws IgniteCheckedException {
assert cctx.queries() != null;
- byte[] val = offheap.get(spaceName, part, key, keyBytes);
+ byte[] entryBytes = offheap.get(spaceName, part, key, keyBytes);
+
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onOffHeapRead(entryBytes != null);
- if (val != null) {
- GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(val));
+ if (entryBytes != null) {
+ GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
if (entry != null) {
cctx.queries().onUnswap(key, entry.value());
@@ -1004,6 +1010,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
byte[] entryBytes = swapMgr.read(spaceName, swapKey, ldr);
+ if (cctx.config().isStatisticsEnabled())
+ cctx.cache().metrics0().onSwapRead(entryBytes != null);
+
if (entryBytes == null)
return false;
[40/50] incubator-ignite git commit: # ignite-1055: review (add
option to help)
Posted by sb...@apache.org.
# ignite-1055: review (add option to help)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/251f0c88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/251f0c88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/251f0c88
Branch: refs/heads/ignite-752
Commit: 251f0c88377b05821e9cfcb4a6ee6caa9026adb9
Parents: 7030ee1
Author: ashutak <as...@gridgain.com>
Authored: Fri Jul 3 17:51:24 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Jul 3 17:51:24 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/startup/cmdline/CommandLineStartup.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/251f0c88/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
index 4ddbbd0..5b39069 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
@@ -158,7 +158,8 @@ public final class CommandLineStartup {
" Where:",
" ?, /help, -help, - show this message.",
" -v - verbose mode (quiet by default).",
- " -np - no pause on exit (pause by default)");
+ " -np - no pause on exit (pause by default)",
+ " -nojmx - disable JMX monitoring (enabled by default)");
if (ignite) {
X.error(
[46/50] incubator-ignite git commit: disable failing test
Posted by sb...@apache.org.
disable failing 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/334fee9e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/334fee9e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/334fee9e
Branch: refs/heads/ignite-752
Commit: 334fee9e300342c0a9613fdcaba5aa97ef1a86a4
Parents: f72b291
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 6 10:19:18 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 6 10:19:18 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheAtomicReplicatedNodeRestartSelfTest.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/334fee9e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index 379ed65..52d8871 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -31,6 +31,11 @@ public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheRep
}
/** {@inheritDoc} */
+ @Override public void testRestartWithPutSixNodesTwoBackups() throws Throwable {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1095");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return ATOMIC;
}