You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/08 11:21:04 UTC
[01/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-gg-10186 c3f3dd141 -> 745cf7f9b
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7a8e075c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7a8e075c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7a8e075c
Branch: refs/heads/ignite-gg-10186
Commit: 7a8e075c029fdafb83e4a32871333f3dbe091cf9
Parents: 4843b66 8d13aa1
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 21 14:23:56 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 21 14:23:56 2015 +0300
----------------------------------------------------------------------
.../examples/ScalarContinuationExample.scala | 10 +-
.../cache/eviction/fifo/FifoEvictionPolicy.java | 7 +-
.../igfs/IgfsPerBlockLruEvictionPolicy.java | 3 +-
.../cache/eviction/lru/LruEvictionPolicy.java | 5 +-
.../eviction/sorted/SortedEvictionPolicy.java | 431 +++++
.../sorted/SortedEvictionPolicyMBean.java | 66 +
.../cache/eviction/sorted/package-info.java | 21 +
.../apache/ignite/cache/query/QueryMetrics.java | 2 +-
.../ignite/compute/ComputeJobContinuation.java | 2 +
.../configuration/CacheConfiguration.java | 3 +-
.../ignite/internal/GridJobContextImpl.java | 100 +-
.../org/apache/ignite/internal/IgniteEx.java | 10 +-
.../apache/ignite/internal/IgniteKernal.java | 10 +-
.../internal/managers/GridManagerAdapter.java | 4 +-
.../discovery/GridDiscoveryManager.java | 2 +-
.../affinity/GridAffinityAssignmentCache.java | 7 +-
.../processors/cache/CacheLockImpl.java | 20 +-
.../processors/cache/CacheOperationContext.java | 170 ++
.../processors/cache/CacheProjection.java | 1386 -------------
.../internal/processors/cache/GridCache.java | 223 ---
.../processors/cache/GridCacheAdapter.java | 155 +-
.../cache/GridCacheConcurrentMap.java | 24 +-
.../processors/cache/GridCacheContext.java | 66 +-
.../processors/cache/GridCacheGateway.java | 38 +-
.../processors/cache/GridCacheProcessor.java | 21 +-
.../processors/cache/GridCacheProjectionEx.java | 351 ----
.../cache/GridCacheProjectionImpl.java | 766 --------
.../processors/cache/GridCacheProxy.java | 27 -
.../processors/cache/GridCacheProxyImpl.java | 396 ++--
.../processors/cache/GridCacheUtils.java | 6 +-
.../processors/cache/IgniteCacheProxy.java | 225 ++-
.../processors/cache/IgniteInternalCache.java | 1816 ++++++++++++++++++
.../cache/affinity/GridCacheAffinityProxy.java | 30 +-
.../CacheDataStructuresManager.java | 8 +-
.../distributed/dht/GridDhtCacheAdapter.java | 4 +-
.../dht/atomic/GridDhtAtomicCache.java | 18 +-
.../dht/colocated/GridDhtColocatedCache.java | 7 +-
.../distributed/near/GridNearAtomicCache.java | 6 +-
.../near/GridNearTransactionalCache.java | 6 +-
.../local/atomic/GridLocalAtomicCache.java | 10 +-
.../processors/cache/query/CacheQueries.java | 103 -
.../cache/query/CacheQueriesImpl.java | 142 --
.../cache/query/CacheQueriesProxy.java | 200 --
.../processors/cache/query/CacheQuery.java | 5 +-
.../cache/query/GridCacheQueryManager.java | 110 +-
.../jdbc/GridCacheQueryJdbcMetadataTask.java | 4 +-
.../cache/transactions/IgniteTxAdapter.java | 2 -
.../transactions/IgniteTxLocalAdapter.java | 16 +-
.../cache/transactions/IgniteTxManager.java | 44 -
.../datastreamer/DataStreamerCacheUpdaters.java | 13 +-
.../datastructures/DataStructuresProcessor.java | 24 +-
.../datastructures/GridCacheAtomicLongImpl.java | 4 +-
.../GridCacheAtomicReferenceImpl.java | 4 +-
.../GridCacheAtomicSequenceImpl.java | 4 +-
.../GridCacheAtomicStampedImpl.java | 4 +-
.../GridCacheCountDownLatchImpl.java | 4 +-
.../datastructures/GridCacheSetImpl.java | 2 +-
.../processors/igfs/IgfsDataManager.java | 6 +-
.../processors/igfs/IgfsMetaManager.java | 8 +-
.../processors/job/GridJobHoldListener.java | 6 +-
.../processors/job/GridJobProcessor.java | 22 +-
.../internal/processors/job/GridJobWorker.java | 23 +-
.../handlers/cache/GridCacheCommandHandler.java | 64 +-
.../service/GridServiceProcessor.java | 2 +-
.../processors/task/GridTaskProcessor.java | 6 +-
.../visor/cache/VisorCacheMetadataTask.java | 9 +-
.../internal/visor/cache/VisorCacheMetrics.java | 4 +-
.../visor/cache/VisorCacheRebalanceTask.java | 4 +-
.../visor/cache/VisorCacheResetMetricsTask.java | 2 +-
.../visor/cache/VisorCacheSwapBackupsTask.java | 2 +-
.../ignite/startup/BasicWarmupClosure.java | 20 +-
.../TransactionSynchronization.java | 45 -
.../internal/GridCacheProjectionRemoveTest.java | 41 -
.../internal/GridContinuousTaskSelfTest.java | 114 ++
...ridFailFastNodeFailureDetectionSelfTest.java | 5 +
.../internal/IgniteInternalCacheRemoveTest.java | 41 +
.../cache/GridCacheAbstractFullApiSelfTest.java | 2 +-
.../GridCacheConcurrentTxMultiNodeTest.java | 2 +-
...CacheFullTextQueryMultithreadedSelfTest.java | 4 +-
.../GridCachePreloadingEvictionsSelfTest.java | 4 +-
.../cache/IgniteDynamicCacheStartSelfTest.java | 4 +-
...ridCachePartitionNotLoadedEventSelfTest.java | 22 +-
.../IgniteCachePutGetRestartAbstractTest.java | 234 +++
.../IgniteCacheTxFairAffinityNodeJoinTest.java | 35 +
...iteCacheTxNearDisabledPutGetRestartTest.java | 30 +
.../dht/IgniteCacheMultiTxLockSelfTest.java | 2 +-
...micFairAffinityMultiNodeFullApiSelfTest.java | 35 +
...achePartitionedPreloadLifecycleSelfTest.java | 2 +-
...nedFairAffinityMultiNodeFullApiSelfTest.java | 36 +
...dezvousAffinityMultiNodeFullApiSelfTest.java | 35 -
...CacheReplicatedPreloadLifecycleSelfTest.java | 2 +-
...dCacheSortedBatchEvictionPolicySelfTest.java | 385 ++++
.../GridCacheSortedEvictionPolicySelfTest.java | 373 ++++
.../GridCacheSwapScanQueryAbstractSelfTest.java | 26 +-
.../processors/igfs/IgfsSizeSelfTest.java | 2 +-
.../processors/igfs/IgfsStreamsSelfTest.java | 2 +-
.../cache/GridCacheCommandHandlerSelfTest.java | 10 +-
.../GridServiceReassignmentSelfTest.java | 2 +-
.../GridContinuousOperationsLoadTest.java | 3 +-
.../GridTcpCommunicationSpiConfigSelfTest.java | 1 -
.../IgniteCacheEvictionSelfTestSuite.java | 3 +
.../IgniteCacheFailoverTestSuite.java | 3 +
.../IgniteCacheFullApiSelfTestSuite.java | 4 +-
.../ignite/util/TestTcpCommunicationSpi.java | 54 +
.../hadoop/jobtracker/HadoopJobTracker.java | 14 +-
.../HadoopDefaultMapReducePlannerSelfTest.java | 8 +-
.../HibernateAccessStrategyAdapter.java | 10 +-
.../hibernate/HibernateCollectionRegion.java | 2 +-
.../cache/hibernate/HibernateEntityRegion.java | 2 +-
.../hibernate/HibernateGeneralDataRegion.java | 2 +-
.../hibernate/HibernateNaturalIdRegion.java | 2 +-
.../HibernateNonStrictAccessStrategy.java | 4 +-
.../hibernate/HibernateQueryResultsRegion.java | 2 +-
.../HibernateReadOnlyAccessStrategy.java | 2 +-
.../HibernateReadWriteAccessStrategy.java | 2 +-
.../ignite/cache/hibernate/HibernateRegion.java | 4 +-
.../cache/hibernate/HibernateRegionFactory.java | 10 +-
.../hibernate/HibernateTimestampsRegion.java | 2 +-
.../HibernateTransactionalAccessStrategy.java | 4 +-
.../HibernateTransactionalDataRegion.java | 2 +-
.../HibernateL2CacheConfigurationSelfTest.java | 2 +-
.../hibernate/HibernateL2CacheSelfTest.java | 2 +-
.../processors/query/h2/IgniteH2Indexing.java | 4 +-
.../GridCacheAbstractFieldsQuerySelfTest.java | 53 +-
.../cache/GridCacheCrossCacheQuerySelfTest.java | 66 +-
...idCacheReduceQueryMultithreadedSelfTest.java | 3 +-
.../IgniteCacheQueryMultiThreadedSelfTest.java | 3 +
...GridCachePartitionedFieldsQuerySelfTest.java | 4 +-
.../GridCacheReplicatedFieldsQuerySelfTest.java | 8 +-
...dCacheAbstractReduceFieldsQuerySelfTest.java | 11 +-
...cheReduceFieldsQueryPartitionedSelfTest.java | 4 +-
.../cache/IgniteCacheAbstractBenchmark.java | 2 +-
.../jdbc/IgniteJdbcStoreAbstractBenchmark.java | 4 +-
133 files changed, 4822 insertions(+), 4304 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a8e075c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a8e075c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
[22/50] [abbrv] incubator-ignite git commit: "Version changed
Posted by sb...@apache.org.
"Version changed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d617759d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d617759d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d617759d
Branch: refs/heads/ignite-gg-10186
Commit: d617759da292917df4b827abc8d50b6152c4190e
Parents: bba8c2f
Author: Ignite Teamcity <ig...@apache.org>
Authored: Wed Apr 29 19:23:41 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Wed Apr 29 19:23:41 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
31 files changed, 31 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 9dda753..f38ff9d 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index ef44603..1b03acd 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 43f24bc..057f246 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index ca93673..19d6a25 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 8cb97d0..91ba978 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9e03dab..7cce037 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62612f8..cdf2cf2 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 0f8fdc0..6509c47 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index df69c93..921775f 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 8b2a019..1061aee 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 1ce3370..6a7610c 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 231808f..9b5bcfb 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index ed4dc07..fbd40ce 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 6ff6039..2949c34 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 8a3cec3..04ab11b 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 9287f12..7322da2 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index dff0a7e..42c8523 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 9097614..72bf1ff 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 590d3f7..b8840e3 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 2c09ed9..ee733ad 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 7c49cab..d420681 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 1f78f42..9acb521 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 1390a39..a0bcaaa 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 867e9be..521c7d0 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 625eeaa..674f22f 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 231a576..939966c 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 07e27a0..7abd896 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 4e58ab8..04dda81 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index de50712..446d7a0 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 6bd65cc..108fa62 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d617759d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0e84a50..e1badec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[48/50] [abbrv] incubator-ignite git commit: sprint-4 -> sprint-5
merge fix
Posted by sb...@apache.org.
sprint-4 -> sprint-5 merge 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/e8a38e04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e8a38e04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e8a38e04
Branch: refs/heads/ignite-gg-10186
Commit: e8a38e04e9ff6fca30953d72bd657889c1c17456
Parents: 17bf271
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 11:58:48 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 11:58:48 2015 +0300
----------------------------------------------------------------------
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8a38e04/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 86b77fa..c445fd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -508,8 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip" classifier="fabric" type="zip" />
- <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip" classifier="hadoop" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
[44/50] [abbrv] incubator-ignite git commit: # Remove unused methods
from GridFunc.
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/942abe45/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index c86c5a4..6f544e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -20,10 +20,8 @@ package org.apache.ignite.internal.util.lang;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
-import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.*;
-import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
@@ -31,9 +29,6 @@ import org.jetbrains.annotations.*;
import org.jsr166.*;
import javax.cache.*;
-import java.io.*;
-import java.lang.reflect.*;
-import java.math.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
@@ -74,13 +69,6 @@ public class GridFunc {
};
/** */
- private static final IgnitePredicate<Boolean> IDENTITY_PRED = new P1<Boolean>() {
- @Override public boolean apply(Boolean e) {
- return e;
- }
- };
-
- /** */
private static final IgnitePredicate<Object> ALWAYS_TRUE = new P1<Object>() {
@Override public boolean apply(Object e) {
return true;
@@ -128,34 +116,6 @@ public class GridFunc {
};
/** */
- public static final IgnitePredicate<String> EMPTY_STRING = new P1<String>() {
- @Override public boolean apply(String s) {
- return isEmpty(s);
- }
- };
-
- /** */
- public static final IgnitePredicate<String> NOT_EMPTY_STRING = new P1<String>() {
- @Override public boolean apply(String s) {
- return !isEmpty(s);
- }
- };
-
- /** */
- public static final IgnitePredicate EMPTY_COLLECTION = new P1<Collection>() {
- @Override public boolean apply(Collection c) {
- return isEmpty(c);
- }
- };
-
- /** */
- public static final IgnitePredicate NOT_EMPTY_COLLECTION = new P1<Collection>() {
- @Override public boolean apply(Collection c) {
- return !isEmpty(c);
- }
- };
-
- /** */
private static final IgniteCallable<?> LIST_FACTORY = new IgniteCallable<List>() {
@Override public List call() {
return new ArrayList();
@@ -266,84 +226,6 @@ public class GridFunc {
};
/** */
- private static final IgniteInClosure<?> PRINTLN = new CI1() {
- @Override public void apply(Object o) {
- System.out.println(o);
- }
-
- @Override public String toString() {
- return "Print line closure.";
- }
- };
-
- /** */
- private static final IgniteInClosure<?> PRINT = new CI1() {
- @Override public void apply(Object o) {
- System.out.print(o);
- }
-
- @Override public String toString() {
- return "Print closure.";
- }
- };
-
- /** */
- private static final IgniteOutClosure<?> NILL = new CO() {
- @Nullable @Override public Object apply() {
- return null;
- }
-
- @Override public String toString() {
- return "Nill closure.";
- }
- };
-
- /** */
- private static final IgniteClosure<Runnable, GridAbsClosure> R2C = new C1<Runnable, GridAbsClosure>() {
- @Override public GridAbsClosure apply(Runnable r) {
- return as(r);
- }
-
- @Override public String toString() {
- return "Runnable to absolute closure transformer.";
- }
- };
-
- /** */
- private static final IgniteClosure<ClusterGroup, IgnitePredicate<ClusterNode>> P2P =
- new C1<ClusterGroup, IgnitePredicate<ClusterNode>>() {
- @Override public IgnitePredicate<ClusterNode> apply(ClusterGroup e) {
- return e.predicate();
- }
-
- @Override public String toString() {
- return "Projection to its predicate transformer closure.";
- }
- };
-
- /** */
- private static final IgniteClosure<Object, Class<?>> CLAZZ = new C1<Object, Class<?>>() {
- @Override public Class<?> apply(Object o) {
- return o.getClass();
- }
-
- @Override public String toString() {
- return "Object to class transformer closure.";
- }
- };
-
- /** */
- private static final IgniteClosure MAP_ENTRY_KEY = new IgniteClosure() {
- @Override public Object apply(Object o) {
- return ((Map.Entry)o).getKey();
- }
-
- @Override public String toString() {
- return "Map entry to key transformer closure.";
- }
- };
-
- /** */
private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() {
@Override public Object apply(Object o) {
return ((Cache.Entry)o).getKey();
@@ -354,16 +236,6 @@ public class GridFunc {
}
};
- /** */
- private static final IgniteClosure MAP_ENTRY_VAL = new IgniteClosure() {
- @Override public Object apply(Object o) {
- return ((Map.Entry)o).getValue();
- }
-
- @Override public String toString() {
- return "Map entry to value transformer closure.";
- }
- };
/** */
private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosure() {
@@ -390,18 +262,6 @@ public class GridFunc {
};
/** */
- private static final IgnitePredicate CACHE_ENTRY_NO_PEEK_VAL = new IgnitePredicate() {
- @SuppressWarnings({"unchecked"})
- @Override public boolean apply(Object o) {
- return ((Cache.Entry)o).getValue() == null;
- }
-
- @Override public String toString() {
- return "Cache entry no-peek-value predicate.";
- }
- };
-
- /** */
private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new IgniteClosure<ClusterNode, UUID>() {
@Override public UUID apply(ClusterNode n) {
return n.id();
@@ -442,44 +302,6 @@ public class GridFunc {
};
/**
- * Gets breaker predicate which will return a predicate that will
- * evaluate to {@code firstVal} when checked the first time,
- * but then will always evaluate to the opposite value.
- *
- * @param firstVal First value.
- * @param <T> Predicate type.
- * @return Breaker predicate.
- */
- public static <T> IgnitePredicate<T> breaker(final boolean firstVal) {
- return new IgnitePredicate<T>() {
- private boolean b = true;
-
- @Override public boolean apply(T e) {
- if (b) {
- b = false;
-
- return firstVal;
- }
-
- return !firstVal;
- }
-
- @Override public String toString() {
- return "Breaker predicate.";
- }
- };
- }
-
- /**
- * Gets closure that transform a grid projection into its predicate.
- *
- * @return Closure transforming a grid projection into its predicate.
- */
- public static IgniteClosure<ClusterGroup, IgnitePredicate<ClusterNode>> predicate() {
- return P2P;
- }
-
- /**
* Gets predicate that evaluates to {@code true} only for given local node ID.
*
* @param locNodeId Local node ID.
@@ -510,4868 +332,2608 @@ public class GridFunc {
}
/**
- * Returns out closure that always returns {@code null}.
- *
- * @return Out closure that always returns {@code null}.
- */
- @SuppressWarnings("unchecked")
- public static <T> IgniteOutClosure<T> nill() {
- return (IgniteOutClosure<T>)NILL;
- }
-
- /**
- * Creates closure that will reflectively call a method with the given name on
- * closure's argument and return result of that call.
- * <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteClosure} which is {@link C1}.
+ * Creates new collection by removing duplicates from the given collection.
*
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <R> Type of closure return value.
- * @param <T> Type of closure argument.
- * @return Reflective closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param c Collection to remove duplicates from.
+ * @param <T> Type of the collection.
+ * @return De-duped collection.
*/
- public static <T, R> IgniteClosure<T, R> cInvoke(final String mtdName, final Object... args) {
- A.notNull(mtdName, "mtdName");
-
- return new C1<T, R>() {
- private Method mtd;
+ public static <T> Collection<T> dedup(Collection<? extends T> c) {
+ A.notNull(c, "c");
- @SuppressWarnings("unchecked")
- @Override public R apply(T t) {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(t.getClass(), mtdName, args);
+ Collection<T> set = new GridLeanSet<>();
- mtd.setAccessible(true);
- }
+ set.addAll(c);
- return (R)mtd.invoke(t, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
- }
- };
+ return set;
}
/**
- * Creates in closure that will reflectively call a method with the given name on
- * closure's argument.
+ * Calculates sum of all elements.
* <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteClosure} which is {@link C1}.
+ * <img src="{@docRoot}/img/sum.png">
*
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <T> Type of closure argument.
- * @return Reflective in closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param c Collection of elements.
+ * @return Sum of all elements.
*/
- public static <T> IgniteInClosure<T> ciInvoke(final String mtdName, final Object... args) {
- A.notNull(mtdName, "mtdName");
-
- return new CI1<T>() {
- private Method mtd;
+ public static int sumInt(Iterable<Integer> c) {
+ A.notNull(c, "c");
- @Override public void apply(T t) {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(t.getClass(), mtdName, args);
+ int sum = 0;
- mtd.setAccessible(true);
- }
+ for (int t : c)
+ sum += t;
- mtd.invoke(t, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
- }
- };
+ return sum;
}
/**
- * Creates out closure that will reflectively call a method with the given name on provided
- * object and return result of that call.
- * <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteOutClosure} which is {@link CO}.
+ * Gets reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
+ * method and passed in {@code element} from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
*
- * @param o Target object to call the method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <R> Type of closure return value.
- * @return Reflective out closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+ * @param <T> Reducer element type.
+ * @return Passed in element.
*/
- public static <R> IgniteOutClosure<R> coInvoke(final Object o, final String mtdName, final Object... args) {
- A.notNull(o, "o", mtdName, "mtdName");
-
- return new CO<R>() {
- private Method mtd;
-
- @SuppressWarnings("unchecked")
- @Override public R apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(o.getClass(), mtdName, args);
-
- mtd.setAccessible(true);
- }
+ public static <T> IgniteReducer<T, T> identityReducer(final T elem) {
+ return new R1<T, T>() {
+ @Override public boolean collect(T e) {
+ return true;
+ }
- return (R)mtd.invoke(o, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
+ @Override public T reduce() {
+ return elem;
}
};
}
/**
- * Creates absolute closure that will reflectively call a method with the given name on provided object.
+ * Gets reducer closure that calculates sum of integer elements.
* <p>
- * Method reflects the typedef for {@link GridAbsClosure} which is {@link CA}.
+ * <img src="{@docRoot}/img/sum.png">
*
- * @param o Target object to call the method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @return Reflective absolute closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @return Reducer that calculates sum of integer elements.
*/
- public static GridAbsClosure caInvoke(final Object o, final String mtdName, @Nullable final Object... args) {
- A.notNull(o, "o", mtdName, "mtdName");
-
- return new CA() {
- /** */
- private Method mtd;
+ public static IgniteReducer<Integer, Integer> sumIntReducer() {
+ return new R1<Integer, Integer>() {
+ private AtomicInteger sum = new AtomicInteger(0);
- @SuppressWarnings("unchecked")
- @Override public void apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(o.getClass(), mtdName, args);
+ @Override public boolean collect(Integer e) {
+ if (e != null)
+ sum.addAndGet(e);
- mtd.setAccessible(true);
- }
+ return true;
+ }
- mtd.invoke(o, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
+ @Override public Integer reduce() {
+ return sum.get();
}
};
}
/**
- * Creates out closure that will reflectively call a static method with the given name
- * and return result of that call.
+ * Gets reducer closure that calculates sum of long integer elements.
* <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteOutClosure} which is {@link CO}.
+ * <img src="{@docRoot}/img/sum.png">
*
- * @param cls Class to call a static method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <R> Type of closure return value.
- * @return Reflective out closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @return Reducer that calculates sum of long integer elements.
*/
- public static <R> IgniteOutClosure<R> coInvoke(final Class<?> cls, final String mtdName,
- @Nullable final Object... args) {
- A.notNull(cls, "cls", mtdName, "mtdName");
-
- return new CO<R>() {
- /** */
- private Method mtd;
+ public static IgniteReducer<Long, Long> sumLongReducer() {
+ return new R1<Long, Long>() {
+ private AtomicLong sum = new AtomicLong(0);
- @SuppressWarnings("unchecked")
- @Override public R apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(cls, mtdName, args);
+ @Override public boolean collect(Long e) {
+ if (e != null)
+ sum.addAndGet(e);
- mtd.setAccessible(true);
- }
+ return true;
+ }
- return (R)mtd.invoke(null, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
+ @Override public Long reduce() {
+ return sum.get();
}
};
}
/**
- * Creates absolute closure that will reflectively call a static method with the given name.
- * <p>
- * Method reflects the typedef for {@link GridAbsClosure} which is {@link CA}.
+ * Creates a range list containing numbers in given range.
*
- * @param cls Class to call a static method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @return Reflective absolute closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param fromIncl Inclusive start of the range.
+ * @param toExcl Exclusive stop of the range.
+ * @return List containing numbers in range.
*/
- public static GridAbsClosure caInvoke(final Class<?> cls, final String mtdName, @Nullable final Object... args) {
- A.notNull(cls, "cls", mtdName, "mtdName");
+ public static List<Integer> range(int fromIncl, int toExcl) {
+ A.ensure(fromIncl >= 0, "fromIncl >= 0");
+ A.ensure(toExcl >= 0, "toExcl >= 0");
+ A.ensure(toExcl >= fromIncl, "toExcl > fromIncl");
- return new CA() {
- /** */
- private Method mtd;
+ if (toExcl == fromIncl)
+ return Collections.emptyList();
- @SuppressWarnings("unchecked")
- @Override public void apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(cls, mtdName, args);
+ List<Integer> list = new ArrayList<>(toExcl - fromIncl);
- mtd.setAccessible(true);
- }
+ for (int i = fromIncl; i < toExcl; i++)
+ list.add(i);
- mtd.invoke(null, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
- }
- };
+ return list;
}
/**
- * Looks up the method with given parameters.
+ * Gets reducer closure that concatenates strings using provided delimiter.
*
- * @param cls Class to look up in.
- * @param mtdName Method name to look up.
- * @param args Optional set of method parameters.
- * @return Method instance.
- * @throws Exception Thrown in case of any reflective errors.
+ * @param delim Delimiter (optional).
+ * @return Reducer that concatenates strings using provided delimeter.
*/
- private static Method method(Class<?> cls, String mtdName, @Nullable Object... args) throws Exception {
- assert cls != null;
- assert mtdName != null;
-
- int cnt = 0;
-
- Method m = null;
-
- for (Method mtd : cls.getDeclaredMethods())
- if (mtd.getName().equals(mtdName)) {
- cnt++;
-
- m = mtd;
- }
+ public static IgniteReducer<String, String> concatReducer(@Nullable final String delim) {
+ return new R1<String, String>() {
+ private SB sb = new SB();
- if (cnt == 0)
- throw new NoSuchMethodException(cls.getName() + '#' + mtdName);
+ private boolean first = true;
- // If there is only one method with provided name we
- // don't use lookup that requires parameters' types since
- // it is a lot more complex to deal with type inheritance there.
- if (cnt == 1)
- return m;
+ private final Object lock = new Object();
- if (!isEmpty(args)) {
- assert args != null;
+ @Override public boolean collect(String s) {
+ synchronized (lock) {
+ if (!first && !isEmpty(delim))
+ sb.a(delim);
- Class<?>[] types = new Class[args.length];
+ sb.a(s);
- int i = 0;
+ first = false;
+ }
- for (Object arg : args) {
- // This is not going to work in cases when method expects
- // an interface or supertype. Accept this limitation for now...
- types[i++] = arg.getClass();
+ return true;
}
- return cls.getDeclaredMethod(mtdName, types);
- }
- else
- return cls.getDeclaredMethod(mtdName);
+ @Override public String reduce() {
+ synchronized (lock) {
+ return sb.toString();
+ }
+ }
+ };
}
/**
- * Gets closure that converts object to its runtime class.
+ * Concatenates strings using provided delimiter.
*
- * @return Closure that converts object to its runtime class.
- */
- public static IgniteClosure<Object, Class<?>> clazz() {
- return CLAZZ;
- }
-
- /**
- * Creates new collection by removing duplicates from the given collection.
- *
- * @param c Collection to remove duplicates from.
- * @param <T> Type of the collection.
- * @return De-duped collection.
+ * @param c Input collection.
+ * @param delim Delimiter (optional).
+ * @return Concatenated string.
*/
- public static <T> Collection<T> dedup(Collection<? extends T> c) {
+ public static String concat(Iterable<String> c, @Nullable String delim) {
A.notNull(c, "c");
- Collection<T> set = new GridLeanSet<>();
-
- set.addAll(c);
-
- return set;
+ return reduce(c, concatReducer(delim));
}
/**
- * Calculates sum of all elements.
+ * Gets collections of data items from grid job res casted to specified type.
* <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @param c Collection of elements.
- * @return Sum of all elements.
- */
- public static int sumInt(Iterable<Integer> c) {
- A.notNull(c, "c");
-
- int sum = 0;
-
- for (int t : c) {
- sum += t;
- }
-
- return sum;
- }
-
- /**
- * Calculates sum of all elements.
+ * Here's the typical example of how this method is used in {@code reduce()} method
+ * implementation (this example sums up all the values of {@code Integer} type):
+ * <pre name="code" class="java">
+ * public Integer reduce(List<GridComputeJobResult> res) throws IgniteCheckedException {
+ * return F.sum(F.<Integer>jobResults(res));
+ * }
+ * </pre>
* <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Note that this method doesn't create a new collection but simply iterates over the input one.
*
- * @param c Collection of elements.
- * @return Sum of all elements.
+ * @param res Collection of grid job res.
+ * @param <T> Type of the data item to cast to. See {@link org.apache.ignite.compute.ComputeJobResult#getData()} method.
+ * @return Collections of data items casted to type {@code T}.
+ * @see org.apache.ignite.compute.ComputeJobResult#getData()
*/
- public static double sumDouble(Iterable<Double> c) {
- A.notNull(c, "c");
+ public static <T> Collection<T> jobResults(@Nullable Collection<? extends ComputeJobResult> res) {
+ if (isEmpty(res))
+ return Collections.emptyList();
- double sum = 0;
+ assert res != null;
- for (double t : c) {
- sum += t;
- }
+ Collection<T> c = new ArrayList<>(res.size());
- return sum;
+ for (ComputeJobResult r : res)
+ c.add(r.<T>getData());
+
+ return c;
}
/**
- * Calculates sum of all elements.
+ * Convenient utility method that returns collection of node IDs for a given
+ * collection of grid nodes.
* <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Note that this method doesn't create a new collection but simply iterates
+ * over the input one.
*
- * @param c Collection of elements.
- * @return Sum of all elements.
+ * @param nodes Collection of grid nodes.
+ * @return Collection of node IDs for given collection of grid nodes.
*/
- public static BigDecimal sumBigDecimal(Iterable<BigDecimal> c) {
- A.notNull(c, "c");
-
- BigDecimal sum = BigDecimal.ZERO;
-
- for (BigDecimal t : c) {
- sum = sum.add(t);
- }
+ public static Collection<UUID> nodeIds(@Nullable Collection<? extends ClusterNode> nodes) {
+ if (nodes == null || nodes.isEmpty())
+ return Collections.emptyList();
- return sum;
+ return F.viewReadOnly(nodes, node2id());
}
/**
- * Calculates sum of all elements.
+ * Convenient utility method that returns collection of node ID8s for a given
+ * collection of grid nodes. ID8 is a shorter string representation of node ID,
+ * mainly the first 8 characters.
* <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Note that this method doesn't create a new collection but simply iterates
+ * over the input one.
*
- * @param c Collection of elements.
- * @return Sum of all elements.
+ * @param nodes Collection of grid nodes.
+ * @return Collection of node IDs for given collection of grid nodes.
*/
- public static BigInteger sumBigInt(Iterable<BigInteger> c) {
- A.notNull(c, "c");
-
- BigInteger sum = BigInteger.ZERO;
-
- for (BigInteger t : c) {
- sum = sum.add(t);
- }
+ public static Collection<String> nodeId8s(@Nullable Collection<? extends ClusterNode> nodes) {
+ if (nodes == null || nodes.isEmpty())
+ return Collections.emptyList();
- return sum;
+ return F.viewReadOnly(nodes, NODE2ID8);
}
/**
- * Calculates arithmetic mean.
+ * Convenient utility method that returns collection of node ID8s for a given
+ * collection of node IDs. ID8 is a shorter string representation of node ID,
+ * mainly the first 8 characters.
* <p>
- * <img src="{@docRoot}/img/avg.png">
+ * Note that this method doesn't create a new collection but simply iterates
+ * over the input one.
*
- * @param c Input collection.
- * @return Arithmetic mean of the input collection.
+ * @param ids Collection of nodeIds.
+ * @return Collection of node IDs for given collection of grid nodes.
*/
- public static double avg(Iterable<? extends Number> c) {
- A.notNull(c, "c");
-
- double sum = 0;
-
- int i = 0;
-
- for (Number t : c) {
- sum += t.doubleValue();
-
- i++;
- }
+ public static Collection<String> id8s(@Nullable Collection<UUID> ids) {
+ if (ids == null || ids.isEmpty())
+ return Collections.emptyList();
- return sum / i;
+ return F.viewReadOnly(ids, ID2ID8);
}
/**
- * Gets reducer closure that calculates arithmetic mean.
- * <p>
- * <img src="{@docRoot}/img/avg.png">
+ * Creates absolute closure that does <tt>System.out.println(msg)</tt>.
*
- * @return Reducer closure that calculated arithmetic mean.
+ * @param msg Message to print.
+ * @return Absolute closure that print message.
*/
- public static <T extends Number> IgniteReducer<T, Double> avgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
-
- private final Object lock = new Object();
-
- @Override public boolean collect(T e) {
- if (e != null)
- synchronized (lock) {
- sum += e.doubleValue();
- i++;
- }
-
- return true;
- }
-
- @Override public Double reduce() {
- synchronized (lock) {
- return sum / i;
- }
+ public static GridAbsClosure println(final String msg) {
+ return new CA() {
+ @Override public void apply() {
+ System.out.println(msg);
}
};
}
/**
- * Calculates quadratic mean.
- * <p>
- * <img src="{@docRoot}/img/qavg.png">
+ * Gets random value from given collection.
*
- * @param c Input collection.
- * @return Quadratic mean of the input collection.
+ * @param c Input collection (no {@code null} and not emtpy).
+ * @param <T> Type of the collection.
+ * @return Random value from the input collection.
*/
- public static double qavg(Iterable<? extends Number> c) {
+ @SuppressWarnings("UnusedDeclaration")
+ public static <T> T rand(Collection<? extends T> c) {
A.notNull(c, "c");
- double sum = 0;
+ int n = ThreadLocalRandom8.current().nextInt(c.size());
int i = 0;
- for (Number t : c) {
- double d = t.doubleValue();
-
- sum += d * d;
-
- i++;
+ for (T t : c) {
+ if (i++ == n)
+ return t;
}
- return Math.sqrt(sum / i);
+ throw new ConcurrentModificationException();
}
/**
- * Gets reducer closure that calculates quadratic mean.
- * <p>
- * <img src="{@docRoot}/img/qavg.png">
+ * Gets random value from given list. For random-access lists this
+ * operation is O(1), otherwise O(n).
*
- * @return Reducer closure that calculated quadratic mean.
+ * @param l Input collection.
+ * @param <T> Type of the list elements.
+ * @return Random value from the input list.
*/
- public static <T extends Number> IgniteReducer<T, Double> qavgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
-
- private final Object lock = new Object();
-
- @Override public boolean collect(T e) {
- if (e != null) {
- double d = e.doubleValue();
-
- synchronized (lock) {
- sum += d * d;
-
- i++;
- }
- }
-
- return true;
- }
+ public static <T> T rand(List<T> l) {
+ A.notNull(l, "l");
- @Override public Double reduce() {
- synchronized (lock) {
- return Math.sqrt(sum / i);
- }
- }
- };
+ return l.get(ThreadLocalRandom8.current().nextInt(l.size()));
}
/**
- * Calculates geometric mean.
- * <p>
- * <img src="{@docRoot}/img/gavg.png">
+ * Gets random value from given array. This operation
+ * does not iterate through array elements and returns immediately.
*
* @param c Input collection.
- * @return Geometric mean of the input collection.
+ * @param <T> Type of the collection.
+ * @return Random value from the input collection.
*/
- public static double gavg(Iterable<? extends Number> c) {
+ public static <T> T rand(T... c) {
A.notNull(c, "c");
- double sum = 0;
-
- int i = 0;
-
- for (Number t : c) {
- sum *= t.doubleValue();
-
- i++;
- }
-
- return Math.pow(sum, 1f / i);
+ return c[ThreadLocalRandom8.current().nextInt(c.length)];
}
/**
- * Gets reducer closure that calculates geometric mean.
- * <p>
- * <img src="{@docRoot}/img/gavg.png">
+ * Concatenates an element to a collection. If {@code copy} flag is {@code true}, then
+ * a new collection will be created and the element and passed in collection will be
+ * copied into the new one. The returned collection will be modifiable. If {@code copy}
+ * flag is {@code false}, then a read-only view will be created over the element and given
+ * collections and no copying will happen.
*
- * @return Reducer closure that calculated geometric mean.
+ * @param cp Copy flag.
+ * @param t First element.
+ * @param c Second collection.
+ * @param <T> Element type.
+ * @return Concatenated collection.
*/
- public static <T extends Number> IgniteReducer<T, Double> gavgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
+ public static <T> Collection<T> concat(boolean cp, @Nullable final T t, @Nullable final Collection<T> c) {
+ if (cp) {
+ if (isEmpty(c)) {
+ Collection<T> l = new ArrayList<>(1);
- private final Object lock = new Object();
+ l.add(t);
- @Override public boolean collect(T e) {
- if (e != null)
- synchronized (lock) {
- sum *= e.doubleValue();
+ return l;
+ }
- i++;
- }
+ assert c != null;
- return true;
- }
+ Collection<T> ret = new ArrayList<>(c.size() + 1);
- @Override public Double reduce() {
- synchronized (lock) {
- return Math.pow(sum, 1f / i);
- }
- }
- };
- }
+ ret.add(t);
+ ret.addAll(c);
- /**
- * Calculates weighted mean.
- * <p>
- * <img src="{@docRoot}/img/wavg.png">
- *
- * @param c Collection of elements.
- * @param w Collection of weights.
- * @return Weighted mean of the input collection.
- */
- public static double wavg(Collection<? extends Number> c, Collection<? extends Number> w) {
- A.notNull(c, "c", w, "w");
- A.ensure(c.size() == w.size(), "c.size() == w.size()");
+ return ret;
+ }
+ else {
+ if (isEmpty(c))
+ return Collections.singletonList(t);
- double sumC = 0;
- double sumW = 0;
+ assert c != null;
- Iterator<? extends Number> iterC = c.iterator();
- Iterator<? extends Number> iterW = w.iterator();
+ return new GridSerializableCollection<T>() {
+ @NotNull
+ @Override public Iterator<T> iterator() {
+ return new GridSerializableIterator<T>() {
+ private Iterator<T> it;
- while (iterC.hasNext()) {
- assert iterW.hasNext();
+ @Override public boolean hasNext() {
+ return it == null || it.hasNext();
+ }
- double dc = iterC.next().doubleValue();
- double dw = iterW.next().doubleValue();
+ @Nullable @Override public T next() {
+ if (it == null) {
+ it = c.iterator();
- sumW += dw;
- sumC += dw * dc;
- }
+ return t;
+ }
- return sumC / sumW;
- }
+ return it.next();
+ }
- /**
- * Calculates harmonic mean.
- * <p>
- * <img src="{@docRoot}/img/havg.png">
+ @Override public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ @Override public int size() {
+ return c.size() + 1;
+ }
+
+ @Override public boolean equals(Object obj) {
+ return obj instanceof Collection && eqNotOrdered(this, (Collection)obj);
+ }
+ };
+ }
+ }
+
+ /**
+ * Concatenates 2 collections into one. If {@code copy} flag is {@code true}, then
+ * a new collection will be created and these collections will be copied into the
+ * new one. The returned collection will be modifiable. If {@code copy} flag is
+ * {@code false}, then a read-only view will be created over given collections
+ * and no copying will happen.
*
- * @param c Input collection.
- * @return Harmonic mean of the input collection.
+ * @param cp Copy flag.
+ * @param c1 First collection.
+ * @param c2 Second collection.
+ * @param <T> Element type.
+ * @return Concatenated {@code non-null} collection.
*/
- public static double havg(Iterable<? extends Number> c) {
- A.notNull(c, "c");
+ public static <T> Collection<T> concat(boolean cp, @Nullable final Collection<T> c1,
+ @Nullable final Collection<T> c2) {
+ if (cp) {
+ if (isEmpty(c1) && isEmpty(c2))
+ return new ArrayList<>(0);
- double sum = 0;
+ if (isEmpty(c1))
+ return new ArrayList<>(c2);
- int i = 0;
+ if (isEmpty(c2))
+ return new ArrayList<>(c1);
- for (Number t : c) {
+ Collection<T> c = new ArrayList<>(c1.size() + c2.size());
- sum += 1 / t.doubleValue();
+ c.addAll(c1);
+ c.addAll(c2);
- i++;
+ return c;
}
+ else {
+ if (isEmpty(c1) && isEmpty(c2))
+ return Collections.emptyList();
- return i / sum;
- }
-
- /**
- * Gets reducer closure that collects only a single value and returns it
- * without any transformations.
- *
- * @return Reducer closure that collects and returns single value.
- */
- public static <T> IgniteReducer<T, T> singleReducer() {
- return new R1<T, T>() {
- private T obj;
+ if (isEmpty(c1) || isEmpty(c2)) {
+ Collection<T> c = isEmpty(c1) ? c2 : c1;
- @Override public boolean collect(T e) {
- // No synchronization needed here.
- obj = e;
+ assert c != null;
- return false;
+ return c;
}
- @Override public T reduce() {
- return obj;
- }
- };
+ return new GridSerializableCollection<T>() {
+ @NotNull
+ @Override public Iterator<T> iterator() {
+ return new GridSerializableIterator<T>() {
+ private Iterator<T> it1 = c1.iterator();
+ private Iterator<T> it2 = c2.iterator();
+
+ @Override public boolean hasNext() {
+ if (it1 != null)
+ if (!it1.hasNext())
+ it1 = null;
+ else
+ return true;
+
+ return it2.hasNext();
+ }
+
+ @Override public T next() {
+ return it1 != null ? it1.next() : it2.next();
+ }
+
+ @Override public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ @Override public boolean contains(Object o) {
+ return c1.contains(o) || c2.contains(o);
+ }
+
+ @Override public int size() {
+ return c1.size() + c2.size();
+ }
+
+ @Override public boolean equals(Object obj) {
+ return obj instanceof Collection && eqNotOrdered(this, (Collection<?>)obj);
+ }
+ };
+ }
}
/**
- * Gets reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
- * method and passed in {@code element} from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+ * Concatenates an elements to an array.
*
- * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
- * @param <T> Reducer element type.
- * @param <R> Return element type.
- * @return Passed in element.
+ * @param arr Array.
+ * @param obj One or more elements.
+ * @return Concatenated array.
*/
- public static <T, R> IgniteReducer<T, R> continuousReducer(final R elem) {
- return new R1<T, R>() {
- @Override public boolean collect(T e) {
- return true;
- }
+ public static <T> T[] concat(@Nullable T[] arr, T... obj) {
+ T[] newArr;
- @Override public R reduce() {
- return elem;
- }
- };
+ if (arr == null || arr.length == 0)
+ newArr = obj;
+ else {
+ newArr = Arrays.copyOf(arr, arr.length + obj.length);
+
+ System.arraycopy(obj, 0, newArr, arr.length, obj.length);
+ }
+
+ return newArr;
}
/**
- * Gets reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
- * method and passed in {@code element} from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+ * Concatenates multiple iterators as single one.
*
- * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
- * @param <T> Reducer element type.
- * @return Passed in element.
+ * @param iters Iterators.
+ * @return Single iterator.
*/
- public static <T> IgniteReducer<T, T> identityReducer(final T elem) {
- return new R1<T, T>() {
- @Override public boolean collect(T e) {
- return true;
- }
+ @SuppressWarnings("unchecked")
+ public static <T> Iterator<T> concat(Iterator<T> ... iters) {
+ if (iters.length == 1)
+ return iters[0];
- @Override public T reduce() {
- return elem;
- }
- };
+ return concat(asList(iters).iterator());
}
/**
- * Gets reducer closure that calculates harmonic mean.
- * <p>
- * <img src="{@docRoot}/img/havg.png">
+ * Concatenates multiple iterators as single one.
*
- * @return Reducer closure that calculated harmonic mean.
+ * @param iters Iterator over iterators.
+ * @return Single iterator.
*/
- public static <T extends Number> IgniteReducer<T, Double> havgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
+ @SuppressWarnings("unchecked")
+ public static <T> Iterator<T> concat(final Iterator<Iterator<T>> iters) {
+ if (!iters.hasNext())
+ return Collections.<T>emptySet().iterator();
- private final Object lock = new Object();
+ return new Iterator<T>() {
+ private Iterator<T> it = iters.next();
- @Override public boolean collect(T e) {
- if (e != null)
- synchronized (lock) {
- sum += 1 / e.doubleValue();
+ private Iterator<T> last;
- i++;
- }
+ private T next;
- return true;
+ {
+ advance();
}
- @Override public Double reduce() {
- synchronized (lock) {
- return i / sum;
- }
- }
- };
- }
+ private void advance() {
+ for (;;) {
+ if (it.hasNext()) {
+ next = it.next();
- /**
- * Gets reducer closure that calculates sum of integer elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @return Reducer that calculates sum of integer elements.
- */
- public static IgniteReducer<Integer, Integer> sumIntReducer() {
- return new R1<Integer, Integer>() {
- private AtomicInteger sum = new AtomicInteger(0);
+ assert next != null;
- @Override public boolean collect(Integer e) {
- if (e != null)
- sum.addAndGet(e);
+ return;
+ }
- return true;
- }
+ if (!iters.hasNext())
+ return;
- @Override public Integer reduce() {
- return sum.get();
+ it = iters.next();
+ }
}
- };
- }
-
- /**
- * Gets reducer closure that calculates sum of long integer elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @return Reducer that calculates sum of long integer elements.
- */
- public static IgniteReducer<Long, Long> sumLongReducer() {
- return new R1<Long, Long>() {
- private AtomicLong sum = new AtomicLong(0);
- @Override public boolean collect(Long e) {
- if (e != null)
- sum.addAndGet(e);
-
- return true;
+ @Override public boolean hasNext() {
+ return next != null;
}
- @Override public Long reduce() {
- return sum.get();
- }
- };
- }
+ @Override public T next() {
+ T res = next;
- /**
- * Gets reducer closure that calculates sum of all elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @return Reducer that calculates sum of all elements.
- */
- @SuppressWarnings("unchecked")
- public static IgniteReducer<Double, Double> sumDoubleReducer() {
- return new R1<Double, Double>() {
- private double sum;
+ if (res == null)
+ throw new NoSuchElementException();
- private final Object lock = new Object();
+ next = null;
- @Override public boolean collect(Double e) {
- if (e != null)
- synchronized (lock) {
- sum += e;
- }
+ last = it;
- return true;
+ advance();
+
+ return res;
}
- @Override public Double reduce() {
- synchronized (lock) {
- return sum;
- }
+ @Override public void remove() {
+ if (last == null)
+ throw new IllegalStateException();
+
+ last.remove();
}
};
}
/**
- * Creates a range list containing numbers in given range.
+ * Loses all elements in input collection that are contained in {@code filter} collection.
*
- * @param fromIncl Inclusive start of the range.
- * @param toExcl Exclusive stop of the range.
- * @return List containing numbers in range.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates new collection not modifying input,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param filter Filter collection. If {@code filter} collection is empty or
+ * {@code null} - no elements are lost.
+ * @param <T> Type of collections.
+ * @return Collection of remaining elements
*/
- public static List<Integer> range(int fromIncl, int toExcl) {
- A.ensure(fromIncl >= 0, "fromIncl >= 0");
- A.ensure(toExcl >= 0, "toExcl >= 0");
- A.ensure(toExcl >= fromIncl, "toExcl > fromIncl");
-
- if (toExcl == fromIncl)
- return Collections.emptyList();
-
- List<Integer> list = new ArrayList<>(toExcl - fromIncl);
-
- for (int i = fromIncl; i < toExcl; i++)
- list.add(i);
+ public static <T0, T extends T0> Collection<T> lose(Collection<T> c, boolean cp,
+ @Nullable Collection<T0> filter) {
+ A.notNull(c, "c");
- return list;
+ return lose(c, cp, F0.in(filter));
}
/**
- * Gets reducer closure that calculates sum of all elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Loses all elements in input collection that are evaluated to {@code true} by
+ * all given predicates.
*
- * @return Reducer that calculates sum of all elements.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates new collection without modifying the input one,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param p Predicates to filter by. If no predicates provided - no elements are lost.
+ * @param <T> Type of collections.
+ * @return Collection of remaining elements.
*/
- @SuppressWarnings("unchecked")
- public static IgniteReducer<BigDecimal, BigDecimal> sumBigDecimalReducer() {
- return new R1<BigDecimal, BigDecimal>() {
- private BigDecimal sum = BigDecimal.ZERO;
+ public static <T> Collection<T> lose(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
+ A.notNull(c, "c");
- private final Object lock = new Object();
+ Collection<T> res;
- @Override public boolean collect(BigDecimal e) {
- if (e != null)
- synchronized (lock) {
- sum = sum.add(e);
- }
+ if (!cp) {
+ res = c;
- return true;
- }
+ if (isEmpty(p))
+ res.clear();
+ else if (!isAlwaysFalse(p))
+ for (Iterator<T> iter = res.iterator(); iter.hasNext();)
+ if (isAll(iter.next(), p))
+ iter.remove();
+ }
+ else {
+ res = new LinkedList<>();
- @Override public BigDecimal reduce() {
- synchronized (lock) {
- return sum;
- }
- }
- };
+ if (!isEmpty(p) && !isAlwaysTrue(p))
+ for (T t : c)
+ if (!isAll(t, p))
+ res.add(t);
+ }
+
+ return res;
}
/**
- * Gets reducer closure that calculates sum of all elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Loses all entries in input map that are evaluated to {@code true} by all given predicates.
*
- * @return Reducer that calculates sum of all elements.
+ * @param m Map to filter.
+ * @param cp If {@code true} method creates new map not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Optional set of predicates to use for filtration. If none provided - original map
+ * will (or its copy) be returned.
+ * @param <K> Type of the free variable for the predicate and type of map's keys.
+ * @param <V> Type of the free variable for the predicate and type of map's values.
+ * @return Filtered map.
*/
- @SuppressWarnings("unchecked")
- public static IgniteReducer<BigInteger, BigInteger> sumBigIntegerReducer() {
- return new R1<BigInteger, BigInteger>() {
- private BigInteger sum = BigInteger.ZERO;
+ @SuppressWarnings({"unchecked"})
+ public static <K, V> Map<K, V> lose(Map<K, V> m, boolean cp,
+ @Nullable IgnitePredicate<? super Map.Entry<K, V>>... p) {
+ A.notNull(m, "m");
- private final Object lock = new Object();
+ Map<K, V> res;
- @Override public boolean collect(BigInteger e) {
- if (e != null)
- synchronized (lock) {
- sum = sum.add(e);
- }
+ if (!cp) {
+ res = m;
- return true;
- }
+ if (isEmpty(p))
+ res.clear();
+ else if (!isAlwaysFalse(p))
+ for (Iterator<Map.Entry<K, V>> iter = m.entrySet().iterator(); iter.hasNext();)
+ if (isAll(iter.next(), p))
+ iter.remove();
+ }
+ else {
+ res = U.newHashMap(m.size());
- @Override public BigInteger reduce() {
- synchronized (lock) {
- return sum;
- }
- }
- };
+ if (!isEmpty(p) && !isAlwaysTrue(p))
+ for (Map.Entry<K, V> e : m.entrySet())
+ if (!F.isAll(e, p))
+ res.put(e.getKey(), e.getValue());
+ }
+
+ return res;
}
/**
- * Gets reducer closure that concatenates strings using provided delimiter.
+ * Loses all entries in input map which keys are evaluated to {@code true} by all
+ * given predicates.
*
- * @param delim Delimiter (optional).
- * @return Reducer that concatenates strings using provided delimeter.
+ * @param m Map to filter.
+ * @param cp If {@code true} method creates new map not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Optional set of predicates to use for filtration. If none provided - original
+ * map (or its copy) will be returned.
+ * @param <K> Type of the free variable for the predicate and type of map's keys.
+ * @param <V> Type of map's values.
+ * @return Filtered map.
*/
- public static IgniteReducer<String, String> concatReducer(@Nullable final String delim) {
- return new R1<String, String>() {
- private SB sb = new SB();
-
- private boolean first = true;
-
- private final Object lock = new Object();
-
- @Override public boolean collect(String s) {
- synchronized (lock) {
- if (!first && !isEmpty(delim))
- sb.a(delim);
-
- sb.a(s);
-
- first = false;
- }
-
- return true;
- }
-
- @Override public String reduce() {
- synchronized (lock) {
- return sb.toString();
- }
+ public static <K, V> Map<K, V> loseKeys(
+ Map<K, V> m,
+ boolean cp,
+ @Nullable final IgnitePredicate<? super K>... p
+ ) {
+ return lose(m, cp, new P1<Map.Entry<K, V>>() {
+ @Override public boolean apply(Map.Entry<K, V> e) {
+ return isAll(e.getKey(), p);
}
- };
+ });
}
/**
- * Concatenates strings using provided delimiter.
+ * Loses all entries in input map which values are evaluated to {@code true} by all
+ * given predicates.
*
- * @param c Input collection.
- * @param delim Delimiter (optional).
- * @return Concatenated string.
+ * @param m Map to filter.
+ * @param cp If {@code true} method creates new map not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Optional set of predicates to use for filtration. If none provided - original
+ * map (or its copy) will be returned.
+ * @param <K> Type of the free variable for the predicate and type of map's keys.
+ * @param <V> Type of map's values.
+ * @return Filtered map.
*/
- public static String concat(Iterable<String> c, @Nullable String delim) {
- A.notNull(c, "c");
-
- return reduce(c, concatReducer(delim));
+ public static <K, V> Map<K, V> loseValues(Map<K, V> m, boolean cp,
+ @Nullable final IgnitePredicate<? super V>... p) {
+ return lose(m, cp, new P1<Map.Entry<K, V>>() {
+ @Override public boolean apply(Map.Entry<K, V> e) {
+ return isAll(e.getValue(), p);
+ }
+ });
}
/**
- * Gets collections of data items from grid job res casted to specified type.
- * <p>
- * Here's the typical example of how this method is used in {@code reduce()} method
- * implementation (this example sums up all the values of {@code Integer} type):
- * <pre name="code" class="java">
- * public Integer reduce(List<GridComputeJobResult> res) throws IgniteCheckedException {
- * return F.sum(F.<Integer>jobResults(res));
- * }
- * </pre>
- * <p>
- * Note that this method doesn't create a new collection but simply iterates over the input one.
+ * Loses all elements in input list that are contained in {@code filter} collection.
*
- * @param res Collection of grid job res.
- * @param <T> Type of the data item to cast to. See {@link org.apache.ignite.compute.ComputeJobResult#getData()} method.
- * @return Collections of data items casted to type {@code T}.
- * @see org.apache.ignite.compute.ComputeJobResult#getData()
+ * @param c Input list.
+ * @param cp If {@code true} method creates new list not modifying input,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param filter Filter collection. If {@code filter} collection is empty or
+ * {@code null} - no elements are lost.
+ * @param <T> Type of list.
+ * @return List of remaining elements
*/
- public static <T> Collection<T> jobResults(@Nullable Collection<? extends ComputeJobResult> res) {
- if (isEmpty(res))
- return Collections.emptyList();
+ public static <T> List<T> loseList(List<T> c, boolean cp, @Nullable Collection<? super T> filter) {
+ A.notNull(c, "c");
- assert res != null;
+ List<T> res;
- Collection<T> c = new ArrayList<>(res.size());
+ if (!cp) {
+ res = c;
- for (ComputeJobResult r : res)
- c.add(r.<T>getData());
+ if (filter != null)
+ res.removeAll(filter);
+ }
+ else {
+ res = new LinkedList<>();
- return c;
+ for (T t : c) {
+ if (filter == null || !filter.contains(t))
+ res.add(t);
+ }
+ }
+
+ return res;
}
/**
- * Convenient utility method that returns collection of node IDs for a given
- * collection of grid nodes.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates
- * over the input one.
+ * Loses all elements in input list for which any of the predicates evaluate to {@code true}.
*
- * @param nodes Collection of grid nodes.
- * @return Collection of node IDs for given collection of grid nodes.
+ * @param c Input list.
+ * @param cp If {@code true} method creates new list not modifying input,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param p Looses all elements for which any of the predicates evaluate to {@code true}.
+ * @param <T> Type of list.
+ * @return List of remaining elements
*/
- public static Collection<UUID> nodeIds(@Nullable Collection<? extends ClusterNode> nodes) {
- if (nodes == null || nodes.isEmpty())
- return Collections.emptyList();
+ public static <T> List<T> filterList(List<T> c, boolean cp, @Nullable IgnitePredicate<T>... p) {
+ A.notNull(c, "c");
- return F.viewReadOnly(nodes, node2id());
- }
+ List<T> res;
- /**
- * Convenient utility method that returns collection of node ID8s for a given
- * collection of grid nodes. ID8 is a shorter string representation of node ID,
- * mainly the first 8 characters.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates
- * over the input one.
- *
- * @param nodes Collection of grid nodes.
- * @return Collection of node IDs for given collection of grid nodes.
- */
- public static Collection<String> nodeId8s(@Nullable Collection<? extends ClusterNode> nodes) {
- if (nodes == null || nodes.isEmpty())
- return Collections.emptyList();
+ if (!cp) {
+ res = c;
- return F.viewReadOnly(nodes, node2id8());
- }
+ if (p != null)
+ for (Iterator<T> it = c.iterator(); it.hasNext();)
+ if (isAny(it.next(), p))
+ it.remove();
+ }
+ else {
+ res = new ArrayList<>(c.size());
- /**
- * Convenient utility method that returns collection of node ID8s for a given
- * collection of node IDs. ID8 is a shorter string representation of node ID,
- * mainly the first 8 characters.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates
- * over the input one.
- *
- * @param ids Collection of nodeIds.
- * @return Collection of node IDs for given collection of grid nodes.
- */
- public static Collection<String> id8s(@Nullable Collection<UUID> ids) {
- if (ids == null || ids.isEmpty())
- return Collections.emptyList();
+ for (T t : c)
+ if (!isAny(t, p))
+ res.add(t);
+ }
- return F.viewReadOnly(ids, id2id8());
+ return res;
}
/**
- * Convenient utility method that returns collection of node attributes for a given
- * collection of grid nodes.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates over the input one.
+ * Gets closure which converts node to node ID.
*
- * @param nodes Collection of grid nodes.
- * @param attr Name of the attribute to return from each node.
- * @param <T> Type of the attribute.
- * @return Collection of node attributes for given collection of grid nodes.
+ * @return Closure which converts node to node ID.
*/
- public static <T> Collection<T> nodeAttributes(Collection<? extends ClusterNode> nodes, String attr) {
- A.notNull(nodes, "nodes", attr, "attr");
-
- Collection<T> c = new ArrayList<>(nodes.size());
-
- for (ClusterNode n : nodes)
- c.add(n.<T>attribute(attr));
-
- return c;
+ public static IgniteClosure<ClusterNode, UUID> node2id() {
+ return NODE2ID;
}
/**
- * Gets closure that calls {@code System.out.println()} on its bound variable.
+ * Creates grid node predicate evaluating on the given node ID.
*
- * @param <T> Type of the bound variable.
- * @return Closure that calls {@code System.out.println()} on its bound variable.
+ * @param nodeId Node ID for which returning predicate will evaluate to {@code true}.
+ * @return Grid node predicate evaluating on the given node ID.
+ * @see #idForNodeId(UUID)
+ * @see #nodeIds(Collection)
*/
- @SuppressWarnings("unchecked")
- public static <T> IgniteInClosure<T> println() {
- return (IgniteInClosure<T>)PRINTLN;
- }
+ public static <T extends ClusterNode> IgnitePredicate<T> nodeForNodeId(final UUID nodeId) {
+ A.notNull(nodeId, "nodeId");
- /**
- * Creates absolute closure that does <tt>System.out.println(msg)</tt>.
- *
- * @param msg Message to print.
- * @return Absolute closure that print message.
- */
- public static GridAbsClosure println(final String msg) {
- return new CA() {
- @Override public void apply() {
- System.out.println(msg);
+ return new P1<T>() {
+ @Override public boolean apply(ClusterNode e) {
+ return e.id().equals(nodeId);
}
};
}
/**
- * Creates absolute closure that does <tt>System.out.print(msg)</tt>.
+ * Creates grid node predicate evaluating on the given node IDs.
*
- * @param msg Message to print.
- * @return Absolute closure that print message.
+ * @param nodeIds Collection of node IDs.
+ * @return Grid node predicate evaluating on the given node IDs.
+ * @see #idForNodeId(UUID)
+ * @see #nodeIds(Collection)
*/
- public static GridAbsClosure print(final String msg) {
- return new CA() {
- @Override public void apply() {
- System.out.print(msg);
- }
- };
- }
+ public static <T extends ClusterNode> IgnitePredicate<T> nodeForNodeIds(@Nullable final Collection<UUID>
+ nodeIds) {
+ if (isEmpty(nodeIds))
+ return alwaysFalse();
- /**
- * Gets closure that prints out its bound variable.
- *
- * @param pre String value to print before each variable.
- * @param post String value to print after each variable.
- * @param <T> Type of the bound variable.
- * @return Closure that calls {@code System.out.print(pre); System.out.print(t); System.out.println(post)}
- * on its bound variable.
- */
- public static <T> IgniteInClosure<T> println(@Nullable final String pre, @Nullable final String post) {
- return new CI1<T>() {
- @Override public void apply(T t) {
- String sPre = pre == null ? "" : pre;
- String sPost = post == null ? "" : post;
+ assert nodeIds != null;
- System.out.println(sPre + t + sPost);
+ return new P1<T>() {
+ @Override public boolean apply(ClusterNode e) {
+ return nodeIds.contains(e.id());
}
};
}
/**
- * Gets closure that prints out its bound variable.
+ * Creates {@link UUID} predicate evaluating on the given node ID.
*
- * @param fmt Format string as for {@link PrintStream#printf(String, Object...)} method.
- * @param <T> Type of the bound variable.
- * @return Closure that prints out its bound variable.
+ * @param nodeId Node ID for which returning predicate will evaluate to {@code true}.
+ * @return {@link UUID} predicate evaluating on the given node ID.
+ * @see #nodeForNodeId(UUID)
+ * @see #nodeIds(Collection)
*/
- public static <T> IgniteInClosure<T> printf(final String fmt) {
- return new CI1<T>() {
- @Override public void apply(T t) {
- System.out.printf(fmt, t);
+ public static IgnitePredicate<UUID> idForNodeId(final UUID nodeId) {
+ A.notNull(nodeId, "nodeId");
+
+ return new P1<UUID>() {
+ @Override public boolean apply(UUID id) {
+ return id.equals(nodeId);
}
};
}
/**
- * Gets closure that prints out its bound variable
+ * Creates predicates that evaluates to {@code true} for each node in given collection.
+ * Note that if collection is empty the result predicate will always evaluate to {@code false}.
+ * Implementation simply creates {@link GridNodePredicate} instance.
*
- * @return Closure that prints out its bound variable.
+ * @param nodes Collection of nodes. If none provided - result predicate will always
+ * return {@code false}.
+ * @return Predicates that evaluates to {@code true} for each node in given collection.
*/
- @SuppressWarnings("unchecked")
- public static <T> IgniteInClosure<T> print() {
- return (IgniteInClosure<T>)PRINT;
+ public static IgnitePredicate<ClusterNode> nodeForNodes(ClusterNode... nodes) {
+ return new GridNodePredicate(nodes);
}
/**
- * Gets closure that prints out its bound variable.
+ * Retains all elements in input collection that are contained in {@code filter}.
*
- * @param pre String value to print before each variable.
- * @param post String value to print after each variable.
- * @return Closure that prints out its bound variable.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates collection not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param filter Filter collection. If filter collection is {@code null} or empty -
+ * an empty collection will be returned.
+ * @param <T> Type of collections.
+ * @return Collection of retain elements.
*/
- public static <T> IgniteInClosure<T> print(@Nullable final String pre, @Nullable final String post) {
- return new CI1<T>() {
- @Override public void apply(T t) {
- String sPre = pre == null ? "" : pre;
- String sPost = post == null ? "" : post;
+ public static <T0, T extends T0> Collection<T> retain(Collection<T> c, boolean cp,
+ @Nullable Collection<? extends T0> filter) {
+ A.notNull(c, "c");
- System.out.print(sPre + t + sPost);
- }
- };
+ return retain(c, cp, F0.in(filter));
}
/**
- * Gets random value from given collection.
+ * Retains all elements in input collection that are evaluated to {@code true}
+ * by all given predicates.
*
- * @param c Input collection (no {@code null} and not emtpy).
- * @param <T> Type of the collection.
- * @return Random value from the input collection.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates collection not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Predicates to filter by. If no predicates provides - all elements
+ * will be retained.
+ * @param <T> Type of collections.
+ * @return Collection of retain elements.
*/
- @SuppressWarnings("UnusedDeclaration")
- public static <T> T rand(Collection<? extends T> c) {
+ public static <T> Collection<T> retain(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
A.notNull(c, "c");
- int n = ThreadLocalRandom8.current().nextInt(c.size());
-
- int i = 0;
-
- for (T t : c) {
- if (i++ == n)
- return t;
- }
-
- throw new ConcurrentModificationException();
+ return lose(c, cp, not(p));
}
/**
- * Gets random value from given collection which may be modified concurrently.
+ * Retains only up to first {@code num} elements in the input collection.
*
* @param c Input collection.
- * @param <T> Type of the collection.
- * @return Random value from the input collection.
+ * @param cp If {@code true} method creates collection not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param num Maximum number of elements to retain (the actual number can be
+ * less if the input collection contains less elements).
+ * @param <T> Type of the collections.
+ * @return Collection contains up to {@code num} first elements from the input collection.
*/
- @Nullable public static <T> T randConcurrent(Collection<? extends T> c) {
+ public static <T> Collection<T> retain(Collection<T> c, boolean cp, int num) {
A.notNull(c, "c");
+ A.ensure(num >= 0, "num >= 0");
- int size = c.size();
+ Collection<T> res;
- if (size == 0)
- return null;
+ if (!cp) {
+ res = c;
- int n = ThreadLocalRandom8.current().nextInt(size);
+ if (num < res.size()) {
+ int i = 0;
- int i = 0;
+ for (Iterator<T> iter = res.iterator(); iter.hasNext();) {
+ iter.next();
- T res = null;
+ if (i++ >= num)
+ iter.remove();
+ }
+ }
+ }
+ else {
+ res = new ArrayList<>(num);
- for (T t : c) {
- if (i++ == n)
- return t;
+ Iterator<? extends T> iter = c.iterator();
- res = t;
+ for (int i = 0; i < num && iter.hasNext(); i++)
+ res.add(iter.next());
}
return res;
}
/**
- * Gets random value from given list. For random-access lists this
- * operation is O(1), otherwise O(n).
+ * Curries given closure.
*
- * @param l Input collection.
- * @param <T> Type of the list elements.
- * @return Random value from the input list.
+ * @param f Closure.
+ * @param e Parameter.
+ * @param <T> Input type.
+ * @param <R> Output type.
+ * @return Curried closure.
*/
- public static <T> T rand(List<T> l) {
- A.notNull(l, "l");
-
- return l.get(ThreadLocalRandom8.current().nextInt(l.size()));
+ public static <T, R> IgniteOutClosure<R> curry(final IgniteClosure<? super T, R> f, final T e) {
+ return new IgniteOutClosure<R>() {
+ @Override public R apply() {
+ return f.apply(e);
+ }
+ };
}
/**
- * Gets random value from given array. This operation
- * does not iterate through array elements and returns immediately.
+ * Curries given closure.
*
- * @param c Input collection.
- * @param <T> Type of the collection.
- * @return Random value from the input collection.
+ * @param f Closure.
+ * @param e Parameter.
+ * @param <T> Input type.
+ * @return Curried closure.
*/
- public static <T> T rand(T... c) {
- A.notNull(c, "c");
-
- return c[ThreadLocalRandom8.current().nextInt(c.length)];
+ public static <T> GridAbsClosure curry(final IgniteInClosure<? super T> f, final T e) {
+ return new GridAbsClosure() {
+ @Override public void apply() {
+ f.apply(e);
+ }
+ };
}
/**
- * Concatenates an element to a collection. If {@code copy} flag is {@code true}, then
- * a new collection will be created and the element and passed in collection will be
- * copied into the new one. The returned collection will be modifiable. If {@code copy}
- * flag is {@code false}, then a read-only view will be created over the element and given
- * collections and no copying will happen.
+ * Converts array to {@link List}. Note that resulting list cannot
+ * be altered in size, as it it based on the passed in array -
+ * only current elements can be changed.
+ * <p>
+ * Note that unlike {@link Arrays#asList(Object[])}, this method is
+ * {@code null}-safe. If {@code null} is passed in, then empty list
+ * will be returned.
*
- * @param cp Copy flag.
- * @param t First element.
- * @param c Second collection.
- * @param <T> Element type.
- * @return Concatenated collection.
+ * @param vals Array of values
+ * @param <T> Array type.
+ * @return {@link List} instance for array.
*/
- public static <T> Collection<T> concat(boolean cp, @Nullable final T t, @Nullable final Collection<T> c) {
- if (cp) {
- if (isEmpty(c)) {
- Collection<T> l = new ArrayList<>(1);
+ public static <T> List<T> asList(@Nullable T... vals) {
+ return isEmpty(vals) ? Collections.<T>emptyList() : Arrays.asList(vals);
+ }
- l.add(t);
+ /**
+ * Creates new empty iterator.
+ *
+ * @param <T> Type of the iterator.
+ * @return Newly created empty iterator.
+ */
+ public static <T> GridIterator<T> emptyIterator() {
+ return new GridEmptyIterator<>();
+ }
- return l;
+ /**
+ * Flattens collection-of-collections and returns collection over the
+ * elements of the inner collections. This method doesn't create any
+ * new collections or copies any elements.
+ * <p>
+ * Note that due to non-copying nature of implementation, the
+ * {@link Collection#size() size()} method of resulting collection will have to
+ * iterate over all elements to produce size. Method {@link Collection#isEmpty() isEmpty()},
+ * however, is constant time and is much more preferable to use instead
+ * of {@code 'size()'} method when checking if list is not empty.
+ *
+ * @param c Input collection of collections.
+ * @param <T> Type of the inner collections.
+ * @return Iterable over the elements of the inner collections.
+ */
+ public static <T> Collection<T> flatCollections(@Nullable final Collection<? extends Collection<T>> c) {
+ if (F.isEmpty(c))
+ return Collections.emptyList();
+
+ return new GridSerializableCollection<T>() {
+ @NotNull
+ @Override public Iterator<T> iterator() {
+ return flat((Iterable<? extends Iterable<T>>)c);
}
- assert c != null;
+ @Override public int size() {
+ return F.size(iterator());
+ }
- Collection<T> ret = new ArrayList<>(c.size() + 1);
+ @Override public boolean isEmpty() {
+ return !iterator().hasNext();
+ }
+ };
+ }
- ret.add(t);
- ret.addAll(c);
+ /**
+ * Flattens iterable-of-iterables and returns iterable over the
+ * elements of the inner collections. This method doesn't create any
+ * new collections or copies any elements.
+ *
+ * @param c Input collection of collections.
+ * @param <T> Type of the inner collections.
+ * @return Iterable over the elements of the inner collections.
+ */
+ public static <T> GridIterator<T> flat(@Nullable final Iterable<? extends Iterable<T>> c) {
+ return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapter<T>() {
+ /** */
+ private Iterator<? extends Iterable<T>> a = c.iterator();
- return ret;
- }
- else {
- if (isEmpty(c))
- return Collections.singletonList(t);
+ /** */
+ private Iterator<T> b;
- assert c != null;
+ /** */
+ private boolean moved = true;
- return new GridSerializableCollection<T>() {
- @NotNull
- @Override public Iterator<T> iterator() {
- return new GridSerializableIterator<T>() {
- private Iterator<T> it;
+ /** */
+ private boolean more;
- @Override public boolean hasNext() {
- return it == null || it.hasNext();
- }
+ @Override public boolean hasNextX() {
+ if (!moved)
+ return more;
- @Nullable @Override public T next() {
- if (it == null) {
- it = c.iterator();
+ moved = false;
- return t;
- }
+ if (b != null && b.hasNext())
+ return more = true;
- return it.next();
- }
+ while (a.hasNext()) {
+ b = a.next().iterator();
- @Override public void remove() {
- throw new UnsupportedOperationException();
- }
- };
+ if (b.hasNext())
+ return more = true;
}
- @Override public int size() {
- return c.size() + 1;
- }
+ return more = false;
+ }
- @Override public boolean equals(Object obj) {
- return obj instanceof Collection && eqNotOrdered(this, (Collection)obj);
+ @Override public T nextX() {
+ if (hasNext()) {
+ moved = true;
+
+ return b.next();
}
- };
- }
+
+ throw new NoSuchElementException();
+ }
+
+ @Override public void removeX() {
+ assert b != null;
+
+ b.remove();
+ }
+ };
}
/**
- * Concatenates 2 collections into one. If {@code copy} flag is {@code true}, then
- * a new collection will be created and these collections will be copied into the
- * new one. The returned collection will be modifiable. If {@code copy} flag is
- * {@code false}, then a read-only view will be created over given collections
- * and no copying will happen.
+ * Flattens iterable-of-iterators and returns iterator over the
+ * elements of the inner collections. This method doesn't create any
+ * new collections or copies any elements.
*
- * @param cp Copy flag.
- * @param c1 First collection.
- * @param c2 Second collection.
- * @param <T> Element type.
- * @return Concatenated {@code non-null} collection.
+ * @param c Input iterable of iterators.
+ * @return Iterator over the elements of given iterators.
*/
- public static <T> Collection<T> concat(boolean cp, @Nullable final Collection<T> c1,
- @Nullable final Collection<T> c2) {
- if (cp) {
- if (isEmpty(c1) && isEmpty(c2))
- return new ArrayList<>(0);
+ public static <T> Iterator<T> flatIterators(@Nullable final Iterable<Iterator<T>> c) {
+ return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapter<T>() {
+ /** */
+ private Iterator<? extends Iterator<T>> a = c.iterator();
- if (isEmpty(c1))
- return new ArrayList<>(c2);
+ /** */
+ private Iterator<T> b;
- if (isEmpty(c2))
- return new ArrayList<>(c1);
+ /** */
+ private boolean moved = true;
- assert c1 != null && c2 != null;
+ /** */
+ private boolean more;
- Collection<T> c = new ArrayList<>(c1.size() + c2.size());
+ @Override public boolean hasNextX() {
+ if (!moved)
+ return more;
- c.addAll(c1);
- c.addAll(c2);
+ moved = false;
- return c;
- }
- else {
- if (isEmpty(c1) && isEmpty(c2))
- return Collections.emptyList();
+ if (b != null && b.hasNext())
+ return more = true;
- if (isEmpty(c1) || isEmpty(c2)) {
- Collection<T> c = isEmpty(c1) ? c2 : c1;
+ while (a.hasNext()) {
+ b = a.next();
- assert c != null;
+ if (b.hasNext())
+ return more = true;
+ }
- return c;
+ return more = false;
}
- assert c1 != null && c2 != null;
-
- return new GridSerializableCollection<T>() {
- @NotNull
- @Override public Iterator<T> iterator() {
- return new GridSerializableIterator<T>() {
- private Iterator<T> it1 = c1.iterator();
- private Iterator<T> it2 = c2.iterator();
-
- @Override public boolean hasNext() {
- if (it1 != null)
- if (!it1.hasNext())
- it1 = null;
- else
- return true;
-
- return it2.hasNext();
- }
-
- @Override public T next() {
- return it1 != null ? it1.next() : it2.next();
- }
+ @Override public T nextX() {
+ if (hasNext()) {
+ moved = true;
- @Override public void remove() {
- throw new UnsupportedOperationException();
- }
- };
+ return b.next();
}
- @Override public boolean contains(Object o) {
- return c1.contains(o) || c2.contains(o);
- }
+ throw new NoSuchElementException();
+ }
- @Override public int size() {
- return c1.size() + c2.size();
- }
+ @Override public void removeX() {
+ assert b != null;
- @Override public boolean equals(Object obj) {
- return obj instanceof Collection && eqNotOrdered(this, (Collection<?>)obj);
- }
- };
- }
+ b.remove();
+ }
+ };
}
/**
- * Concatenates an elements to an array.
+ * Converts given runnable to an absolute closure.
*
- * @param arr Array.
- * @param obj One or more elements.
- * @return Concatenated array.
+ * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
+ * @return Closure that wraps given runnable. Note that wrapping closure always returns {@code null}.
*/
- public static <T> T[] concat(@Nullable T[] arr, T... obj) {
- T[] newArr;
-
- if (arr == null || arr.length == 0)
- newArr = obj;
- else {
- newArr = Arrays.copyOf(arr, arr.length + obj.length);
-
- System.arraycopy(obj, 0, newArr, arr.length, obj.length);
- }
-
- return newArr;
- }
+ public static GridAbsClosure as(@Nullable final Runnable r) {
+ return new CA() {
+ @Override public void apply() {
+ if (r != null)
+ r.run();
+ }
+ };
+ }
/**
- * Concatenates multiple iterators as single one.
+ * Gets size of the given collection with provided optional predicates.
*
- * @param iters Iterators.
- * @return Single iterator.
+ * @param c Collection to size.
+ * @param p Optional predicates that filters out elements from count.
+ * @param <T> Type of the iterator.
+ * @return Number of elements in the collection for which all given predicates
+ * evaluates to {@code true}. If no predicates is provided - all elements are counted.
*/
- @SuppressWarnings("unchecked")
- public static <T> Iterator<T> concat(Iterator<T> ... iters) {
- if (iters.length == 1)
- return iters[0];
-
- return concat(asList(iters).iterator());
+ public static <T> int size(@Nullable Collection<? extends T> c, @Nullable IgnitePredicate<? super T>... p) {
+ return c == null || c.isEmpty() ? 0 : isEmpty(p) || isAlwaysTrue(p) ? c.size() : size(c.iterator(), p);
}
/**
- * Concatenates multiple iterators as single one.
+ * Gets size of the given iterator with provided optional predicates. Iterator
+ * will be traversed to get the count.
*
- * @param iters Iterator over iterators.
- * @return Single iterator.
+ * @param it Iterator to size.
+ * @param p Optional predicates that filters out elements from count.
+ * @param <T> Type of the iterator.
+ * @return Number of elements in the iterator for which all given predicates
+ * evaluates to {@code true}. If no predicates is provided - all elements are counted.
*/
- @SuppressWarnings("unchecked")
- public static <T> Iterator<T> concat(final Iterator<Iterator<T>> iters) {
- if (!iters.hasNext())
- return Collections.<T>emptySet().iterator();
-
- return new Iterator<T>() {
- privat
<TRUNCATED>
[04/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9a79e70a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9a79e70a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9a79e70a
Branch: refs/heads/ignite-gg-10186
Commit: 9a79e70a11eec1688968f33f99892b399b94254b
Parents: 03c54d8
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 21 17:02:23 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 21 17:02:23 2015 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheIoManager.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a79e70a/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 0df824f..957f3c8 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
@@ -302,12 +302,12 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
ctx.io().send(nodeId, res, ctx.ioPolicy());
}
catch (IgniteCheckedException e) {
- U.error(log, "Failed to send get response to node (is node still alive?) [nodeId=" + nodeId +
+ U.error(log, "Failed to send response to node (is node still alive?) [nodeId=" + nodeId +
",res=" + res + ']', e);
}
}
- private void processFailedMessage(UUID nodeId, GridCacheMessage msg) {
+ private void processFailedMessage(UUID nodeId, GridCacheMessage msg) throws IgniteCheckedException{
GridCacheContext ctx = cctx.cacheContext(msg.cacheId());
switch (msg.directType()) {
@@ -322,6 +322,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
break;
+
case 40: {
GridNearAtomicUpdateRequest req = (GridNearAtomicUpdateRequest)msg;
@@ -335,6 +336,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
break;
+
case 49: {
GridNearGetRequest req = (GridNearGetRequest)msg;
@@ -349,6 +351,10 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
break;
+
+ default:
+ throw new IgniteCheckedException("Failed to send response to node. Unsupported direct type [message="
+ + msg + "]");
}
}
[05/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0d982f76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0d982f76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0d982f76
Branch: refs/heads/ignite-gg-10186
Commit: 0d982f76671da38e74de80d69522c6f19d67c7ba
Parents: 9a79e70
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 23 15:01:03 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 23 15:01:03 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 37 ++++++--
.../IgniteCacheP2pUnmarshallingErrorTest.java | 3 +-
.../IgniteCacheP2pUnmarshallingErrorTxTest.java | 92 ++++++++++++++++++++
3 files changed, 125 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d982f76/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 957f3c8..b584b17 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
@@ -24,6 +24,7 @@ import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.managers.deployment.*;
import org.apache.ignite.internal.processors.affinity.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.util.*;
@@ -297,9 +298,9 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
}
- private void sendResponseOnFailedMessage(UUID nodeId, GridCacheMessage res, GridCacheContext ctx) {
+ private void sendResponseOnFailedMessage(UUID nodeId, GridCacheMessage res, GridCacheSharedContext cctx, GridIoPolicy plc) {
try {
- ctx.io().send(nodeId, res, ctx.ioPolicy());
+ cctx.io().send(nodeId, res, plc);
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to send response to node (is node still alive?) [nodeId=" + nodeId +
@@ -311,6 +312,18 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
GridCacheContext ctx = cctx.cacheContext(msg.cacheId());
switch (msg.directType()) {
+ case 34:{
+ GridDhtTxPrepareRequest req = (GridDhtTxPrepareRequest)msg;
+
+ GridDhtTxPrepareResponse res = new GridDhtTxPrepareResponse(req.version(), req.futureId(), req.miniId());
+
+ res.error(req.classError());
+
+ sendResponseOnFailedMessage(nodeId, res, cctx, req.policy());
+ }
+
+ break;
+
case 38: {
GridDhtAtomicUpdateRequest req = (GridDhtAtomicUpdateRequest)msg;
@@ -318,7 +331,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
res.onError(req.classError());
- sendResponseOnFailedMessage(nodeId, res, ctx);
+ sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
}
break;
@@ -332,7 +345,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
res.onError(req.classError());
- sendResponseOnFailedMessage(nodeId, res, ctx);
+ sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
}
break;
@@ -347,11 +360,25 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
res.error(req.classError());
- sendResponseOnFailedMessage(nodeId, res, ctx);
+ sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
}
break;
+ case 55: {
+ GridNearTxPrepareRequest req = (GridNearTxPrepareRequest)msg;
+
+ GridNearTxPrepareResponse res = new GridNearTxPrepareResponse(req.version(), req.futureId(),
+ req.miniId(), req.version(), null, null, null);
+
+ res.error(req.classError());
+
+ sendResponseOnFailedMessage(nodeId, res, cctx, req.policy());
+ }
+
+ break;
+
+
default:
throw new IgniteCheckedException("Failed to send response to node. Unsupported direct type [message="
+ msg + "]");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d982f76/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index 60f2226..7edbff2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -30,7 +30,7 @@ import java.util.concurrent.atomic.*;
*/
public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTest {
/** Allows to change behavior of readExternal method. */
- private static AtomicInteger readCnt = new AtomicInteger();
+ protected static AtomicInteger readCnt = new AtomicInteger();
/** {@inheritDoc} */
@Override protected int gridCount() {
@@ -136,7 +136,6 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
* Tests that correct response will be sent to client node in case of unmarshalling failed.
*/
public void testResponseMessageOnUnmarshallingFailed() {
-
//Checking failed unmarshalling on primary node.
readCnt.set(1);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d982f76/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
new file mode 100644
index 0000000..cb6d444
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.transactions.*;
+
+import java.io.*;
+
+/**
+ * Check behavior on exception while unmarshalling key.
+ */
+public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmarshallingErrorTest {
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+
+ /**
+ * Sends put with optimistic lock and handles fail.
+ */
+ protected void failOptimistic() {
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+
+ jcache(0).put(new TestKey("1"), "");
+
+ tx.commit();
+
+ assert false : "p2p marshalling failed, but error response was not sent";
+ }
+ catch (IgniteException e) {
+ assert X.hasCause(e, IOException.class);
+ }
+
+ assert readCnt.get() == 0; //ensure we have read counts as expected.
+ }
+
+ /**
+ * Sends put with pessimistic lock and handles fail.
+ */
+ protected void failPessimictic() {
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+
+ jcache(0).put(new TestKey("1"), "");
+
+ assert false : "p2p marshalling failed, but error response was not sent";
+ }
+ catch (IgniteException e) {
+ assert X.hasCause(e, IOException.class);
+ }
+
+ assert readCnt.get() == 0; //ensure we have read counts as expected.
+ }
+
+ /**
+ * Tests that correct response will be sent to client node in case of unmarshalling failed.
+ */
+ public void testResponseMessageOnUnmarshallingFailed() {
+// //GridNearTxPrepareRequest unmarshalling failed test
+// readCnt.set(2);
+//
+// failOptimistic();
+//
+// //GridDhtTxPrepareRequest unmarshalling failed test
+// readCnt.set(3);
+//
+// failOptimistic();
+
+// readCnt.set(1);
+//
+// failPessimictic();
+
+ }
+}
[50/50] [abbrv] incubator-ignite git commit: #ignite-286: Make cache
full api test work in OFFHEAP_TIERED mode.
Posted by sb...@apache.org.
#ignite-286: Make cache full api test work in OFFHEAP_TIERED mode.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/745cf7f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/745cf7f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/745cf7f9
Branch: refs/heads/ignite-gg-10186
Commit: 745cf7f9bd4ca8e649fa77fdfe4e9e3468ecaaa0
Parents: e8a38e0
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri May 8 12:15:29 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri May 8 12:15:29 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 26 ++-
.../cache/GridCacheEvictionManager.java | 2 +-
.../processors/cache/GridCacheProxyImpl.java | 24 --
.../processors/cache/GridCacheSwapManager.java | 215 +++++++++++++-----
.../processors/cache/IgniteInternalCache.java | 27 ---
.../colocated/GridDhtColocatedLockFuture.java | 2 +
.../distributed/near/GridNearCacheAdapter.java | 10 -
.../processors/cache/local/GridLocalCache.java | 8 +-
.../local/atomic/GridLocalAtomicCache.java | 27 ++-
.../cache/query/GridCacheQueryManager.java | 21 +-
.../transactions/IgniteTxLocalAdapter.java | 12 +-
.../offheap/GridOffHeapProcessor.java | 17 ++
.../util/offheap/GridOffHeapPartitionedMap.java | 9 +
.../unsafe/GridUnsafePartitionedMap.java | 155 ++++++-------
.../cache/GridCacheAbstractFullApiSelfTest.java | 227 +++++++++++--------
.../cache/GridCacheAbstractSelfTest.java | 4 +-
.../cache/OffHeapTieredTransactionSelfTest.java | 127 +++++++++++
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 43 ++++
...ionedNearDisabledOffHeapFullApiSelfTest.java | 8 +-
...DisabledOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...abledOffHeapTieredAtomicFullApiSelfTest.java | 56 +++++
...earDisabledOffHeapTieredFullApiSelfTest.java | 33 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...CacheAtomicOffHeapTieredFullApiSelfTest.java | 32 +++
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...yWriteOrderOffHeapTieredFullApiSelfTest.java | 33 +++
...erOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...achePartitionedMultiNodeFullApiSelfTest.java | 15 +-
...dCachePartitionedOffHeapFullApiSelfTest.java | 8 +-
...titionedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...PartitionedOffHeapTieredFullApiSelfTest.java | 32 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 72 ++++++
...idCacheReplicatedOffHeapFullApiSelfTest.java | 8 +-
...plicatedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...eReplicatedOffHeapTieredFullApiSelfTest.java | 33 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...LocalAtomicOffHeapTieredFullApiSelfTest.java | 32 +++
.../GridCacheLocalOffHeapFullApiSelfTest.java | 6 +-
...dCacheLocalOffHeapTieredFullApiSelfTest.java | 32 +++
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 +
.../IgniteCacheFullApiSelfTestSuite.java | 18 ++
...eQueryMultiThreadedOffHeapTiredSelfTest.java | 37 +++
.../IgniteCacheQueryMultiThreadedSelfTest.java | 29 ++-
.../IgniteCacheQuerySelfTestSuite.java | 1 +
44 files changed, 1231 insertions(+), 367 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 afddc79..3826bfa 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
@@ -2692,6 +2692,22 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override public void removeAll() throws IgniteCheckedException {
+ assert ctx.isLocal();
+
+ for (Iterator<KeyCacheObject> it = ctx.swap().offHeapKeyIterator(true, true, AffinityTopologyVersion.NONE);
+ it.hasNext(); )
+ remove((K)it.next());
+
+ for (Iterator<KeyCacheObject> it = ctx.swap().swapKeyIterator(true, true, AffinityTopologyVersion.NONE);
+ it.hasNext(); )
+ remove((K)it.next());
+
+ removeAll(keySet());
+ }
+
+ /** {@inheritDoc} */
@Override public void removeAll(final Collection<? extends K> keys) throws IgniteCheckedException {
boolean statsEnabled = ctx.config().isStatisticsEnabled();
@@ -3782,16 +3798,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException {
- return ctx.swap().lazySwapIterator();
- }
-
- /** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException {
- return ctx.swap().lazyOffHeapIterator();
- }
-
- /** {@inheritDoc} */
@Override public long offHeapEntriesCount() {
return ctx.swap().offHeapEntriesCount();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 9135c16..d565af1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -751,7 +751,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
U.error(log, "Failed to evict entry from cache: " + e, ex);
}
- if (memoryMode == OFFHEAP_TIERED) {
+ if (!cctx.isNear() && memoryMode == OFFHEAP_TIERED) {
try {
evict0(cctx.cache(), e, cctx.versions().next(), null, false);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 5487944..55d2f84 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
@@ -1390,30 +1390,6 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.swapIterator();
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.offHeapIterator();
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
@Override public long offHeapEntriesCount() {
CacheOperationContext prev = gate.enter(opCtx);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 6444e37..eb82218 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
@@ -1211,10 +1211,10 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
checkIteratorQueue();
if (offHeapEnabled() && !swapEnabled())
- return rawOffHeapIterator();
+ return rawOffHeapIterator(true, true);
if (swapEnabled() && !offHeapEnabled())
- return rawSwapIterator();
+ return rawSwapIterator(true, true);
// Both, swap and off-heap are enabled.
return new GridCloseableIteratorAdapter<Map.Entry<byte[], byte[]>>() {
@@ -1227,7 +1227,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
private Map.Entry<byte[], byte[]> cur;
{
- it = rawOffHeapIterator();
+ it = rawOffHeapIterator(true, true);
advance();
}
@@ -1241,7 +1241,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
if (offheapFlag) {
offheapFlag = false;
- it = rawSwapIterator();
+ it = rawSwapIterator(true, true);
if (!it.hasNext()) {
it.close();
@@ -1313,7 +1313,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), topVer) :
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
- return new PartitionsKeyIterator(parts) {
+ return new PartitionsAbstractIterator<KeyCacheObject>(parts) {
@Override protected Iterator<KeyCacheObject> partitionIterator(int part)
throws IgniteCheckedException
{
@@ -1338,7 +1338,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), topVer) :
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
- return new PartitionsKeyIterator(parts) {
+ return new PartitionsAbstractIterator<KeyCacheObject>(parts) {
@Override protected Iterator<KeyCacheObject> partitionIterator(int part)
throws IgniteCheckedException
{
@@ -1554,37 +1554,91 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
* @param c Key/value closure.
+ * @param primary Include primaries.
+ * @param backup Include backups.
* @return Off-heap iterator.
*/
- public <T> GridCloseableIterator<T> rawOffHeapIterator(CX2<T2<Long, Integer>, T2<Long, Integer>, T> c) {
+ public <T> GridCloseableIterator<T> rawOffHeapIterator(final CX2<T2<Long, Integer>, T2<Long, Integer>, T> c,
+ boolean primary,
+ boolean backup)
+ {
assert c != null;
- if (!offheapEnabled)
+ if (!offheapEnabled || (!primary && !backup))
return new GridEmptyCloseableIterator<>();
checkIteratorQueue();
- return offheap.iterator(spaceName, c);
+ if (primary && backup)
+ return offheap.iterator(spaceName, c);
+
+ AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
+
+ Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+
+ return new CloseablePartitionsIterator<T, T>(parts) {
+ @Override protected GridCloseableIterator<T> partitionIterator(int part)
+ throws IgniteCheckedException
+ {
+ return offheap.iterator(spaceName, c, part);
+ }
+ };
}
/**
+ * @param primary Include primaries.
+ * @param backup Include backups.
* @return Raw off-heap iterator.
*/
- public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawOffHeapIterator() {
- if (!offheapEnabled)
+ public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawOffHeapIterator(final boolean primary,
+ final boolean backup)
+ {
+ if (!offheapEnabled || (!primary && !backup))
return new GridEmptyCloseableIterator<>();
- return new GridCloseableIteratorAdapter<Map.Entry<byte[], byte[]>>() {
- private GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> it = offheap.iterator(spaceName);
+ if (primary && backup)
+ return new GridCloseableIteratorAdapter<Map.Entry<byte[], byte[]>>() {
+ private GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> it = offheap.iterator(spaceName);
+
+ private Map.Entry<byte[], byte[]> cur;
+
+ @Override protected Map.Entry<byte[], byte[]> onNext() {
+ return cur = it.next();
+ }
+
+ @Override protected boolean onHasNext() {
+ return it.hasNext();
+ }
+
+ @Override protected void onRemove() throws IgniteCheckedException {
+ KeyCacheObject key = cctx.toCacheKeyObject(cur.getKey());
+
+ int part = cctx.affinity().partition(key);
+
+ offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ }
+
+ @Override protected void onClose() throws IgniteCheckedException {
+ it.close();
+ }
+ };
+ AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
+
+ Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+
+ return new CloseablePartitionsIterator<Map.Entry<byte[], byte[]>, IgniteBiTuple<byte[], byte[]>>(parts) {
private Map.Entry<byte[], byte[]> cur;
@Override protected Map.Entry<byte[], byte[]> onNext() {
- return cur = it.next();
+ return cur = super.onNext();
}
- @Override protected boolean onHasNext() {
- return it.hasNext();
+ @Override protected GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> partitionIterator(int part)
+ throws IgniteCheckedException {
+ return offheap.iterator(spaceName, part);
}
@Override protected void onRemove() throws IgniteCheckedException {
@@ -1594,10 +1648,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
}
-
- @Override protected void onClose() throws IgniteCheckedException {
- it.close();
- }
};
}
@@ -1621,15 +1671,33 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
* @return Raw off-heap iterator.
+ * @param primary Include primaries.
+ * @param backup Include backups.
* @throws IgniteCheckedException If failed.
*/
- public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawSwapIterator() throws IgniteCheckedException {
- if (!swapEnabled)
+ public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawSwapIterator(boolean primary, boolean backup)
+ throws IgniteCheckedException
+ {
+ if (!swapEnabled || (!primary && !backup))
return new GridEmptyCloseableIterator<>();
checkIteratorQueue();
- return swapMgr.rawIterator(spaceName);
+ if (primary && backup)
+ return swapMgr.rawIterator(spaceName);
+
+ AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
+
+ Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+
+ return new CloseablePartitionsIterator<Map.Entry<byte[], byte[]>, Map.Entry<byte[], byte[]>>(parts) {
+ @Override protected GridCloseableIterator<Map.Entry<byte[], byte[]>> partitionIterator(int part)
+ throws IgniteCheckedException
+ {
+ return swapMgr.rawIterator(spaceName, part);
+ }
+ };
}
/**
@@ -1654,7 +1722,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
return new PartitionsIterator<K, V>(parts) {
- @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> partitionIterator(int part)
+ @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part)
throws IgniteCheckedException
{
return swapMgr.rawIterator(spaceName, part);
@@ -1669,7 +1737,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Offheap entries iterator.
* @throws IgniteCheckedException If failed.
*/
- public <K, V> Iterator<Cache.Entry<K, V>> offheapIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer)
+ public <K, V> Iterator<Cache.Entry<K, V>> offheapIterator(boolean primary,
+ boolean backup,
+ AffinityTopologyVersion topVer)
throws IgniteCheckedException
{
assert primary || backup;
@@ -1684,7 +1754,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
return new PartitionsIterator<K, V>(parts) {
- @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> partitionIterator(int part) {
+ @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part) {
return offheap.iterator(spaceName, part);
}
};
@@ -1884,20 +1954,46 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
*
*/
- private abstract class PartitionsIterator<K, V> implements Iterator<Cache.Entry<K, V>> {
+ private abstract class PartitionsIterator<K, V> extends PartitionsAbstractIterator<Cache.Entry<K, V>> {
+ /**
+ * @param parts Partitions
+ */
+ public PartitionsIterator(Collection<Integer> parts) {
+ super(parts);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Iterator<Cache.Entry<K, V>> partitionIterator(int part)
+ throws IgniteCheckedException {
+ return cacheEntryIterator(GridCacheSwapManager.this.<K, V>lazyIterator(nextPartition(part)));
+ }
+
+ /**
+ * @param part Partition.
+ * @return Iterator for given partition.
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part)
+ throws IgniteCheckedException;
+ }
+
+ /**
+ *
+ */
+ private abstract class PartitionsAbstractIterator<T> implements Iterator<T> {
/** */
private Iterator<Integer> partIt;
/** */
- private Iterator<Cache.Entry<K, V>> curIt;
+ private Iterator<T> curIt;
/** */
- private Cache.Entry<K, V> next;
+ private T next;
/**
* @param parts Partitions
*/
- public PartitionsIterator(Collection<Integer> parts) {
+ public PartitionsAbstractIterator(Collection<Integer> parts) {
this.partIt = parts.iterator();
advance();
@@ -1909,11 +2005,11 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/** {@inheritDoc} */
- @Override public Cache.Entry<K, V> next() {
+ @Override public T next() {
if (next == null)
throw new NoSuchElementException();
- Cache.Entry<K, V> e = next;
+ T e = next;
advance();
@@ -1937,8 +2033,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = partIt.next();
try {
- curIt = cacheEntryIterator(
- GridCacheSwapManager.this.<K, V>lazyIterator(partitionIterator(part)));
+ curIt = partitionIterator(part);
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -1964,58 +2059,70 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Iterator for given partition.
* @throws IgniteCheckedException If failed.
*/
- abstract protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> partitionIterator(int part)
+ abstract protected Iterator<T> partitionIterator(int part)
throws IgniteCheckedException;
}
/**
*
*/
- private abstract class PartitionsKeyIterator implements Iterator<KeyCacheObject> {
+ private abstract class CloseablePartitionsIterator<T, T1 extends T> extends GridCloseableIteratorAdapter<T> {
/** */
private Iterator<Integer> partIt;
/** */
- private Iterator<KeyCacheObject> curIt;
+ protected GridCloseableIterator<T1> curIt;
/** */
- private KeyCacheObject next;
+ protected T next;
/**
* @param parts Partitions
*/
- public PartitionsKeyIterator(Collection<Integer> parts) {
+ public CloseablePartitionsIterator(Collection<Integer> parts) {
this.partIt = parts.iterator();
- advance();
+ try {
+ advance();
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
/** {@inheritDoc} */
- @Override public boolean hasNext() {
+ @Override protected boolean onHasNext() {
return next != null;
}
/** {@inheritDoc} */
- @Override public KeyCacheObject next() {
- if (next == null)
- throw new NoSuchElementException();
+ @Override protected T onNext() {
+ try {
+ if (next == null)
+ throw new NoSuchElementException();
- KeyCacheObject e = next;
+ T e = next;
- advance();
+ advance();
- return e;
+ return e;
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
/** {@inheritDoc} */
- @Override public void remove() {
- throw new UnsupportedOperationException();
+ @Override protected void onClose() throws IgniteCheckedException {
+ if (curIt != null)
+ curIt.close();
}
/**
* Switches to next element.
+ * @throws IgniteCheckedException If failed.
*/
- private void advance() {
+ private void advance() throws IgniteCheckedException {
next = null;
do {
@@ -2038,8 +2145,11 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
break;
}
- else
+ else {
+ curIt.close();
+
curIt = null;
+ }
}
}
while (partIt.hasNext());
@@ -2050,7 +2160,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Iterator for given partition.
* @throws IgniteCheckedException If failed.
*/
- abstract protected Iterator<KeyCacheObject> partitionIterator(int part)
- throws IgniteCheckedException;
+ abstract protected GridCloseableIterator<T1> partitionIterator(int part) throws IgniteCheckedException;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index fe371ce..5184115 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1451,33 +1451,6 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public long swapKeys() throws IgniteCheckedException;
/**
- * Gets iterator over keys and values belonging to this cache swap space on local node. This
- * iterator is thread-safe, which means that cache (and therefore its swap space)
- * may be modified concurrently with iteration over swap.
- * <p>
- * Returned iterator supports {@code remove} operation which delegates to
- * <code>removex(Object, org.apache.ignite.lang.IgnitePredicate[])</code> method.
- *
- * @return Iterator over keys.
- * @throws IgniteCheckedException If failed.
- */
- public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException;
-
- /**
- * Gets iterator over keys and values belonging to this cache off-heap memory on local node. This
- * iterator is thread-safe, which means that cache (and therefore its off-heap memory)
- * may be modified concurrently with iteration over off-heap. To achieve better performance
- * the keys and values deserialized on demand, whenever accessed.
- * <p>
- * Returned iterator supports {@code remove} operation which delegates to
- * <code>removex(Object, org.apache.ignite.lang.IgnitePredicate[])}</code> method.
- *
- * @return Iterator over keys.
- * @throws IgniteCheckedException If failed.
- */
- public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException;
-
- /**
* Forces this cache node to re-balance its partitions. This method is usually used when
* {@link CacheConfiguration#getRebalanceDelay()} configuration parameter has non-zero value.
* When many nodes are started or stopped almost concurrently, it is more efficient to delay
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 5b74b31..f10baa3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -786,6 +786,8 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
catch (GridCacheEntryRemovedException ignored) {
if (log.isDebugEnabled())
log.debug("Got removed entry in lockAsync(..) method (will retry): " + entry);
+
+ entry = null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 29c1d45..145e980 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -436,16 +436,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
}
/** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException {
- return dht().swapIterator();
- }
-
- /** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException {
- return dht().offHeapIterator();
- }
-
- /** {@inheritDoc} */
@Override public long offHeapEntriesCount() {
return dht().offHeapEntriesCount();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
index fae2372..6120e25 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
@@ -146,6 +146,8 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> {
try {
entry = entryExx(key);
+ entry.unswap(false);
+
if (!ctx.isAll(entry, filter)) {
fut.onFailed();
@@ -200,12 +202,6 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> {
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public void removeAll() throws IgniteCheckedException {
- removeAll(keySet());
- }
-
- /** {@inheritDoc} */
@Override public IgniteInternalFuture<?> removeAllAsync() {
return ctx.closures().callLocalSafe(new Callable<Void>() {
@Override public Void call() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 936ed9d..819b0f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -387,12 +387,6 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public void removeAll() throws IgniteCheckedException {
- removeAll(keySet());
- }
-
- /** {@inheritDoc} */
@Override public IgniteInternalFuture<?> removeAllAsync() {
return ctx.closures().callLocalSafe(new Callable<Void>() {
@Override public Void call() throws Exception {
@@ -1374,16 +1368,24 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
private List<GridCacheEntryEx> lockEntries(Collection<? extends K> keys) {
List<GridCacheEntryEx> locked = new ArrayList<>(keys.size());
+ boolean nullKeys = false;
+
while (true) {
for (K key : keys) {
- if (key == null)
- throw new NullPointerException("Null key.");
+ if (key == null) {
+ nullKeys = true;
+
+ break;
+ }
GridCacheEntryEx entry = entryEx(ctx.toCacheKeyObject(key));
locked.add(entry);
}
+ if (nullKeys)
+ break;
+
for (int i = 0; i < locked.size(); i++) {
GridCacheEntryEx entry = locked.get(i);
@@ -1405,6 +1407,15 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
if (!locked.isEmpty())
return locked;
}
+
+ assert nullKeys;
+
+ AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
+
+ for (GridCacheEntryEx entry : locked)
+ ctx.evicts().touch(entry, topVer);
+
+ throw new NullPointerException("Null key.");
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index d3ebe60..16a8028 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -766,13 +766,14 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
final ExpiryPolicy plc = cctx.expiry();
+ final boolean backups = qry.includeBackups() || cctx.isReplicated();
+
final GridCloseableIteratorAdapter<IgniteBiTuple<K, V>> heapIt = new GridCloseableIteratorAdapter<IgniteBiTuple<K, V>>() {
private IgniteBiTuple<K, V> next;
private IgniteCacheExpiryPolicy expiryPlc = cctx.cache().expiryPolicy(plc);
- private Iterator<K> iter = qry.includeBackups() || cctx.isReplicated() ?
- prj.keySet().iterator() : prj.primaryKeySet().iterator();
+ private Iterator<K> iter = backups ? prj.keySet().iterator() : prj.primaryKeySet().iterator();
{
advance();
@@ -868,10 +869,10 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
iters.add(heapIt);
if (cctx.isOffHeapEnabled())
- iters.add(offheapIterator(qry));
+ iters.add(offheapIterator(qry, backups));
if (cctx.swap().swapEnabled())
- iters.add(swapIterator(qry));
+ iters.add(swapIterator(qry, backups));
it = new CompoundIterator<>(iters);
}
@@ -905,32 +906,34 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
/**
* @param qry Query.
+ * @param backups Include backups.
* @return Swap iterator.
* @throws IgniteCheckedException If failed.
*/
- private GridIterator<IgniteBiTuple<K, V>> swapIterator(GridCacheQueryAdapter<?> qry)
+ private GridIterator<IgniteBiTuple<K, V>> swapIterator(GridCacheQueryAdapter<?> qry, boolean backups)
throws IgniteCheckedException {
IgniteBiPredicate<K, V> filter = qry.scanFilter();
- Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawSwapIterator();
+ Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawSwapIterator(true, backups);
return scanIterator(it, filter, qry.keepPortable());
}
/**
* @param qry Query.
+ * @param backups Include backups.
* @return Offheap iterator.
*/
- private GridIterator<IgniteBiTuple<K, V>> offheapIterator(GridCacheQueryAdapter<?> qry) {
+ private GridIterator<IgniteBiTuple<K, V>> offheapIterator(GridCacheQueryAdapter<?> qry, boolean backups) {
IgniteBiPredicate<K, V> filter = qry.scanFilter();
if (cctx.offheapTiered() && filter != null) {
OffheapIteratorClosure c = new OffheapIteratorClosure(filter, qry.keepPortable());
- return cctx.swap().rawOffHeapIterator(c);
+ return cctx.swap().rawOffHeapIterator(c, true, backups);
}
else {
- Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator();
+ Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator(true, backups);
return scanIterator(it, filter, qry.keepPortable());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index fc3efba..3c855ec 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
@@ -2040,7 +2040,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
for (Object key : keys) {
if (key == null) {
- setRollbackOnly();
+ rollback();
throw new NullPointerException("Null key.");
}
@@ -2191,7 +2191,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
drVer,
skipStore);
- if (!implicit() && readCommitted())
+ if (!implicit() && readCommitted() && !cacheCtx.offheapTiered())
cacheCtx.evicts().touch(entry, topologyVersion());
if (groupLock() && !lockOnly)
@@ -2934,19 +2934,17 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
assert loadFut.isDone();
return nonInterruptable(commitAsync().chain(new CX1<IgniteInternalFuture<IgniteInternalTx>, GridCacheReturn>() {
- @Override
- public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut)
+ @Override public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut)
throws IgniteCheckedException {
txFut.get();
- return (GridCacheReturn)implicitRes;
+ return implicitRes;
}
}));
}
else
return nonInterruptable(loadFut.chain(new CX1<IgniteInternalFuture<Set<KeyCacheObject>>, GridCacheReturn>() {
- @Override
- public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f)
+ @Override public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f)
throws IgniteCheckedException {
f.get();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
index ebedadb..a99c4c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
@@ -293,6 +293,23 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
}
/**
+ * Gets iterator over contents of the given space.
+ *
+ * @param spaceName Space name.
+ * @param c Key/value closure.
+ * @param part Partition.
+ * @return Iterator.
+ */
+ public <T> GridCloseableIterator<T> iterator(@Nullable String spaceName,
+ CX2<T2<Long, Integer>, T2<Long, Integer>, T> c, int part) {
+ assert c != null;
+
+ GridOffHeapPartitionedMap m = offheap(spaceName);
+
+ return m == null ? new GridEmptyCloseableIterator<T>() : m.iterator(c, part);
+ }
+
+ /**
* Gets number of elements in the given space.
*
* @param spaceName Space name. Optional.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
index 49850ab..a945262 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
@@ -201,6 +201,15 @@ public interface GridOffHeapPartitionedMap {
public <T> GridCloseableIterator<T> iterator(CX2<T2<Long, Integer>, T2<Long, Integer>, T> c);
/**
+ * Gets iterator over the partition.
+ *
+ * @param c Key/value closure.
+ * @param part Partition.
+ * @return Iterator over the partition.
+ */
+ public <T> GridCloseableIterator<T> iterator(CX2<T2<Long, Integer>, T2<Long, Integer>, T> c, int part);
+
+ /**
* Gets iterator over certain partition.
*
* @param p Partition.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
index ba67b30..4ffc33f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
@@ -277,21 +277,8 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
/** {@inheritDoc} */
@Override public GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> iterator() {
- return new GridCloseableIteratorAdapter<IgniteBiTuple<byte[], byte[]>>() {
- private int p;
-
- private GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> curIt;
-
- {
- try {
- advance();
- }
- catch (IgniteCheckedException e) {
- e.printStackTrace(); // Should never happen.
- }
- }
-
- private void advance() throws IgniteCheckedException {
+ return new PartitionedMapCloseableIterator<IgniteBiTuple<byte[], byte[]>>() {
+ protected void advance() throws IgniteCheckedException {
curIt = null;
while (p < parts) {
@@ -305,34 +292,6 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
curIt = null;
}
-
- @Override protected IgniteBiTuple<byte[], byte[]> onNext() throws IgniteCheckedException {
- if (curIt == null)
- throw new NoSuchElementException();
-
- IgniteBiTuple<byte[], byte[]> t = curIt.next();
-
- if (!curIt.hasNext()) {
- curIt.close();
-
- advance();
- }
-
- return t;
- }
-
- @Override protected boolean onHasNext() {
- return curIt != null;
- }
-
- @Override protected void onRemove() {
- throw new UnsupportedOperationException();
- }
-
- @Override protected void onClose() throws IgniteCheckedException {
- if (curIt != null)
- curIt.close();
- }
};
}
@@ -340,21 +299,8 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
@Override public <T> GridCloseableIterator<T> iterator(final CX2<T2<Long, Integer>, T2<Long, Integer>, T> c) {
assert c != null;
- return new GridCloseableIteratorAdapter<T>() {
- private int p;
-
- private GridCloseableIterator<T> curIt;
-
- {
- try {
- advance();
- }
- catch (IgniteCheckedException e) {
- e.printStackTrace(); // Should never happen.
- }
- }
-
- private void advance() throws IgniteCheckedException {
+ return new PartitionedMapCloseableIterator<T>() {
+ protected void advance() throws IgniteCheckedException {
curIt = null;
while (p < parts) {
@@ -368,38 +314,16 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
curIt = null;
}
-
- @Override protected T onNext() throws IgniteCheckedException {
- if (curIt == null)
- throw new NoSuchElementException();
-
- T t = curIt.next();
-
- if (!curIt.hasNext()) {
- curIt.close();
-
- advance();
- }
-
- return t;
- }
-
- @Override protected boolean onHasNext() {
- return curIt != null;
- }
-
- @Override protected void onRemove() {
- throw new UnsupportedOperationException();
- }
-
- @Override protected void onClose() throws IgniteCheckedException {
- if (curIt != null)
- curIt.close();
- }
};
}
/** {@inheritDoc} */
+ @Override public <T> GridCloseableIterator<T> iterator(final CX2<T2<Long, Integer>, T2<Long, Integer>, T> c,
+ int part) {
+ return mapFor(part).iterator(c);
+ }
+
+ /** {@inheritDoc} */
@Override public GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> iterator(int p) {
return mapFor(p).iterator();
}
@@ -430,4 +354,63 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
public long lruSize() {
return lru.size();
}
+
+ /**
+ * Partitioned closable iterator.
+ */
+ private abstract class PartitionedMapCloseableIterator<T> extends GridCloseableIteratorAdapter<T> {
+ /** Current partition. */
+ protected int p;
+
+ /** Current iterator. */
+ protected GridCloseableIterator<T> curIt;
+
+ {
+ try {
+ advance();
+ }
+ catch (IgniteCheckedException e) {
+ e.printStackTrace(); // Should never happen.
+ }
+ }
+
+ /**
+ * Switch to next partition.
+ *
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract void advance() throws IgniteCheckedException;
+
+ /** {@inheritDoc} */
+ @Override protected T onNext() throws IgniteCheckedException {
+ if (curIt == null)
+ throw new NoSuchElementException();
+
+ T t = curIt.next();
+
+ if (!curIt.hasNext()) {
+ curIt.close();
+
+ advance();
+ }
+
+ return t;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean onHasNext() {
+ return curIt != null;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void onRemove() {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void onClose() throws IgniteCheckedException {
+ if (curIt != null)
+ curIt.close();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 4dc371c..70d8f9c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -50,6 +50,7 @@ import static java.util.concurrent.TimeUnit.*;
import static org.apache.ignite.cache.CacheAtomicityMode.*;
import static org.apache.ignite.cache.CacheMemoryMode.*;
import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CachePeekMode.*;
import static org.apache.ignite.events.EventType.*;
import static org.apache.ignite.testframework.GridTestUtils.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
@@ -121,15 +122,15 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
/**
* @return {@code True} if values should be stored off-heap.
*/
- protected boolean offHeapValues() {
- return false;
+ protected CacheMemoryMode memoryMode() {
+ return ONHEAP_TIERED;
}
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- if (offHeapValues())
+ if (memoryMode() == OFFHEAP_TIERED || memoryMode() == OFFHEAP_VALUES)
cfg.setSwapSpaceSpi(new GridTestSwapSpaceSpi());
return cfg;
@@ -139,8 +140,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
@Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(gridName);
- if (offHeapValues()) {
- ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_VALUES);
+ if (memoryMode() == OFFHEAP_TIERED || memoryMode() == OFFHEAP_VALUES) {
+ ccfg.setMemoryMode(memoryMode());
ccfg.setOffHeapMaxMemory(0);
}
@@ -272,7 +273,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
// Will actually delete entry from map.
CU.invalidate(jcache(i), "key0");
- assertNull("Failed check for grid: " + i, jcache(i).localPeek("key0", CachePeekMode.ONHEAP));
+ assertNull("Failed check for grid: " + i, jcache(i).localPeek("key0", ONHEAP));
Collection<String> keysCol = mapped.get(grid(i).localNode());
@@ -288,20 +289,20 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (ctx.affinity().localNode(key, new AffinityTopologyVersion(ctx.discovery().topologyVersion())))
sum++;
- assertEquals("Incorrect key size on cache #" + i, sum, jcache(i).localSize(CachePeekMode.ALL));
+ assertEquals("Incorrect key size on cache #" + i, sum, jcache(i).localSize(ALL));
}
for (int i = 0; i < gridCount(); i++) {
Collection<String> keysCol = mapped.get(grid(i).localNode());
assertEquals("Failed check for grid: " + i, !F.isEmpty(keysCol) ? keysCol.size() : 0,
- jcache(i).localSize(CachePeekMode.PRIMARY));
+ jcache(i).localSize(PRIMARY));
}
int globalPrimarySize = map.size();
for (int i = 0; i < gridCount(); i++)
- assertEquals(globalPrimarySize, jcache(i).size(CachePeekMode.PRIMARY));
+ assertEquals(globalPrimarySize, jcache(i).size(PRIMARY));
int times = 1;
@@ -313,7 +314,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
int globalSize = globalPrimarySize * times;
for (int i = 0; i < gridCount(); i++)
- assertEquals(globalSize, jcache(i).size(CachePeekMode.ALL));
+ assertEquals(globalSize, jcache(i).size(ALL));
}
/**
@@ -735,7 +736,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", ONHEAP));
cache.remove("key1");
cache.put("key2", 1);
@@ -750,7 +751,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
/**
@@ -789,7 +790,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", ONHEAP));
cache.remove("key1");
cache.put("key2", 1);
@@ -804,7 +805,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
/**
@@ -874,9 +875,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Map<String, EntryProcessorResult<String>> res = cache.invokeAll(F.asSet("key1", "key2", "key3"), RMV_PROCESSOR);
for (int i = 0; i < gridCount(); i++) {
- assertNull(jcache(i).localPeek("key1", CachePeekMode.ONHEAP));
- assertNull(jcache(i).localPeek("key2", CachePeekMode.ONHEAP));
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key1", ONHEAP));
+ assertNull(jcache(i).localPeek("key2", ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
assertEquals("null", res.get("key1").get());
@@ -1232,7 +1233,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
/**
@@ -1271,7 +1272,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("k1"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("k1", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("k1", ONHEAP));
final EntryProcessor<String, Integer, Integer> errProcessor = new EntryProcessor<String, Integer, Integer>() {
@Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
@@ -1692,7 +1693,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < gridCount(); i++) {
info("Peek on node [i=" + i + ", id=" + grid(i).localNode().id() + ", val=" +
- grid(i).cache(null).localPeek("key", CachePeekMode.ONHEAP) + ']');
+ grid(i).cache(null).localPeek("key", ONHEAP) + ']');
}
assertEquals((Integer)1, cache.getAndPutIfAbsent("key", 2));
@@ -2001,10 +2002,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < gridCount(); i++) {
info("Peek key on grid [i=" + i + ", nodeId=" + grid(i).localNode().id() +
- ", peekVal=" + grid(i).cache(null).localPeek("key", CachePeekMode.ONHEAP) + ']');
+ ", peekVal=" + grid(i).cache(null).localPeek("key", ONHEAP) + ']');
info("Peek key2 on grid [i=" + i + ", nodeId=" + grid(i).localNode().id() +
- ", peekVal=" + grid(i).cache(null).localPeek("key2", CachePeekMode.ONHEAP) + ']');
+ ", peekVal=" + grid(i).cache(null).localPeek("key2", ONHEAP) + ']');
}
assertEquals((Integer)6, cache.get("key2"));
@@ -2233,7 +2234,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testDeletedEntriesFlag() throws Exception {
- if (cacheMode() != LOCAL && cacheMode() != REPLICATED) {
+ if (cacheMode() != LOCAL && cacheMode() != REPLICATED && memoryMode() != OFFHEAP_TIERED) {
int cnt = 3;
IgniteCache<String, Integer> cache = jcache();
@@ -2288,9 +2289,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
String key = String.valueOf(i);
if (grid(0).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(g).localNode()))
- assertEquals((Integer)i, jcache(g).localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals((Integer)i, peek(jcache(g), key));
else
- assertNull(jcache(g).localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(peek(jcache(g), key));
}
}
}
@@ -2475,6 +2476,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
}, NullPointerException.class, null);
+ assertEquals(0, grid(0).cache(null).localSize());
+
GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
cache.removeAll(null);
@@ -2569,7 +2572,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Set<String> keys = new HashSet<>(primaryKeysForCache(cache, 2));
for (String key : keys)
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(cache.localPeek(key, ONHEAP));
Map<String, Integer> vals = new HashMap<>();
@@ -2584,17 +2587,17 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
for (String key : keys)
- assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(vals.get(key), peek(cache, key));
cache.clear();
for (String key : keys)
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(peek(cache, key));
loadAll(cache, keys, true);
for (String key : keys)
- assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(vals.get(key), peek(cache, key));
}
/**
@@ -2703,7 +2706,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
try {
cache.clear();
- assertEquals(vals.get(first), peek(cache, first));
+ assertEquals(vals.get(first), cache.localPeek(first, ONHEAP));
}
finally {
lock.unlock();
@@ -2734,14 +2737,14 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.localEvict(Sets.union(ImmutableSet.of("key1", "key2"), keys));
- assert cache.localSize(CachePeekMode.ONHEAP) == 0;
+ assert cache.localSize(ONHEAP) == 0;
cache.clear();
cache.localPromote(ImmutableSet.of("key2", "key1"));
- assert cache.localPeek("key1", CachePeekMode.ONHEAP) == null;
- assert cache.localPeek("key2", CachePeekMode.ONHEAP) == null;
+ assert cache.localPeek("key1", ONHEAP) == null;
+ assert cache.localPeek("key2", ONHEAP) == null;
}
/**
@@ -2906,13 +2909,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Ignite ignite = primaryIgnite("key");
IgniteCache<String, Integer> cache = ignite.cache(null);
- assert cache.localPeek("key", CachePeekMode.ONHEAP) == null;
+ assert peek(cache, "key") == null;
cache.put("key", 1);
cache.replace("key", 2);
- assert cache.localPeek("key", CachePeekMode.ONHEAP) == 2;
+ assertEquals(2, peek(cache, "key").intValue());
}
/**
@@ -2944,7 +2947,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.remove("key");
assertNull(cache.get("key")); // localPeek ignores transactions.
- assertNotNull(cache.localPeek("key")); // localPeek ignores transactions.
+ assertNotNull(peek(cache, "key")); // localPeek ignores transactions.
tx.commit();
}
@@ -2960,7 +2963,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put("key", 1);
cache.remove("key");
- assertNull(cache.localPeek("key", CachePeekMode.ONHEAP));
+ assertNull(peek(cache, "key"));
}
/**
@@ -2986,11 +2989,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
// Expired entry should not be swapped.
cache.localEvict(Collections.singleton(key));
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(peek(cache, "key"));
cache.localPromote(Collections.singleton(key));
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(cache.localPeek(key, ONHEAP));
assertTrue(cache.localSize() == 0);
@@ -3021,7 +3024,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
c.put(key, 1);
- assertEquals(Integer.valueOf(1), c.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(Integer.valueOf(1), peek(c, key));
int ttl = 500;
@@ -3031,7 +3034,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Thread.sleep(ttl + 100);
- assert c.localPeek(key, CachePeekMode.ONHEAP) == null;
+ assert peek(c, key) == null;
assert c.localSize() == 0 : "Cache is not empty.";
}
@@ -3058,7 +3061,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Thread.sleep(ttl + 100);
- assertNull(c.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(c.localPeek(key, ONHEAP));
assert c.localSize() == 0;
}
@@ -3092,6 +3095,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
private void checkTtl(boolean inTx, boolean oldEntry) throws Exception {
+ if (memoryMode() == OFFHEAP_TIERED)
+ return;
+
int ttl = 1000;
final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(MILLISECONDS, ttl));
@@ -3361,15 +3367,15 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put(key2, 2);
cache.put(key3, 3);
- assert cache.localPeek(key1, CachePeekMode.ONHEAP) == 1;
- assert cache.localPeek(key2, CachePeekMode.ONHEAP) == 2;
- assert cache.localPeek(key3, CachePeekMode.ONHEAP) == 3;
+ assert peek(cache, key1) == 1;
+ assert peek(cache, key2) == 2;
+ assert peek(cache, key3) == 3;
cache.localEvict(F.asList(key1, key2));
- assert cache.localPeek(key1, CachePeekMode.ONHEAP) == null;
- assert cache.localPeek(key2, CachePeekMode.ONHEAP) == null;
- assert cache.localPeek(key3, CachePeekMode.ONHEAP) == 3;
+ assert cache.localPeek(key1, ONHEAP) == null;
+ assert cache.localPeek(key2, ONHEAP) == null;
+ assert peek(cache, key3) == 3;
loadAll(cache, ImmutableSet.of(key1, key2), true);
@@ -3391,7 +3397,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testUnswap() throws Exception {
- GridCacheAdapter<String, Integer> cache = ((IgniteKernal)grid(0)).internalCache();
+ IgniteCache<String, Integer> cache = grid(0).cache(null);
List<String> keys = primaryKeysForCache(jcache(), 3);
@@ -3408,17 +3414,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Collection<String> locKeys = new HashSet<>();
- if (cache.context().affinityNode()) {
- locKeys.addAll(cache.primaryKeySet());
+ if (grid(0).context().cache().cache(null).context().affinityNode()) {
+ Iterable<Cache.Entry<String, Integer>> entries = cache.localEntries(PRIMARY, BACKUP);
- info("Local keys (primary): " + locKeys);
-
- locKeys.addAll(cache.keySet(new CacheEntryPredicateAdapter() {
- @Override public boolean apply(GridCacheEntryEx e) {
- return grid(0).affinity(null).isBackup(grid(0).localNode(),
- e.key().value(e.context().cacheObjectContext(), false));
- }
- }));
+ for (Cache.Entry<String, Integer> entry : entries)
+ locKeys.add(entry.getKey());
info("Local keys (primary + backup): " + locKeys);
}
@@ -3444,57 +3444,67 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}, EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
}
- cache.evictAll(Collections.singleton(k2));
- cache.evictAll(Collections.singleton(k3));
+ cache.localEvict(F.asList(k2, k3));
- assertNotNull(cache.localPeek(k1, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k2, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k3, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
+ if (memoryMode() == OFFHEAP_TIERED) {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
+ else {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
int cnt = 0;
if (locKeys.contains(k2)) {
- assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES));
- cache.promoteAll(Collections.singleton(k2));
+ cache.localPromote(Collections.singleton(k2));
- assertEquals((Integer) 2, cache.localPeek(k2, ONHEAP_PEEK_MODES, null));
+ assertEquals((Integer) 2, cache.localPeek(k2, ONHEAP_PEEK_MODES));
cnt++;
}
else {
- cache.promoteAll(Collections.singleton(k2));
+ cache.localPromote(Collections.singleton(k2));
- assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES));
}
if (locKeys.contains(k3)) {
- assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES));
- cache.promoteAll(Collections.singleton(k3));
+ cache.localPromote(Collections.singleton(k3));
- assertEquals((Integer)3, cache.localPeek(k3, ONHEAP_PEEK_MODES, null));
+ assertEquals((Integer)3, cache.localPeek(k3, ONHEAP_PEEK_MODES));
cnt++;
}
else {
- cache.promoteAll(Collections.singleton(k3));
+ cache.localPromote(Collections.singleton(k3));
- assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES));
}
- assertEquals(cnt, swapEvts.get());
- assertEquals(cnt, unswapEvts.get());
+ if (memoryMode() != OFFHEAP_TIERED) {
+ assertEquals(cnt, swapEvts.get());
+ assertEquals(cnt, unswapEvts.get());
+ }
- cache.evictAll(Collections.singleton(k1));
+ cache.localEvict(Collections.singleton(k1));
assertEquals((Integer)1, cache.get(k1));
if (locKeys.contains(k1))
cnt++;
- assertEquals(cnt, swapEvts.get());
- assertEquals(cnt, unswapEvts.get());
+ if (memoryMode() != OFFHEAP_TIERED) {
+ assertEquals(cnt, swapEvts.get());
+ assertEquals(cnt, unswapEvts.get());
+ }
cache.clear();
@@ -3506,14 +3516,21 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
swapEvts.set(0);
unswapEvts.set(0);
- cache.evictAll(Collections.singleton(k2));
- cache.evictAll(Collections.singleton(k3));
+ cache.localEvict(Collections.singleton(k2));
+ cache.localEvict(Collections.singleton(k3));
- assertNotNull(cache.localPeek(k1, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k2, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k3, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
+ if (memoryMode() == OFFHEAP_TIERED) {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
+ else {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
- cache.promoteAll(F.asList(k2, k3));
+ cache.localPromote(F.asSet(k2, k3));
cnt = 0;
@@ -3523,8 +3540,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (locKeys.contains(k3))
cnt++;
- assertEquals(cnt, swapEvts.get());
- assertEquals(cnt, unswapEvts.get());
+ if (memoryMode() != OFFHEAP_TIERED) {
+ assertEquals(cnt, swapEvts.get());
+ assertEquals(cnt, unswapEvts.get());
+ }
}
/**
@@ -3557,7 +3576,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Thread.sleep(ttl + 100);
// Peek will actually remove entry from cache.
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(cache.localPeek(key, ONHEAP));
assert cache.localSize() == 0;
@@ -3654,6 +3673,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertTrue(cache.remove("key" + i));
}
});
+
+ CU.inTx(ignite(0), jcache(), concurrency, isolation, new CIX1<IgniteCache<String, Integer>>() {
+ @Override public void applyx(IgniteCache<String, Integer> cache) {
+ for (int i = 0; i < cnt; i++)
+ assertNull(cache.get("key" + i));
+ }
+ });
}
}
@@ -3745,6 +3771,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
protected void checkSize(Collection<String> keys) throws Exception {
+ if (memoryMode() == OFFHEAP_TIERED)
+ return;
+
if (nearEnabled())
assertEquals(keys.size(), jcache().localSize(CachePeekMode.ALL));
else {
@@ -3768,7 +3797,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
}
- assertEquals("Incorrect size on cache #" + i, size, jcache(i).localSize(CachePeekMode.ALL));
+ assertEquals("Incorrect size on cache #" + i, size, jcache(i).localSize(ALL));
}
}
}
@@ -3779,8 +3808,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
*/
protected void checkKeySize(Collection<String> keys) throws Exception {
if (nearEnabled())
- assertEquals("Invalid key size: " + jcache().localSize(CachePeekMode.ALL),
- keys.size(), jcache().localSize(CachePeekMode.ALL));
+ assertEquals("Invalid key size: " + jcache().localSize(ALL),
+ keys.size(), jcache().localSize(ALL));
else {
for (int i = 0; i < gridCount(); i++) {
GridCacheContext<String, Integer> ctx = context(i);
@@ -3791,7 +3820,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx()))
size++;
- assertEquals("Incorrect key size on cache #" + i, size, jcache(i).localSize(CachePeekMode.ALL));
+ assertEquals("Incorrect key size on cache #" + i, size, jcache(i).localSize(ALL));
}
}
}
@@ -4390,7 +4419,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertFalse(cacheSkipStore.iterator().hasNext());
assertTrue(map.size() == 0);
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
// putAll/removeAll from multiple nodes.
@@ -4479,8 +4508,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertTrue(map.containsKey(rmvKey));
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
- assertTrue(cacheSkipStore.size(CachePeekMode.ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
+ assertTrue(cacheSkipStore.size(ALL) == 0);
cache.remove(rmvKey);
@@ -4723,8 +4752,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < keys.size(); i++)
putToStore(keys.get(i), i);
- assertTrue(cacheSkipStore.size(CachePeekMode.ALL) == 0);
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
+ assertTrue(cacheSkipStore.size(ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
assertTrue(map.size() != 0);
try (Transaction tx = txs.txStart(txConcurrency, txIsolation)) {
@@ -4813,8 +4842,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
*/
private void checkEmpty(IgniteCache<String, Integer> cache, IgniteCache<String, Integer> cacheSkipStore)
throws Exception {
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
- assertTrue(cacheSkipStore.size(CachePeekMode.ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
+ assertTrue(cacheSkipStore.size(ALL) == 0);
assertTrue(map.size() == 0);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index 342eb5a..efd0185 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -393,8 +393,8 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
@Nullable protected <K, V> V peek(IgniteCache<K, V> cache, K key) throws Exception {
- return offheapTiered(cache) ? cache.localPeek(key, CachePeekMode.SWAP) : cache.localPeek(key,
- CachePeekMode.ONHEAP);
+ return offheapTiered(cache) ? cache.localPeek(key, CachePeekMode.SWAP, CachePeekMode.OFFHEAP) :
+ cache.localPeek(key, CachePeekMode.ONHEAP);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java
new file mode 100644
index 0000000..671d6c4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+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.testframework.junits.common.*;
+import org.apache.ignite.transactions.*;
+
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.transactions.TransactionConcurrency.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ * Off-heap tiered test.
+ */
+public class OffHeapTieredTransactionSelfTest extends GridCommonAbstractTest {
+ /** IP finder. */
+ private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration ccfg = defaultCacheConfiguration();
+
+ ccfg.setMemoryMode(OFFHEAP_TIERED);
+ ccfg.setAtomicityMode(TRANSACTIONAL);
+ ccfg.setOffHeapMaxMemory(0);
+ ccfg.setSwapEnabled(true);
+ ccfg.setCacheMode(REPLICATED);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(ipFinder);
+
+ cfg.setDiscoverySpi(disco);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return 30_000;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ startGrids(2);
+
+ awaitPartitionMapExchange();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception In case of error.
+ */
+ public void testPutAll() throws Exception {
+ IgniteCache<String, Integer> cache = grid(0).cache(null);
+
+ final int KEYS = 5;
+
+ Map<String, Integer> data = new LinkedHashMap<>();
+
+ for (int i = 0; i < KEYS; i++)
+ data.put("key_" + i, i);
+
+ checkPutAll(cache, data, OPTIMISTIC, READ_COMMITTED);
+
+ checkPutAll(cache, data, OPTIMISTIC, REPEATABLE_READ);
+
+ checkPutAll(cache, data, OPTIMISTIC, SERIALIZABLE);
+
+ checkPutAll(cache, data, PESSIMISTIC, READ_COMMITTED);
+
+ checkPutAll(cache, data, PESSIMISTIC, REPEATABLE_READ);
+
+ checkPutAll(cache, data, PESSIMISTIC, SERIALIZABLE);
+ }
+
+ /**
+ * @throws Exception In case of error.
+ */
+ private void checkPutAll(IgniteCache<String, Integer> cache, Map<String, Integer> data,
+ TransactionConcurrency txConcurrency, TransactionIsolation txIsolation) throws Exception {
+ IgniteTransactions txs = cache.unwrap(Ignite.class).transactions();
+
+ try (Transaction tx = txs.txStart(txConcurrency, txIsolation)) {
+ cache.putAll(data);
+
+ tx.commit();
+ }
+
+ for (Map.Entry<String, Integer> entry : data.entrySet())
+ assertEquals(entry.getValue(), cache.get(entry.getKey()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..686cc31
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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 static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return ATOMIC;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean txEnabled() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean lockingEnabled() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
index c3a69e2..2dd07ff 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
@@ -17,13 +17,17 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests colocated cache with values being stored off-heap.
*/
public class GridCachePartitionedNearDisabledOffHeapFullApiSelfTest extends
GridCachePartitionedNearDisabledFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
[08/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d24064a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d24064a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d24064a1
Branch: refs/heads/ignite-gg-10186
Commit: d24064a124558014300b945432942abc2e4998df
Parents: 300cc75
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 23 19:11:36 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 23 19:11:36 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 41 +++++++++++++++---
.../IgniteCacheP2pUnmarshallingErrorTest.java | 3 ++
.../IgniteCacheP2pUnmarshallingErrorTxTest.java | 45 ++++++++++++++++++--
3 files changed, 78 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d24064a1/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 b584b17..affdaf0 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
@@ -315,7 +315,10 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
case 34:{
GridDhtTxPrepareRequest req = (GridDhtTxPrepareRequest)msg;
- GridDhtTxPrepareResponse res = new GridDhtTxPrepareResponse(req.version(), req.futureId(), req.miniId());
+ GridDhtTxPrepareResponse res = new GridDhtTxPrepareResponse(
+ req.version(),
+ req.futureId(),
+ req.miniId());
res.error(req.classError());
@@ -327,7 +330,9 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
case 38: {
GridDhtAtomicUpdateRequest req = (GridDhtAtomicUpdateRequest)msg;
- GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(ctx.cacheId(), req.futureVersion());
+ GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(
+ ctx.cacheId(),
+ req.futureVersion());
res.onError(req.classError());
@@ -339,7 +344,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
case 40: {
GridNearAtomicUpdateRequest req = (GridNearAtomicUpdateRequest)msg;
- GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(ctx.cacheId(),
+ GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(
+ ctx.cacheId(),
nodeId,
req.futureVersion());
@@ -353,7 +359,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
case 49: {
GridNearGetRequest req = (GridNearGetRequest)msg;
- GridNearGetResponse res = new GridNearGetResponse(ctx.cacheId(),
+ GridNearGetResponse res = new GridNearGetResponse(
+ ctx.cacheId(),
req.futureId(),
req.miniId(),
req.version());
@@ -365,11 +372,32 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
break;
+ case 51: {
+ GridNearLockRequest req = (GridNearLockRequest)msg;
+
+ GridNearLockResponse res = new GridNearLockResponse(
+ ctx.cacheId(),
+ req.version(),
+ req.futureId(),
+ req.miniId(),
+ false,
+ 0,
+ req.classError());
+
+ sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
+ }
+
+ break;
+
case 55: {
GridNearTxPrepareRequest req = (GridNearTxPrepareRequest)msg;
- GridNearTxPrepareResponse res = new GridNearTxPrepareResponse(req.version(), req.futureId(),
- req.miniId(), req.version(), null, null, null);
+ GridNearTxPrepareResponse res = new GridNearTxPrepareResponse(
+ req.version(),
+ req.futureId(),
+ req.miniId(),
+ req.version(),
+ null, null, null);
res.error(req.classError());
@@ -378,7 +406,6 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
break;
-
default:
throw new IgniteCheckedException("Failed to send response to node. Unsupported direct type [message="
+ msg + "]");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d24064a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index 1f622bd..a50f07c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -32,6 +32,9 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
/** Allows to change behavior of readExternal method. */
protected static AtomicInteger readCnt = new AtomicInteger();
+ /** iterable key */
+ protected static int key = 0;
+
/** {@inheritDoc} */
@Override protected int gridCount() {
return 3;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d24064a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
index ed3749f..1a42407 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.transactions.*;
@@ -34,13 +35,17 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
return CacheAtomicityMode.TRANSACTIONAL;
}
+ @Override protected NearCacheConfiguration nearConfiguration() {
+ return null;
+ }
+
/**
* Sends put with optimistic lock and handles fail.
*/
protected void failOptimistic() {
try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
- jcache(0).put(new TestKey("1"), "");
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
tx.commit();
@@ -59,7 +64,26 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
protected void failPessimictic() {
try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
- jcache(0).put(new TestKey("1"), "");
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+
+ assert false : "p2p marshalling failed, but error response was not sent";
+ }
+// catch (IgniteException e) {
+// assert X.hasCause(e, IOException.class);
+// }
+
+ assert readCnt.get() == 0; //ensure we have read count as expected.
+ }
+
+ /**
+ * Sends put with pessimistic lock and handles fail.
+ */
+ protected void failPessimicticOnCommit() {
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+
+ tx.commit();
assert false : "p2p marshalling failed, but error response was not sent";
}
@@ -84,9 +108,22 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
//
// failOptimistic();
- readCnt.set(100);
+// //GridNearLockRequest unmarshalling failed test
+// readCnt.set(2);
+//
+// failPessimictic();
+
+ //? unmarshalling failed test
+ readCnt.set(1000);
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+
+ TestKey tstKey = new TestKey(String.valueOf(++key));
+ jcache(0).put(tstKey, "");
+ jcache(0).lock(tstKey).lock();
+ }
+
+
- failPessimictic();
}
}
[43/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4cf21335
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4cf21335
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4cf21335
Branch: refs/heads/ignite-gg-10186
Commit: 4cf213359643d5fdd7275c571619594ad6687bf6
Parents: cc679f5 39ae0c8
Author: avinogradov <av...@gridgain.com>
Authored: Thu May 7 18:58:08 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu May 7 18:58:08 2015 +0300
----------------------------------------------------------------------
dev-tools/build.gradle | 15 +-
dev-tools/src/main/groovy/jiraslurp.groovy | 15 +-
.../util/lang/GridFilteredIterator.java | 2 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 22 +-
...CacheLoadingConcurrentGridStartSelfTest.java | 49 +--
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 65 ++--
.../ignite/testsuites/IgniteCacheTestSuite.java | 296 -------------------
.../testsuites/IgniteCacheTestSuite2.java | 141 +++++++++
.../testsuites/IgniteCacheTestSuite3.java | 143 +++++++++
.../testsuites/IgniteCacheTestSuite4.java | 131 ++++++++
.../ignite/schema/generator/CodeGenerator.java | 6 +-
11 files changed, 500 insertions(+), 385 deletions(-)
----------------------------------------------------------------------
[09/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Conflicts:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9e4bc104
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9e4bc104
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9e4bc104
Branch: refs/heads/ignite-gg-10186
Commit: 9e4bc1044c7b6b3cc2bcbad4cae9bbebd33bcc14
Parents: d24064a 2dfc187
Author: avinogradov <av...@gridgain.com>
Authored: Fri Apr 24 19:14:24 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri Apr 24 19:14:24 2015 +0300
----------------------------------------------------------------------
.../aop/aspectj/GridifyAspectJAspect.java | 2 +-
.../aspectj/GridifySetToSetAspectJAspect.java | 2 +-
.../aspectj/GridifySetToValueAspectJAspect.java | 2 +-
.../aop/spring/GridifySetToSetSpringAspect.java | 2 +-
.../spring/GridifySetToValueSpringAspect.java | 2 +-
.../gridify/aop/spring/GridifySpringAspect.java | 2 +-
.../cache/CacheServerNotFoundException.java | 12 +-
.../apache/ignite/cache/CachingProvider.java | 3 +
.../ignite/events/CacheQueryExecutedEvent.java | 3 +-
.../ignite/events/CacheQueryReadEvent.java | 3 +-
.../apache/ignite/internal/IgniteKernal.java | 15 +-
.../org/apache/ignite/internal/IgnitionEx.java | 6 +
.../ClusterTopologyServerNotFoundException.java | 12 +-
.../deployment/GridDeploymentClassLoader.java | 2 +-
.../discovery/GridDiscoveryManager.java | 3 +
.../eventstorage/GridEventStorageManager.java | 6 +
.../affinity/GridAffinityAssignmentCache.java | 4 +-
.../cache/CacheStoreBalancingWrapper.java | 6 +
.../processors/cache/GridCacheAdapter.java | 9 +-
.../processors/cache/GridCacheEntryEx.java | 4 +
.../processors/cache/GridCacheIoManager.java | 6 +
.../processors/cache/GridCacheMapEntry.java | 20 +-
.../GridCachePartitionExchangeManager.java | 2 +-
.../processors/cache/GridCacheUtils.java | 53 +-
.../GridDistributedCacheAdapter.java | 20 +-
.../distributed/GridDistributedLockRequest.java | 99 +-
.../GridDistributedTxRemoteAdapter.java | 3 +
.../distributed/dht/GridDhtCacheAdapter.java | 4 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 9 +-
.../distributed/dht/GridDhtLockFuture.java | 20 +-
.../distributed/dht/GridDhtLockRequest.java | 7 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 21 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 3 +
.../distributed/dht/GridDhtTxLocalAdapter.java | 26 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 6 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 7 +-
.../dht/GridPartitionedGetFuture.java | 7 +
.../dht/atomic/GridDhtAtomicCache.java | 41 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 38 +-
.../dht/atomic/GridNearAtomicUpdateRequest.java | 49 +-
.../dht/colocated/GridDhtColocatedCache.java | 56 +-
.../colocated/GridDhtColocatedLockFuture.java | 18 +-
.../GridDhtPartitionsExchangeFuture.java | 3 +
.../distributed/near/GridNearAtomicCache.java | 5 +-
.../distributed/near/GridNearCacheAdapter.java | 10 +-
.../distributed/near/GridNearCacheEntry.java | 10 +-
.../distributed/near/GridNearGetFuture.java | 17 +-
.../distributed/near/GridNearLockFuture.java | 15 +-
.../distributed/near/GridNearLockRequest.java | 7 +-
.../near/GridNearTransactionalCache.java | 43 +-
.../near/GridNearTxFinishFuture.java | 3 +
.../cache/distributed/near/GridNearTxLocal.java | 7 +-
.../distributed/near/GridNearTxRemote.java | 7 +-
.../local/atomic/GridLocalAtomicCache.java | 59 +-
.../query/GridCacheDistributedQueryManager.java | 3 +
.../cache/query/GridCacheLocalQueryFuture.java | 3 +
.../query/GridCacheQueryFutureAdapter.java | 3 +
.../cache/query/GridCacheQueryManager.java | 20 +-
.../jdbc/GridCacheQueryJdbcMetadataTask.java | 3 +
.../cache/transactions/IgniteTxAdapter.java | 7 +-
.../cache/transactions/IgniteTxEntry.java | 74 +-
.../cache/transactions/IgniteTxHandler.java | 27 +-
.../transactions/IgniteTxLocalAdapter.java | 106 +-
.../cache/transactions/IgniteTxLocalEx.java | 4 +-
.../closure/GridClosureProcessor.java | 16 +-
.../datastreamer/DataStreamProcessor.java | 28 +-
.../datastreamer/DataStreamerImpl.java | 3 +-
.../datastreamer/DataStreamerRequest.java | 38 +-
.../processors/igfs/IgfsFileWorkerBatch.java | 3 +
.../internal/processors/igfs/IgfsThread.java | 8 +-
.../internal/processors/job/GridJobWorker.java | 9 +
.../portable/GridPortableInputStream.java | 26 -
.../processors/query/GridQueryProcessor.java | 3 +
.../processors/rest/GridRestProcessor.java | 3 +
.../service/GridServiceProcessor.java | 9 +
.../processors/task/GridTaskWorker.java | 12 +
.../timeout/GridTimeoutProcessor.java | 3 +
.../ignite/internal/util/IgniteUtils.java | 22 +-
.../util/ipc/loopback/IpcServerTcpEndpoint.java | 2 +-
.../shmem/IpcSharedMemoryServerEndpoint.java | 2 +-
.../ignite/internal/util/lang/GridFunc.java | 12 +-
.../ignite/internal/util/nio/GridNioServer.java | 6 +
.../apache/ignite/internal/util/typedef/X.java | 2 +-
.../ignite/internal/util/worker/GridWorker.java | 3 +
.../visor/misc/VisorResolveHostNameTask.java | 2 +-
.../visor/node/VisorNodeDataCollectorJob.java | 6 +-
.../ignite/messaging/MessagingListenActor.java | 3 +
.../org/apache/ignite/spi/IgniteSpiThread.java | 3 +
.../spi/discovery/tcp/TcpDiscoverySpi.java | 3 +
.../startup/cmdline/CommandLineStartup.java | 5 +-
.../startup/cmdline/CommandLineTransformer.java | 3 +
.../cache/GridCacheAbstractFullApiSelfTest.java | 514 ++++++-
.../processors/cache/GridCacheTestEntryEx.java | 2 +
.../cache/IgniteExcangeFutureHistoryTest.java | 74 -
.../cache/IgniteExchangeFutureHistoryTest.java | 77 ++
.../CacheNoValueClassOnServerNodeTest.java | 129 ++
.../DataStreamerMultiThreadedSelfTest.java | 101 ++
.../ignite/testsuites/IgniteCacheTestSuite.java | 7 +-
.../CacheNoValueClassOnServerTestClient.java | 88 ++
.../apache/ignite/tests/p2p/cache/Person.java | 42 +
.../CacheConfigurationP2PTestClient.java | 1 -
.../processors/hadoop/HadoopDefaultJobInfo.java | 3 +
.../processors/hadoop/igfs/HadoopIgfsIpcIo.java | 3 +
.../hadoop/jobtracker/HadoopJobTracker.java | 5 +-
.../hadoop/taskexecutor/HadoopRunnableTask.java | 3 +
.../external/HadoopExternalTaskExecutor.java | 3 +
.../processors/hadoop/v2/HadoopV2Job.java | 11 +-
.../hadoop/v2/HadoopV2TaskContext.java | 9 +
.../query/h2/twostep/GridMapQueryExecutor.java | 3 +
.../GridCacheAbstractFieldsQuerySelfTest.java | 1284 ------------------
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 235 +++-
...artitionedFieldsQueryP2PEnabledSelfTest.java | 34 -
...GridCachePartitionedFieldsQuerySelfTest.java | 115 --
...rtitionedFieldsQueryP2PDisabledSelfTest.java | 34 -
...artitionedFieldsQueryP2PEnabledSelfTest.java | 34 +
...eReplicatedFieldsQueryP2PEnableSelfTest.java | 34 -
.../GridCacheReplicatedFieldsQuerySelfTest.java | 157 ---
...eplicatedFieldsQueryP2PDisabledSelfTest.java | 34 -
...ReplicatedFieldsQueryP2PEnabledSelfTest.java | 34 +
.../IgniteCacheQuerySelfTestSuite.java | 4 +-
.../http/jetty/GridJettyRestHandler.java | 3 +
.../ignite/schema/ui/SchemaImportApp.java | 8 +-
.../uri/GridUriDeploymentClassLoader.java | 4 +-
123 files changed, 2234 insertions(+), 2141 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9e4bc104/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index affdaf0,b8668e6..1fe1f50
--- 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
@@@ -288,7 -282,16 +288,10 @@@ public class GridCacheIoManager extend
}
}
catch (Throwable e) {
- if (X.hasCause(e, ClassNotFoundException.class))
- U.error(log, "Failed to process message (note that distributed services " +
- "do not support peer class loading, if you deploy distributed service " +
- "you should have all required classes in CLASSPATH on all nodes in topology) " +
- "[senderId=" + nodeId + ", err=" + X.cause(e, ClassNotFoundException.class).getMessage() + ']');
- else
- U.error(log, "Failed to process message [senderId=" + nodeId + ']', e);
+ U.error(log, "Failed to process message [senderId=" + nodeId + ", messageType=" + cacheMsg.getClass() + ']', e);
+
+ if (e instanceof Error)
+ throw (Error)e;
}
finally {
if (depEnabled)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9e4bc104/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
[33/50] [abbrv] incubator-ignite git commit: # Minor tests
refactoring.
Posted by sb...@apache.org.
# Minor tests refactoring.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5f8f6f46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5f8f6f46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5f8f6f46
Branch: refs/heads/ignite-gg-10186
Commit: 5f8f6f46dbba461e43dc23a292a2b0ff764f19dd
Parents: 57ab09e
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue May 5 12:10:21 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 5 12:10:21 2015 +0300
----------------------------------------------------------------------
.../cache/GridCacheSwapReloadSelfTest.java | 20 ++++++++++++++------
.../cache/IgniteCachePeekModesAbstractTest.java | 15 ++++++++++++---
...idFileSwapSpaceSpiMultithreadedLoadTest.java | 4 ++--
.../cache/GridCacheOffHeapAndSwapSelfTest.java | 11 ++++++++++-
.../cache/GridCacheOffHeapSelfTest.java | 11 ++++++++++-
5 files changed, 48 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f8f6f46/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java
index 78f01f0..7d4eefc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java
@@ -24,7 +24,6 @@ import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.spi.discovery.tcp.*;
@@ -35,7 +34,6 @@ import org.apache.ignite.spi.swapspace.file.*;
import org.apache.ignite.testframework.junits.common.*;
import javax.cache.*;
-import javax.cache.configuration.*;
import java.util.*;
import java.util.concurrent.*;
@@ -51,6 +49,18 @@ public class GridCacheSwapReloadSelfTest extends GridCommonAbstractTest {
/** IP finder. */
private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+ /**
+ * Creates swap space spi.
+ * @return The swap spi.
+ */
+ protected SwapSpaceSpi spi() {
+ FileSwapSpaceSpi swap = new FileSwapSpaceSpi();
+
+ swap.setWriteBufferSize(1);
+
+ return swap;
+ }
+
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
@@ -62,11 +72,9 @@ public class GridCacheSwapReloadSelfTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(disco);
- FileSwapSpaceSpi swap = new FileSwapSpaceSpi();
-
- swap.setWriteBufferSize(1);
+ SwapSpaceSpi spi = spi();
- cfg.setSwapSpaceSpi(swap);
+ cfg.setSwapSpaceSpi(spi);
CacheConfiguration cacheCfg = defaultCacheConfiguration();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f8f6f46/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
index c2eb56f..7cd8414 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.swapspace.*;
import org.apache.ignite.spi.swapspace.file.*;
import javax.cache.*;
@@ -54,11 +55,19 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+ cfg.setSwapSpaceSpi(spi());
return cfg;
}
+ /**
+ * Creates a SwapSpaceSpi.
+ * @return the Spi
+ */
+ protected SwapSpaceSpi spi() {
+ return new FileSwapSpaceSpi();
+ }
+
/** {@inheritDoc} */
@Override protected NearCacheConfiguration nearConfiguration() {
return null;
@@ -231,7 +240,7 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
for (Integer key : keys)
cache0.put(key, val);
- FileSwapSpaceSpi swap = (FileSwapSpaceSpi)ignite(nodeIdx).configuration().getSwapSpaceSpi();
+ SwapSpaceSpi swap = ignite(nodeIdx).configuration().getSwapSpaceSpi();
Set<Integer> swapKeys = new HashSet<>();
@@ -614,7 +623,7 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
* @return Tuple with primary and backup keys.
*/
private T2<List<Integer>, List<Integer>> swapKeys(int nodeIdx) {
- FileSwapSpaceSpi swap = (FileSwapSpaceSpi)ignite(nodeIdx).configuration().getSwapSpaceSpi();
+ SwapSpaceSpi swap = ignite(nodeIdx).configuration().getSwapSpaceSpi();
IgniteSpiCloseableIterator<Integer> it = swap.keyIterator(SPACE_NAME, null);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f8f6f46/modules/core/src/test/java/org/apache/ignite/loadtest/swapspace/GridFileSwapSpaceSpiMultithreadedLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtest/swapspace/GridFileSwapSpaceSpiMultithreadedLoadTest.java b/modules/core/src/test/java/org/apache/ignite/loadtest/swapspace/GridFileSwapSpaceSpiMultithreadedLoadTest.java
index abd80e1..d21fb13 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtest/swapspace/GridFileSwapSpaceSpiMultithreadedLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtest/swapspace/GridFileSwapSpaceSpiMultithreadedLoadTest.java
@@ -49,7 +49,7 @@ public class GridFileSwapSpaceSpiMultithreadedLoadTest extends GridCommonAbstrac
private static final long MAX_ENTRIES = 9000000;
/** Test duration. */
- private static final long DURATION = 10 * 60 * 1000;
+ private static final long DURATION = 2 * 60 * 1000;
/** Swap context. */
private final SwapContext swapCtx = new SwapContext();
@@ -73,7 +73,7 @@ public class GridFileSwapSpaceSpiMultithreadedLoadTest extends GridCommonAbstrac
/**
* @return An SPI instance to test.
*/
- private SwapSpaceSpi spi() {
+ protected SwapSpaceSpi spi() {
FileSwapSpaceSpi spi = new FileSwapSpaceSpi();
// spi.setConcurrencyLevel(N_THREADS);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f8f6f46/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
index 226f0fc..0c55551 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
@@ -30,6 +30,7 @@ import org.apache.ignite.lang.*;
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.*;
import org.apache.ignite.spi.swapspace.file.*;
import org.apache.ignite.testframework.junits.common.*;
@@ -79,6 +80,14 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest {
/** */
private final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+ /**
+ * Creates a SwapSpaceSpi.
+ * @return the Spi
+ */
+ protected SwapSpaceSpi spi() {
+ return new FileSwapSpaceSpi();
+ }
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -91,7 +100,7 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest {
cfg.setNetworkTimeout(2000);
- cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+ cfg.setSwapSpaceSpi(spi());
CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f8f6f46/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
index 460a64c..2d6855e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
@@ -29,6 +29,7 @@ import org.apache.ignite.marshaller.optimized.*;
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.*;
import org.apache.ignite.spi.swapspace.file.*;
import org.apache.ignite.testframework.junits.common.*;
@@ -65,6 +66,14 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest {
/** PeerClassLoadingLocalClassPathExclude enable. */
private boolean excluded;
+ /**
+ * Creates a SwapSpaceSpi.
+ * @return the Spi
+ */
+ protected SwapSpaceSpi spi() {
+ return new FileSwapSpaceSpi();
+ }
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -77,7 +86,7 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest {
cfg.setNetworkTimeout(2000);
- cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+ cfg.setSwapSpaceSpi(spi());
CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();
[15/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/45c6e09b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/45c6e09b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/45c6e09b
Branch: refs/heads/ignite-gg-10186
Commit: 45c6e09b8d4c79683336687724d441c1cfad659e
Parents: 7814b53
Author: avinogradov <av...@gridgain.com>
Authored: Mon Apr 27 18:19:14 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon Apr 27 18:19:14 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheP2pUnmarshallingErrorTest.java | 2 +-
...gniteCacheP2pUnmarshallingNearErrorTest.java | 2 +-
...CacheP2pUnmarshallingRebalanceErrorTest.java | 15 ++++++-
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 2 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 +
...gniteCacheP2pUnmarshallingErrorTestSuit.java | 41 ++++++++++++++++++++
...niteCacheP2pUnmarshallingQueryErrorTest.java | 2 +-
.../IgniteCacheQuerySelfTestSuite.java | 3 ++
8 files changed, 62 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index 2a3f08a..5aa0ac8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -27,7 +27,7 @@ import java.io.*;
import java.util.concurrent.atomic.*;
/**
- * Check behavior on exception while unmarshalling key.
+ * Checks behavior on exception while unmarshalling key.
*/
public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTest {
/** Allows to change behavior of readExternal method. */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
index 0b9226f..453812b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
@@ -21,7 +21,7 @@ import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.configuration.*;
/**
- * Check behavior on exception while unmarshalling key.
+ * Checks behavior on exception while unmarshalling key.
*/
public class IgniteCacheP2pUnmarshallingNearErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
index 95d38e1..49f58f9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
@@ -18,9 +18,13 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.internal.util.typedef.*;
+
+import javax.cache.*;
+import java.io.*;
/**
- * Check behavior on exception while unmarshalling key.
+ * Checks behavior on exception while unmarshalling key.
*/
public class IgniteCacheP2pUnmarshallingRebalanceErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
/** {@inheritDoc} */
@@ -64,6 +68,13 @@ public class IgniteCacheP2pUnmarshallingRebalanceErrorTest extends IgniteCacheP2
readCnt.set(1);
- jcache(3).get(new TestKey(String.valueOf(key)));
+ try {
+ jcache(3).get(new TestKey(String.valueOf(key)));
+ assert false : "p2p marshalling failed, but error response was not sent";
+ }
+ catch (CacheException e) {
+ assert X.hasCause(e, IOException.class);
+ }
+
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
index ca48507..a4e2753 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
@@ -27,7 +27,7 @@ import javax.cache.*;
import java.io.*;
/**
- * Check behavior on exception while unmarshalling key.
+ * Checks behavior on exception while unmarshalling key.
*/
public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index 5d53129..c4a5fd5 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -46,6 +46,7 @@ public class IgniteBasicTestSuite extends TestSuite {
suite.addTest(IgniteStartUpTestSuite.suite());
suite.addTest(IgniteExternalizableSelfTestSuite.suite());
suite.addTest(IgniteP2PSelfTestSuite.suite());
+ suite.addTest(IgniteCacheP2pUnmarshallingErrorTestSuit.suite());
suite.addTest(new TestSuite(GridSelfTest.class));
suite.addTest(new TestSuite(GridProjectionSelfTest.class));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuit.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuit.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuit.java
new file mode 100644
index 0000000..9b40280
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuit.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.processors.cache.*;
+
+/**
+ * Checks behavior on exception while unmarshalling key.
+ */
+public class IgniteCacheP2pUnmarshallingErrorTestSuit extends TestSuite {
+ /**
+ * @return Suite.
+ * @throws Exception If failed.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("P2p Unmarshalling Test Suite");
+
+ suite.addTestSuite(IgniteCacheP2pUnmarshallingErrorTest.class);
+ suite.addTestSuite(IgniteCacheP2pUnmarshallingNearErrorTest.class);
+ suite.addTestSuite(IgniteCacheP2pUnmarshallingRebalanceErrorTest.class);
+ suite.addTestSuite(IgniteCacheP2pUnmarshallingTxErrorTest.class);
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
index afb96be..c5f9632 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
@@ -23,7 +23,7 @@ import org.apache.ignite.configuration.*;
import javax.cache.*;
/**
- * Check behavior on exception while unmarshalling key.
+ * Checks behavior on exception while unmarshalling key.
*/
public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c6e09b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index ce05980..69d7548 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -111,6 +111,9 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheQueryMetricsSelfTest.class);
+ //Unmarshallig query test.
+ suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
+
return suite;
}
}
[49/50] [abbrv] incubator-ignite git commit: #ignite-286: Make cache
full api test work in OFFHEAP_TIERED mode.
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
index 62e4452..216832c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
@@ -17,13 +17,17 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests colocated cache with values being stored off-heap.
*/
public class GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest
extends GridCachePartitionedNearDisabledMultiNodeFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java
new file mode 100644
index 0000000..875a913
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.processors.cache.distributed.near.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest extends
+ GridCachePartitionedFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return ATOMIC;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean txEnabled() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean lockingEnabled() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected NearCacheConfiguration nearConfiguration() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..bab26f7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest extends
+ GridCachePartitionedNearDisabledOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..022f26b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..b0d13e0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicOffHeapTieredFullApiSelfTest extends GridCacheAtomicOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..b3adf14
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCacheAtomicOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..41e98b2
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest extends
+ GridCacheAtomicPrimaryWriteOrderOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..f29cdd0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCacheAtomicPrimaryWrityOrderOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index caacc2b..84594a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -27,7 +27,6 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import javax.cache.*;
import java.util.*;
import java.util.concurrent.atomic.*;
@@ -138,12 +137,12 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
int size = 10;
- IgniteCache<Object, Object> prj0 = grid(0).cache(null);
+ IgniteCache<Object, Object> chache0 = grid(0).cache(null);
for (int i = 0; i < size; i++) {
info("Putting value [i=" + i + ']');
- prj0.put(i, i);
+ chache0.put(i, i);
info("Finished putting value [i=" + i + ']');
}
@@ -156,26 +155,30 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
for (int k = 0; k < size; k++) {
if (affinity(cache).isPrimaryOrBackup(node, k))
- assertEquals("Check failed for node: " + node.id(), k, cache.localPeek(k, ONHEAP));
+ assertEquals("Check failed for node: " + node.id(), k,
+ cache.localPeek(k, CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP));
}
}
for (int i = 0; i < size; i++) {
info("Putting value 2 [i=" + i + ']');
- assertEquals(i, prj0.getAndPutIfAbsent(i, i * i));
+ assertEquals(i, chache0.getAndPutIfAbsent(i, i * i));
info("Finished putting value 2 [i=" + i + ']');
}
for (int i = 0; i < size; i++)
- assertEquals(i, prj0.get(i));
+ assertEquals(i, chache0.get(i));
}
/**
* @throws Exception If failed.
*/
public void testUnswapShort() throws Exception {
+ if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
final AtomicInteger swapEvts = new AtomicInteger(0);
final AtomicInteger unswapEvts = new AtomicInteger(0);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
index d77efcf..78c8ab7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests partitioned cache with values being stored off-heap.
*/
public class GridCachePartitionedOffHeapFullApiSelfTest extends GridCachePartitionedFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
index c7a04fc..4724d9d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests partitioned cache with values being stored off-heap.
*/
public class GridCachePartitionedOffHeapMultiNodeFullApiSelfTest extends GridCachePartitionedMultiNodeFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..365e9aa
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedOffHeapTieredFullApiSelfTest extends GridCachePartitionedOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..4392365
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest extends GridCachePartitionedOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPut() throws Exception {
+ IgniteCache<String, Integer> cache = grid(0).cache(null);
+
+ assert gridCount() > 3;
+ String key = null;
+
+ for (int i = 0; i < 250; ++i) {
+ String testKey = "key_" + i;
+
+ if (!grid(0).affinity(null).isPrimaryOrBackup(grid(0).localNode(), testKey)) {
+ key = testKey;
+
+ break;
+ }
+ }
+
+ assert key != null;
+
+ IgniteCache<String, Integer> primaryCache = primaryCache(key);
+
+ assertFalse(grid(0).affinity(null).isPrimary(grid(0).localNode(), key));
+ assertFalse(grid(0).affinity(null).isBackup(grid(0).localNode(), key));
+
+ primaryCache.put(key, 4); // Put from primary.
+
+ assertNull(primaryCache.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(4, primaryCache.localPeek(key, CachePeekMode.OFFHEAP).intValue());
+
+ cache.put(key, 5); // Put from near to add reader on primary.
+
+ assertEquals(5, primaryCache.localPeek(key, CachePeekMode.ONHEAP).intValue());
+ assertEquals(5, primaryCache.localPeek(key, CachePeekMode.OFFHEAP).intValue());
+ assertEquals(5, cache.get(key).intValue());
+ assertEquals(5, map.get(key));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
index c9b9072..1cb5df5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.replicated;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests replicated cache with values being stored off-heap.
*/
public class GridCacheReplicatedOffHeapFullApiSelfTest extends GridCacheReplicatedFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
index 382b0f9..f79f898 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.replicated;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests replicated cache with values being stored off-heap.
*/
public class GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..8162c8e
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.replicated;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests replicated cache with off-heap tiered mode.
+ */
+public class GridCacheReplicatedOffHeapTieredFullApiSelfTest extends
+ GridCacheReplicatedOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..0e2bf90
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.replicated;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests replicated cache with off-heap tiered mode.
+ */
+public class GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest{
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..b4e8cf1
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.local;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests local cache in atomic mode with off-heap tiered mode.
+ */
+public class GridCacheLocalAtomicOffHeapTieredFullApiSelfTest extends GridCacheLocalAtomicOffHeapFullApiSelfTest{
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
index 31b8bee..e2621ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
@@ -17,12 +17,14 @@
package org.apache.ignite.internal.processors.cache.local;
+import org.apache.ignite.cache.*;
+
/**
* Tests local cache with values being stored offheap.
*/
public class GridCacheLocalOffHeapFullApiSelfTest extends GridCacheLocalFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..c6ce9da
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.local;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests local cache with off-heap tired memory mode.
+ */
+public class GridCacheLocalOffHeapTieredFullApiSelfTest extends GridCacheLocalOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index d5760ee..56ff951 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -73,6 +73,7 @@ public class IgniteBasicTestSuite extends TestSuite {
suite.addTestSuite(GridLifecycleAwareSelfTest.class);
suite.addTestSuite(GridMessageListenSelfTest.class);
suite.addTestSuite(GridFailFastNodeFailureDetectionSelfTest.class);
+ suite.addTestSuite(OffHeapTieredTransactionSelfTest.class);
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
index acf6c64..369e041 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
@@ -60,6 +60,16 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderOffHeapFullApiSelfTest.class);
suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.class);
+ // One node with off-heap tiered mode.
+ suite.addTestSuite(GridCacheLocalOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.class);
+
// Multi-node.
suite.addTestSuite(GridCacheReplicatedMultiNodeFullApiSelfTest.class);
suite.addTestSuite(GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest.class);
@@ -112,6 +122,14 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapMultiNodeFullApiSelfTest.class);
suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.class);
+ // Multi-node with off-heap tiered mode.
+ suite.addTestSuite(GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.class);
+
// Private cache API.
suite.addTestSuite(GridCacheExLocalFullApiSelfTest.class);
suite.addTestSuite(GridCacheExReplicatedFullApiSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java
new file mode 100644
index 0000000..8b09d0f
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ * Test queries in off-heap tired mode.
+ */
+public class IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest extends IgniteCacheQueryMultiThreadedSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration cacheConfiguration() {
+ CacheConfiguration ccfg = super.cacheConfiguration();
+
+ ccfg.setCacheMode(CacheMode.REPLICATED);
+ ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
+ ccfg.setOffHeapMaxMemory(0);
+
+ return ccfg;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 daca7dc..54bc814 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
@@ -86,6 +86,17 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
cfg.setMarshaller(new OptimizedMarshaller(false));
+ cfg.setCacheConfiguration(cacheConfiguration());
+
+ GridQueryProcessor.idxCls = FakeIndexing.class;
+
+ return cfg;
+ }
+
+ /**
+ * @return Cache configuration.
+ */
+ protected CacheConfiguration cacheConfiguration() {
CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
@@ -106,11 +117,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
if (offheapEnabled())
cacheCfg.setOffHeapMaxMemory(evictsEnabled() ? 1000 : 0); // Small offheap for evictions.
- cfg.setCacheConfiguration(cacheCfg);
-
- GridQueryProcessor.idxCls = FakeIndexing.class;
-
- return cfg;
+ return cacheCfg;
}
/**
@@ -235,6 +242,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
final IgniteCache<Integer, String> c = g.cache(null);
final IgniteCache<Integer, Long> cl = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).localSize());
assertEquals(0, c.query(new SqlQuery(String.class, "1 = 1")).getAll().size());
assertEquals(0, cl.query(new SqlQuery(Long.class, "1 = 1")).getAll().size());
@@ -307,6 +317,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
final IgniteCache<Integer, Long> c = g.cache(null);
final IgniteCache<Integer, String> c1 = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).localSize());
assertEquals(0, c1.query(new SqlQuery(String.class, "1 = 1")).getAll().size());
assertEquals(0, c.query(new SqlQuery(Long.class, "1 = 1")).getAll().size());
@@ -379,6 +392,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
// Put test values into cache.
final IgniteCache<Integer, Object> c = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).size());
assertEquals(0, c.query(new SqlQuery(Object.class, "1 = 1")).getAll().size());
@@ -450,6 +466,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
// Put test values into cache.
final IgniteCache<Integer, TestValue> c = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).localSize());
assertEquals(0, c.query(new SqlQuery(TestValue.class, "1 = 1")).getAll().size());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index 69d7548..f42963a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -59,6 +59,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheLargeResultSelfTest.class);
suite.addTestSuite(GridCacheQueryInternalKeysSelfTest.class);
suite.addTestSuite(IgniteCacheQueryMultiThreadedSelfTest.class);
+ suite.addTestSuite(IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.class);
suite.addTestSuite(IgniteCacheQueryEvictsMultiThreadedSelfTest.class);
suite.addTestSuite(IgniteCacheQueryOffheapMultiThreadedSelfTest.class);
suite.addTestSuite(IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.class);
[16/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cf6e4352
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cf6e4352
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cf6e4352
Branch: refs/heads/ignite-gg-10186
Commit: cf6e4352b3913c67123a8d2329069373d4b05075
Parents: 45c6e09
Author: avinogradov <av...@gridgain.com>
Authored: Mon Apr 27 18:34:49 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon Apr 27 18:34:49 2015 +0300
----------------------------------------------------------------------
.../cache/IgniteCacheP2pUnmarshallingNearErrorTest.java | 2 +-
.../cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf6e4352/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
index 453812b..732d12d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
@@ -44,7 +44,7 @@ public class IgniteCacheP2pUnmarshallingNearErrorTest extends IgniteCacheP2pUnma
/** {@inheritDoc} */
@Override public void testResponseMessageOnUnmarshallingFailed() throws InterruptedException {
//GridCacheEvictionRequest unmarshalling failed test
- readCnt.set(5);
+ readCnt.set(5); //2 for each put
jcache(0).put(new TestKey(String.valueOf(++key)), "");
jcache(0).put(new TestKey(String.valueOf(++key)), "");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf6e4352/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
index c5f9632..b2095a8 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
@@ -39,9 +39,7 @@ public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnm
@Override public void testResponseMessageOnUnmarshallingFailed() {
readCnt.set(Integer.MAX_VALUE);
- TestKey val = new TestKey(String.valueOf(++key));
-
- jcache(0).put(val, "");
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
//GridCacheQueryRequest unmarshalling failed test
readCnt.set(1);
[46/50] [abbrv] incubator-ignite git commit: Merge branch
ignite-sprint-4 into ignite-sprint-5
Posted by sb...@apache.org.
Merge branch ignite-sprint-4 into ignite-sprint-5
Conflicts:
examples/pom.xml
modules/aop/pom.xml
modules/aws/pom.xml
modules/clients/pom.xml
modules/cloud/pom.xml
modules/codegen/pom.xml
modules/core/pom.xml
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
modules/extdata/p2p/pom.xml
modules/extdata/uri/pom.xml
modules/gce/pom.xml
modules/geospatial/pom.xml
modules/hadoop/pom.xml
modules/hibernate/pom.xml
modules/indexing/pom.xml
modules/jcl/pom.xml
modules/jta/pom.xml
modules/log4j/pom.xml
modules/rest-http/pom.xml
modules/scalar/pom.xml
modules/schedule/pom.xml
modules/schema-import/pom.xml
modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
modules/slf4j/pom.xml
modules/spring/pom.xml
modules/ssh/pom.xml
modules/tools/pom.xml
modules/urideploy/pom.xml
modules/visor-console/pom.xml
modules/visor-plugins/pom.xml
modules/web/pom.xml
modules/yardstick/pom.xml
pom.xml
Merge branch 'ignite-sprint-4' of https://github.com/ggprivate/ggprivate into ignite-sprint-5
Conflicts:
benchmarks/cache-comparison/pom.xml
benchmarks/filesystem/hadoop1/pom.xml
benchmarks/filesystem/hadoop2/pom.xml
benchmarks/mongo/pom.xml
benchmarks/risk-analytics/pom.xml
benchmarks/serialization/pom.xml
benchmarks/yardstick/pom.xml
benchmarks/yardstick/src/main/dotnet/gridgain-benchmarks/Properties/AssemblyInfo.cs
examples/clients/cpp/configure
examples/clients/cpp/configure.ac
examples/clients/dotnet/GridGainExamples/GridGainExamples/Properties/AssemblyInfo.cs
examples/clients/dotnet/GridGainExamples/GridGainExamplesDll/Properties/AssemblyInfo.cs
examples/pom.xml
modules/clients/cpp/main/configure
modules/clients/cpp/main/configure.ac
modules/clients/cpp/main/tests/configure
modules/clients/cpp/main/tests/configure.ac
modules/clients/cpp/vsproject/resource.h
modules/clients/dotnet/gridgain-exe/Properties/AssemblyInfo.cs
modules/clients/dotnet/gridgain-native/AssemblyInfo.cpp
modules/clients/dotnet/gridgain/Properties/AssemblyInfo.cs
modules/clients/pom.xml
modules/clients/src/test/dotnet/gridgain-test-compatibility/Properties/AssemblyInfo.cs
modules/clients/src/test/dotnet/gridgain-test-runner/Properties/AssemblyInfo.cs
modules/clients/src/test/dotnet/gridgain-test/Properties/AssemblyInfo.cs
modules/codegen/pom.xml
modules/compatibility/pom.xml
modules/core/pom.xml
modules/diagnostic/pom.xml
modules/dr-demo/pom.xml
modules/license-gen/pom.xml
modules/mongo-sniffer/pom.xml
modules/mongo-visor/pom.xml
modules/mongo/pom.xml
modules/tools/pom.xml
modules/visor-console/pom.xml
modules/visor-demo/pom.xml
modules/visor-tester-plugin/pom.xml
modules/visor-tester/pom.xml
modules/visor/pom.xml
parent/pom.xml
pilots/chronotrack/pom.xml
pilots/ctb/pom.xml
pilots/dsi/pom.xml
pilots/ionic/pom.xml
pilots/sb/pom.xml
pilots/sony/pom.xml
pilots/wellsfargo/pom.xml
pilots/worldpay/pom.xml
pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0b91761c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0b91761c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0b91761c
Branch: refs/heads/ignite-gg-10186
Commit: 0b91761cccbba00888fdba73c9ca5602b8b229bc
Parents: 942abe4 0c13a08
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri May 8 09:57:43 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri May 8 09:57:43 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 | 4 +-
modules/codegen/pom.xml | 2 +-
.../ignite/codegen/MessageCodeGenerator.java | 4 +-
modules/core/pom.xml | 2 +-
.../communication/GridIoMessageFactory.java | 4 +-
.../cache/DynamicCacheDescriptor.java | 16 +-
.../processors/cache/GridCacheAdapter.java | 518 +++++++++---------
.../processors/cache/GridCacheMapEntry.java | 18 +-
.../GridCachePartitionExchangeManager.java | 3 +
.../processors/cache/GridCacheProcessor.java | 189 ++++---
.../processors/cache/GridCacheTtlManager.java | 42 +-
.../processors/cache/GridCacheUtils.java | 5 +-
...ridCacheOptimisticCheckPreparedTxFuture.java | 434 ---------------
...idCacheOptimisticCheckPreparedTxRequest.java | 232 --------
...dCacheOptimisticCheckPreparedTxResponse.java | 179 -------
.../distributed/GridCacheTxRecoveryFuture.java | 506 ++++++++++++++++++
.../distributed/GridCacheTxRecoveryRequest.java | 261 +++++++++
.../GridCacheTxRecoveryResponse.java | 182 +++++++
.../GridDistributedTxRemoteAdapter.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../dht/GridPartitionedGetFuture.java | 2 +-
.../cache/query/GridCacheSqlQuery.java | 2 +-
.../cache/query/GridCacheTwoStepQuery.java | 17 +
.../cache/transactions/IgniteInternalTx.java | 5 +-
.../cache/transactions/IgniteTxAdapter.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 38 +-
.../transactions/IgniteTxLocalAdapter.java | 2 +-
.../cache/transactions/IgniteTxManager.java | 173 ++----
.../datastreamer/DataStreamerImpl.java | 2 +
.../processors/igfs/IgfsDataManager.java | 3 +
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../internal/processors/igfs/IgfsUtils.java | 11 +-
.../internal/visor/query/VisorQueryArg.java | 14 +-
.../internal/visor/query/VisorQueryJob.java | 2 +
.../resources/META-INF/classnames.properties | 12 +-
.../internal/GridUpdateNotifierSelfTest.java | 21 +-
.../processors/cache/CacheGetFromJobTest.java | 110 ++++
.../GridCacheAbstractFailoverSelfTest.java | 4 +-
.../GridCacheAbstractNodeRestartSelfTest.java | 94 ++--
...xOriginatingNodeFailureAbstractSelfTest.java | 2 +-
...rDisabledPrimaryNodeFailureRecoveryTest.java | 31 ++
...rtitionedPrimaryNodeFailureRecoveryTest.java | 31 ++
...woBackupsPrimaryNodeFailureRecoveryTest.java | 37 ++
...ePrimaryNodeFailureRecoveryAbstractTest.java | 533 +++++++++++++++++++
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../GridCacheReplicatedNodeRestartSelfTest.java | 2 +
.../IgniteCacheExpiryPolicyAbstractTest.java | 2 +-
.../IgniteCacheExpiryPolicyTestSuite.java | 2 +
.../expiry/IgniteCacheTtlCleanupSelfTest.java | 85 +++
.../igfs/IgfsClientCacheSelfTest.java | 132 +++++
.../processors/igfs/IgfsOneClientNodeTest.java | 133 +++++
.../processors/igfs/IgfsStreamsSelfTest.java | 2 +-
.../testsuites/IgniteCacheRestartTestSuite.java | 5 +-
.../IgniteCacheTxRecoverySelfTestSuite.java | 4 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 3 +
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 4 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
.../processors/query/h2/IgniteH2Indexing.java | 4 +
.../processors/query/h2/sql/GridSqlQuery.java | 20 +
.../query/h2/sql/GridSqlQueryParser.java | 10 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 11 +-
.../processors/query/h2/sql/GridSqlSelect.java | 2 +-
.../processors/query/h2/sql/GridSqlUnion.java | 2 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 3 +
.../h2/twostep/GridReduceQueryExecutor.java | 119 ++++-
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 21 +
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
.../ignite/schema/generator/CodeGenerator.java | 41 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
.../commands/cache/VisorCacheScanCommand.scala | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 6 +-
95 files changed, 2916 insertions(+), 1514 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --cc modules/cloud/pom.xml
index 91ba978,ddc2858..754491e
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@@ -103,4 -103,4 +103,4 @@@
</dependencies>
--</project>
++</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/modules/gce/pom.xml
----------------------------------------------------------------------
diff --cc modules/gce/pom.xml
index 1061aee,e4198b8..b33d76f
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@@ -89,4 -89,4 +89,4 @@@
</dependencies>
--</project>
++</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
----------------------------------------------------------------------
diff --cc modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
index 5b74cdd,f04aa01..b92d84b
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
@@@ -673,13 -680,15 +680,15 @@@ public class CodeGenerator
if (!groups.isEmpty()) {
add2(src, "// Groups for " + tbl + ".");
- add2(src, (first ? "Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> " : "") +
+ add2(src, (firstGrps ? "Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> " : "") +
- " grps = new LinkedHashMap<>();");
+ "grps = new LinkedHashMap<>();");
add0(src, "");
+ firstGrps = false;
+
for (Map.Entry<String, Map<String, IndexItem>> group : groups.entrySet()) {
add2(src, (firstGrp ? "LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>> " : "") +
- "grpItems = new LinkedHashMap<>();");
+ "grpItems = new LinkedHashMap<>();");
add0(src, "");
for (Map.Entry<String, IndexItem> grpItem : group.getValue().entrySet()) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/pom.xml
----------------------------------------------------------------------
[18/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/eb20e01a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/eb20e01a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/eb20e01a
Branch: refs/heads/ignite-gg-10186
Commit: eb20e01a62dcbbd24b12f818b24cfa1af6261576
Parents: debdc2b acc731c
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 28 20:32:52 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 28 20:32:52 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 13 +
.../spi/checkpoint/s3/S3CheckpointSpi.java | 2 +-
.../clients/src/test/resources/spring-cache.xml | 4 +-
.../src/test/resources/spring-server-node.xml | 4 +-
.../test/resources/spring-server-ssl-node.xml | 4 +-
.../java/org/apache/ignite/IgniteLogger.java | 8 +-
.../java/org/apache/ignite/IgniteServices.java | 2 +-
.../main/java/org/apache/ignite/Ignition.java | 2 +-
.../eviction/sorted/SortedEvictionPolicy.java | 2 +-
.../configuration/ConnectorConfiguration.java | 2 +-
.../configuration/IgniteConfiguration.java | 2 +-
.../ignite/internal/GridJobContextImpl.java | 7 +-
.../org/apache/ignite/internal/IgnitionEx.java | 2 +-
.../internal/cluster/ClusterGroupAdapter.java | 16 +
.../managers/communication/GridIoManager.java | 6 +-
.../deployment/GridDeploymentManager.java | 2 +-
.../GridDeploymentPerVersionStore.java | 3 +-
.../processors/cache/GridCacheMvccManager.java | 2 +-
.../cache/GridCacheSharedContext.java | 2 +-
...ridCacheOptimisticCheckPreparedTxFuture.java | 59 +-
.../distributed/dht/GridDhtLockFuture.java | 18 +-
.../distributed/dht/GridDhtLockRequest.java | 38 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 102 +++-
.../cache/distributed/dht/GridDhtTxLocal.java | 6 +
.../distributed/dht/GridDhtTxLocalAdapter.java | 23 +
.../distributed/dht/GridDhtTxPrepareFuture.java | 10 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 7 +
.../dht/preloader/GridDhtPreloader.java | 2 +-
.../distributed/near/GridNearLockRequest.java | 54 +-
.../cache/distributed/near/GridNearTxLocal.java | 6 +
.../cache/transactions/IgniteInternalTx.java | 5 +
.../cache/transactions/IgniteTxAdapter.java | 10 +
.../cache/transactions/IgniteTxHandler.java | 57 +-
.../cache/transactions/IgniteTxManager.java | 117 +++-
.../ignite/internal/util/GridJavaProcess.java | 4 +
.../util/tostring/GridToStringBuilder.java | 2 +-
.../ignite/internal/visor/cache/VisorCache.java | 92 ++--
.../visor/cache/VisorCacheConfiguration.java | 7 -
.../visor/cache/VisorCacheNodesTask.java | 74 +++
.../cache/VisorCacheStoreConfiguration.java | 35 --
.../cache/VisorCacheTypeFieldMetadata.java | 36 +-
.../visor/cache/VisorCacheTypeMetadata.java | 99 +---
.../internal/visor/igfs/VisorIgfsMetrics.java | 128 +----
.../visor/node/VisorBasicConfiguration.java | 11 +
.../visor/node/VisorNodeDataCollectorJob.java | 2 +-
.../node/VisorNodeEventsCollectorTask.java | 58 +-
.../internal/visor/query/VisorQueryArg.java | 19 +-
.../internal/visor/query/VisorQueryCursor.java | 1 -
.../internal/visor/query/VisorQueryJob.java | 9 +-
.../internal/visor/query/VisorQueryTask.java | 41 --
.../internal/visor/util/VisorEventMapper.java | 13 +
.../internal/visor/util/VisorTaskUtils.java | 2 +-
.../apache/ignite/logger/java/JavaLogger.java | 12 +-
.../apache/ignite/marshaller/Marshaller.java | 14 +-
.../ignite/marshaller/jdk/JdkMarshaller.java | 10 +-
.../optimized/OptimizedMarshaller.java | 8 +-
.../apache/ignite/resources/LoggerResource.java | 2 +-
.../apache/ignite/resources/SpringResource.java | 2 +-
.../org/apache/ignite/services/Service.java | 2 +-
.../ignite/services/ServiceConfiguration.java | 2 +-
.../checkpoint/cache/CacheCheckpointSpi.java | 2 +-
.../spi/checkpoint/jdbc/JdbcCheckpointSpi.java | 2 +-
.../sharedfs/SharedFsCheckpointSpi.java | 4 +-
.../fifoqueue/FifoQueueCollisionSpi.java | 10 +-
.../jobstealing/JobStealingCollisionSpi.java | 14 +-
.../PriorityQueueCollisionSpi.java | 6 +-
.../communication/tcp/TcpCommunicationSpi.java | 12 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 10 +-
.../memory/MemoryEventStorageSpi.java | 10 +-
.../spi/failover/always/AlwaysFailoverSpi.java | 10 +-
.../jobstealing/JobStealingFailoverSpi.java | 6 +-
.../spi/failover/never/NeverFailoverSpi.java | 8 +-
.../apache/ignite/spi/indexing/IndexingSpi.java | 4 +-
.../adaptive/AdaptiveLoadBalancingSpi.java | 12 +-
.../roundrobin/RoundRobinLoadBalancingSpi.java | 10 +-
.../WeightedRandomLoadBalancingSpi.java | 10 +-
.../spi/swapspace/file/FileSwapSpaceSpi.java | 10 +-
.../src/test/config/load/merge-sort-base.xml | 2 +-
.../internal/GridDiscoveryEventSelfTest.java | 30 +-
...ProjectionForCachesOnDaemonNodeSelfTest.java | 147 +++++
.../cache/IgniteCachePutAllRestartTest.java | 203 +++++++
.../cache/IgniteCacheTxPreloadNoWriteTest.java | 29 +-
...xOriginatingNodeFailureAbstractSelfTest.java | 6 +-
...cOriginatingNodeFailureAbstractSelfTest.java | 7 +-
...itionedTxOriginatingNodeFailureSelfTest.java | 2 -
.../near/IgniteCacheNearTxRollbackTest.java | 133 +++++
.../logger/java/IgniteJavaLoggerTest.java | 65 ---
.../ignite/logger/java/JavaLoggerTest.java | 65 +++
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 5 +-
.../junits/logger/GridTestLog4jLogger.java | 10 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 2 +
.../IgniteCacheFailoverTestSuite.java | 8 +-
.../testsuites/IgniteCacheRestartTestSuite.java | 3 +-
.../testsuites/IgniteLoggingSelfTestSuite.java | 2 +-
.../processors/hadoop/HadoopProcessor.java | 2 +-
.../ignite/logger/jcl/IgniteJclLogger.java | 167 ------
.../org/apache/ignite/logger/jcl/JclLogger.java | 167 ++++++
.../ignite/logger/jcl/IgniteJclLoggerTest.java | 48 --
.../apache/ignite/logger/jcl/JclLoggerTest.java | 48 ++
.../ignite/testsuites/IgniteJclTestSuite.java | 2 +-
.../apache/ignite/logger/log4j/Log4JLogger.java | 8 +-
.../ignite/logger/slf4j/GridSlf4jLogger.java | 138 -----
.../apache/ignite/logger/slf4j/Slf4jLogger.java | 138 +++++
.../spi/deployment/uri/UriDeploymentSpi.java | 2 +-
.../ignite/visor/commands/VisorConsole.scala | 314 ++++++-----
.../visor/commands/VisorConsoleCommand.scala | 77 ---
.../ignite/visor/commands/VisorTextTable.scala | 539 ------------------
.../visor/commands/ack/VisorAckCommand.scala | 42 +-
.../commands/alert/VisorAlertCommand.scala | 35 +-
.../commands/cache/VisorCacheClearCommand.scala | 51 +-
.../commands/cache/VisorCacheCommand.scala | 34 +-
.../commands/cache/VisorCacheScanCommand.scala | 60 +-
.../commands/cache/VisorCacheStopCommand.scala | 30 +-
.../commands/cache/VisorCacheSwapCommand.scala | 66 +--
.../commands/common/VisorConsoleCommand.scala | 90 +++
.../visor/commands/common/VisorTextTable.scala | 543 +++++++++++++++++++
.../config/VisorConfigurationCommand.scala | 438 +++++++--------
.../commands/deploy/VisorDeployCommand.scala | 47 +-
.../commands/disco/VisorDiscoveryCommand.scala | 58 +-
.../commands/events/VisorEventsCommand.scala | 338 +++++-------
.../visor/commands/gc/VisorGcCommand.scala | 130 ++---
.../visor/commands/kill/VisorKillCommand.scala | 53 +-
.../visor/commands/node/VisorNodeCommand.scala | 47 +-
.../visor/commands/ping/VisorPingCommand.scala | 41 +-
.../commands/start/VisorStartCommand.scala | 34 +-
.../commands/tasks/VisorTasksCommand.scala | 76 +--
.../commands/top/VisorTopologyCommand.scala | 36 +-
.../visor/commands/vvm/VisorVvmCommand.scala | 32 +-
.../scala/org/apache/ignite/visor/visor.scala | 286 +++++++---
.../ignite/visor/VisorTextTableSpec.scala | 3 +-
pom.xml | 5 +-
131 files changed, 3445 insertions(+), 2923 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb20e01a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
[41/50] [abbrv] incubator-ignite git commit: # Fix code style.
Posted by sb...@apache.org.
# Fix code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/39ae0c8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/39ae0c8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/39ae0c8c
Branch: refs/heads/ignite-gg-10186
Commit: 39ae0c8c85a8a10453889df984f9beb03e8693de
Parents: 29da67c
Author: sevdokimov <se...@gridgain.com>
Authored: Thu May 7 18:17:48 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Thu May 7 18:18:09 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/internal/util/lang/GridFilteredIterator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/39ae0c8c/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
index b1df224..f3240d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
@@ -35,7 +35,7 @@ public abstract class GridFilteredIterator<T> implements Iterator<T> {
/**
* @param it Iterator.
*/
- public GridFilteredIterator(Iterator<? extends T> it) {
+ protected GridFilteredIterator(Iterator<? extends T> it) {
assert it != null;
this.it = it;
[14/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7814b53c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7814b53c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7814b53c
Branch: refs/heads/ignite-gg-10186
Commit: 7814b53ca63325d33d2340563f00b0c5a06355c2
Parents: a554779 5fb7948
Author: avinogradov <av...@gridgain.com>
Authored: Mon Apr 27 17:47:15 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon Apr 27 17:47:15 2015 +0300
----------------------------------------------------------------------
.../processors/cache/CacheInvokeResult.java | 24 ++++++++++++---
.../processors/cache/GridCacheAdapter.java | 2 +-
.../processors/cache/GridCacheMapEntry.java | 4 +--
.../processors/cache/GridCacheReturn.java | 5 +--
.../dht/atomic/GridDhtAtomicCache.java | 3 +-
.../local/atomic/GridLocalAtomicCache.java | 6 ++--
.../top/GridTopologyCommandHandler.java | 3 +-
.../DataStreamerMultiThreadedSelfTest.java | 19 +++++++++---
.../GridSwapSpaceSpiAbstractSelfTest.java | 2 +-
.../query/h2/sql/BaseH2CompareQueryTest.java | 32 ++++++++++----------
10 files changed, 63 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
[27/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e4069876
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e4069876
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e4069876
Branch: refs/heads/ignite-gg-10186
Commit: e406987615bef30b759fabe466abdfdab6d70e65
Parents: 957c206 139aa27
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 30 18:50:33 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 30 18:50:33 2015 +0300
----------------------------------------------------------------------
.../ignite/compute/ComputeTaskAdapter.java | 14 +-
.../processors/cache/GridCacheAdapter.java | 503 ++++++++++---------
.../processors/cache/GridCacheProcessor.java | 109 ++--
.../discovery/tcp/TcpClientDiscoverySpi.java | 4 -
.../spi/discovery/tcp/TcpDiscoverySpi.java | 4 -
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 8 +-
.../tcp/TcpClientDiscoverySelfTest.java | 8 +
pom.xml | 46 +-
8 files changed, 384 insertions(+), 312 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e4069876/pom.xml
----------------------------------------------------------------------
[31/50] [abbrv] incubator-ignite git commit: # ignite-sprint-5 fixed
test
Posted by sb...@apache.org.
# ignite-sprint-5 fixed 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/da3d9e73
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/da3d9e73
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/da3d9e73
Branch: refs/heads/ignite-gg-10186
Commit: da3d9e73d182b77d27902871c19817f439308b2b
Parents: 114a852
Author: sboikov <sb...@gridgain.com>
Authored: Tue May 5 09:36:52 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue May 5 09:36:52 2015 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridCacheDhtPreloadSelfTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da3d9e73/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
index f04b87f..5b63c6a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
@@ -266,7 +266,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
ClusterNode node = evt.discoveryNode();
return evt.type() == EVT_CACHE_REBALANCE_STOPPED && node.id().equals(nodeId) &&
- evt.discoveryEventType() == EVT_NODE_LEFT;
+ (evt.discoveryEventType() == EVT_NODE_LEFT || evt.discoveryEventType() == EVT_NODE_FAILED);
}
}, EVT_CACHE_REBALANCE_STOPPED));
[25/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d0798504
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d0798504
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d0798504
Branch: refs/heads/ignite-gg-10186
Commit: d0798504652d09b583c7e9436dd619461aea1b05
Parents: b4c424f 7121619
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 30 16:12:38 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 30 16:12:38 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheTtlManager.java | 168 ++++++++++++-------
.../processors/cache/GridCacheUtils.java | 5 +-
.../IgniteCacheEntryListenerAbstractTest.java | 4 +-
pom.xml | 51 ++++++
4 files changed, 166 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d0798504/pom.xml
----------------------------------------------------------------------
[47/50] [abbrv] incubator-ignite git commit: # ignite-sprint-5 Fixed
compilation.
Posted by sb...@apache.org.
# ignite-sprint-5 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/17bf271b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/17bf271b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/17bf271b
Branch: refs/heads/ignite-gg-10186
Commit: 17bf271b2da8c0aba68261069c1f61d876c1db96
Parents: 0b91761
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri May 8 10:38:32 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri May 8 10:38:32 2015 +0700
----------------------------------------------------------------------
.../scala/org/apache/ignite/scalar/ScalarConversions.scala | 8 --------
1 file changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17bf271b/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala b/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
index d9565af..32e6758 100644
--- a/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
+++ b/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
@@ -867,14 +867,6 @@ trait ScalarConversions {
GridFunc.as(r)
/**
- * Implicit converter from `java.util.concurrent.Callable` to `GridOutClosure`.
- *
- * @param c Java callable to convert.
- */
- implicit def toOutClosure2[R](c: java.util.concurrent.Callable[R]): IgniteOutClosure[R] =
- GridFunc.as0(c)
-
- /**
* Implicit converter from Scala predicate to Scala wrapping predicate.
*
* @param f Scala predicate to convert.
[24/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b4c424f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b4c424f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b4c424f2
Branch: refs/heads/ignite-gg-10186
Commit: b4c424f2465f696f8c19f44e23bc77980761f005
Parents: 2f24ee3 2a176e4
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Apr 30 15:21:28 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Apr 30 15:21:28 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 2 +-
assembly/release-base.xml | 2 +
assembly/release-schema-import.xml | 50 ++++++
.../managers/communication/GridIoManager.java | 8 +-
...CacheLoadingConcurrentGridStartSelfTest.java | 154 +++++++++++++++++++
...GridCacheLoadingConcurrentGridStartTest.java | 154 -------------------
.../ignite/testsuites/IgniteCacheTestSuite.java | 2 +-
modules/schema-import/pom.xml | 6 +-
pom.xml | 137 ++++++++++++++---
9 files changed, 335 insertions(+), 180 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b4c424f2/modules/schema-import/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b4c424f2/pom.xml
----------------------------------------------------------------------
[07/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/300cc75e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/300cc75e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/300cc75e
Branch: refs/heads/ignite-gg-10186
Commit: 300cc75e8cb6546e1537081583e55e7fae165893
Parents: cdbaaba
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 23 16:03:50 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 23 16:03:50 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheP2pUnmarshallingErrorTest.java | 76 +++++++++-----------
.../IgniteCacheP2pUnmarshallingErrorTxTest.java | 16 ++---
2 files changed, 40 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/300cc75e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index 7edbff2..1f622bd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -100,11 +100,13 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
-
+ out.writeObject(field);
}
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ field = (String)in.readObject();
+
if (readCnt.decrementAndGet() <= 0) { //will throw exception on backup node only
throw new IOException("Class can not be unmarshalled");
}
@@ -112,74 +114,60 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
}
/**
- * Test key 2. Unmarshalling always failed.
+ * Sends put atomically and handles fail.
*/
- public static class TestKeyAlwaysFailed extends TestKey {
- /** Test key 2. */
- public TestKeyAlwaysFailed(String field) {
- super(field);
- }
+ protected void failAtomicPut() {
+ try {
+ jcache(0).put(new TestKey("1"), "");
- /** Test key 2. */
- public TestKeyAlwaysFailed() {
+ assert false : "p2p marshalling failed, but error response was not sent";
}
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- readCnt.decrementAndGet();
- throw new IOException("Class can not be unmarshalled"); //will throw exception on primary node
+ catch (CacheException e) {
+ assert X.hasCause(e, IOException.class);
}
+ assert readCnt.get() == 0; //ensure we have read count as expected.
}
/**
- * Tests that correct response will be sent to client node in case of unmarshalling failed.
+ * Sends get atomically and handles fail.
*/
- public void testResponseMessageOnUnmarshallingFailed() {
- //Checking failed unmarshalling on primary node.
- readCnt.set(1);
-
+ protected void failAtomicGet() {
try {
- jcache(0).put(new TestKeyAlwaysFailed("1"), ""); //put will fail at primary node.
+ jcache(0).get(new TestKey("1"));
assert false : "p2p marshalling failed, but error response was not sent";
}
catch (CacheException e) {
assert X.hasCause(e, IOException.class);
}
+ }
- assert readCnt.get() == 0; //put request should not be handled by backup node in case failed at primary.
-
- try {
- assert jcache(0).get(new TestKeyAlwaysFailed("1")) == null;
+ /**
+ * Tests that correct response will be sent to client node in case of unmarshalling failed.
+ */
+ public void testResponseMessageOnUnmarshallingFailed() {
+ //GridNearAtomicUpdateRequest unmarshalling failed test
+ readCnt.set(1);
- assert false : "p2p marshalling failed, but error response was not sent";
- }
- catch (CacheException e) {
- assert X.hasCause(e, IOException.class);
- }
+ failAtomicPut();
- assert grid(0).cachex().entrySet().size() == 0;
+ //GridNearGetRequest unmarshalling failed test
+ readCnt.set(1);
- //Checking failed unmarshalling on backup node.
- readCnt.set(2); //put request will be unmarshalled twice (at primary and at backup node).
+ failAtomicGet();
- try {
- jcache(0).put(new TestKey("1"), ""); //put will fail at backup node only.
+ readCnt.set(100);
- assert false : "p2p marshalling failed, but error response was not sent";
- }
- catch (CacheException e) {
- assert X.hasCause(e, IOException.class);
- }
+ assert jcache(0).get(new TestKey("1")) == null;
- assert readCnt.get() == 0; //put request should be handled by primary and backup node.
+ readCnt.set(2);
- // Need to have no exception while unmarshalling getKeyResponse.
- readCnt.set(3); //get response will me unmarshalled twice (request at primary node and response at client).
+ //GridDhtAtomicUpdateRequest unmarshalling failed test
+ failAtomicPut();
- assert jcache(0).get(new TestKey("1")) == null;
+ readCnt.set(100);
- assert grid(0).cachex().entrySet().size() == 0;
+ assert jcache(0).get(new TestKey("1")) != null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/300cc75e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
index cb6d444..ed3749f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
@@ -50,7 +50,7 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
assert X.hasCause(e, IOException.class);
}
- assert readCnt.get() == 0; //ensure we have read counts as expected.
+ assert readCnt.get() == 0; //ensure we have read count as expected.
}
/**
@@ -63,11 +63,11 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
assert false : "p2p marshalling failed, but error response was not sent";
}
- catch (IgniteException e) {
- assert X.hasCause(e, IOException.class);
- }
+// catch (IgniteException e) {
+// assert X.hasCause(e, IOException.class);
+// }
- assert readCnt.get() == 0; //ensure we have read counts as expected.
+ assert readCnt.get() == 0; //ensure we have read count as expected.
}
/**
@@ -84,9 +84,9 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
//
// failOptimistic();
-// readCnt.set(1);
-//
-// failPessimictic();
+ readCnt.set(100);
+
+ failPessimictic();
}
}
[21/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b0374bca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b0374bca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b0374bca
Branch: refs/heads/ignite-gg-10186
Commit: b0374bca8929687f6398076c795b68673fa244ca
Parents: b45679c
Author: avinogradov <av...@gridgain.com>
Authored: Wed Apr 29 15:25:22 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed Apr 29 15:25:22 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 13 +++++++
.../dht/preloader/GridDhtForceKeysResponse.java | 36 ++++++++++++++++----
2 files changed, 42 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0374bca/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 14d6f7c..a6cbc37 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
@@ -302,6 +302,13 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
}
+ /**
+ * Sends response on failed message.
+ * @param nodeId node id.
+ * @param res response.
+ * @param cctx shared context.
+ * @param plc grid io policy.
+ */
private void sendResponseOnFailedMessage(UUID nodeId, GridCacheMessage res, GridCacheSharedContext cctx,
GridIoPolicy plc) {
try {
@@ -313,6 +320,12 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
}
+ /**
+ * Processes failed messages.
+ * @param nodeId niode id.
+ * @param msg message.
+ * @throws IgniteCheckedException
+ */
private void processFailedMessage(UUID nodeId, GridCacheMessage msg) throws IgniteCheckedException {
GridCacheContext ctx = cctx.cacheContext(msg.cacheId());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0374bca/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index 5c6e24f..41ce0be 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -43,8 +43,12 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
private IgniteUuid miniId;
/** Error. */
+ @GridDirectTransient
private volatile IgniteCheckedException err;
+ /** Serialized error. */
+ private byte[] errBytes;
+
/** Missed (not found) keys. */
@GridToStringInclude
@GridDirectCollection(KeyCacheObject.class)
@@ -160,6 +164,8 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
for (GridCacheEntryInfo info : infos)
info.marshal(cctx);
}
+
+ errBytes = ctx.marshaller().marshal(err);
}
/** {@inheritDoc} */
@@ -175,6 +181,8 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
for (GridCacheEntryInfo info : infos)
info.unmarshal(cctx, ldr);
}
+
+ err = ctx.marshaller().unmarshal(errBytes, ldr);
}
/** {@inheritDoc} */
@@ -193,24 +201,30 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
switch (writer.state()) {
case 3:
- if (!writer.writeIgniteUuid("futId", futId))
+ if (!writer.writeByteArray("errBytes", errBytes))
return false;
writer.incrementState();
case 4:
- if (!writer.writeCollection("infos", infos, MessageCollectionItemType.MSG))
+ if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
case 5:
- if (!writer.writeIgniteUuid("miniId", miniId))
+ if (!writer.writeCollection("infos", infos, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
case 6:
+ if (!writer.writeIgniteUuid("miniId", miniId))
+ return false;
+
+ writer.incrementState();
+
+ case 7:
if (!writer.writeCollection("missedKeys", missedKeys, MessageCollectionItemType.MSG))
return false;
@@ -233,7 +247,7 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
switch (reader.state()) {
case 3:
- futId = reader.readIgniteUuid("futId");
+ errBytes = reader.readByteArray("errBytes");
if (!reader.isLastRead())
return false;
@@ -241,7 +255,7 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
reader.incrementState();
case 4:
- infos = reader.readCollection("infos", MessageCollectionItemType.MSG);
+ futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
return false;
@@ -249,7 +263,7 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
reader.incrementState();
case 5:
- miniId = reader.readIgniteUuid("miniId");
+ infos = reader.readCollection("infos", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
return false;
@@ -257,6 +271,14 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
reader.incrementState();
case 6:
+ miniId = reader.readIgniteUuid("miniId");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 7:
missedKeys = reader.readCollection("missedKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -276,7 +298,7 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 7;
+ return 8;
}
/** {@inheritDoc} */
[17/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/debdc2be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/debdc2be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/debdc2be
Branch: refs/heads/ignite-gg-10186
Commit: debdc2beb84ca2a525fddad18094afc12a39be26
Parents: cf6e435 bd3a572
Author: avinogradov <av...@gridgain.com>
Authored: Mon Apr 27 18:45:21 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon Apr 27 18:45:21 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/Ignition.java | 44 ++++
.../org/apache/ignite/internal/IgnitionEx.java | 165 +++++++++++++-
.../util/spring/IgniteSpringHelper.java | 54 ++++-
.../util/spring/IgniteSpringHelperImpl.java | 217 +++++++++++++++----
.../IgniteStartFromStreamConfigurationTest.java | 50 +++++
.../testsuites/IgniteSpringTestSuite.java | 2 +
6 files changed, 487 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
[20/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b45679c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b45679c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b45679c1
Branch: refs/heads/ignite-gg-10186
Commit: b45679c197da2a5233f0d12ddd80c60761d9f4ff
Parents: 1f35f3a 77d092c
Author: avinogradov <av...@gridgain.com>
Authored: Wed Apr 29 14:51:02 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed Apr 29 14:51:02 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 22 +++---
.../processors/cache/IgniteCacheProxy.java | 10 +--
.../distributed/GridCacheLockAbstractTest.java | 75 ++++++++++++++++++++
3 files changed, 88 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
[06/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cdbaaba4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cdbaaba4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cdbaaba4
Branch: refs/heads/ignite-gg-10186
Commit: cdbaaba4c94b7670aae3e174419ec5cf61d4030b
Parents: 0d982f7 75425c6
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 23 15:01:56 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 23 15:01:56 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/CacheInterceptor.java | 9 +-
.../configuration/CacheConfiguration.java | 30 ++-
.../configuration/IgniteConfiguration.java | 107 +++++++++++
.../ignite/configuration/TopologyValidator.java | 35 ++++
.../org/apache/ignite/internal/IgnitionEx.java | 8 +-
.../ignite/internal/MarshallerContextImpl.java | 2 +-
.../connection/GridClientNioTcpConnection.java | 9 +-
.../managers/communication/GridIoManager.java | 33 +++-
.../GridLifecycleAwareMessageFilter.java | 35 ++++
.../discovery/GridDiscoveryManager.java | 18 +-
.../cache/GridCacheAffinityManager.java | 12 --
.../GridCachePartitionExchangeManager.java | 5 +-
.../processors/cache/IgniteCacheProxy.java | 15 +-
.../cache/affinity/GridCacheAffinityImpl.java | 2 +-
.../distributed/dht/GridDhtTopologyFuture.java | 8 +
.../dht/atomic/GridNearAtomicUpdateFuture.java | 7 +
.../colocated/GridDhtColocatedLockFuture.java | 24 ++-
.../preloader/GridDhtPartitionSupplyPool.java | 2 +-
.../GridDhtPartitionsExchangeFuture.java | 17 ++
.../distributed/near/GridNearAtomicCache.java | 2 +-
.../distributed/near/GridNearLockFuture.java | 26 ++-
.../near/GridNearTransactionalCache.java | 2 +-
.../near/GridNearTxPrepareFuture.java | 20 ++
.../transactions/IgniteTxLocalAdapter.java | 2 +-
.../IgniteCacheObjectProcessorImpl.java | 2 +-
.../processors/job/GridJobProcessor.java | 6 +
.../processors/query/GridQueryIndexing.java | 4 +-
.../processors/query/GridQueryProcessor.java | 2 +-
.../resources/META-INF/classnames.properties | 41 ++---
.../cache/GridCacheAbstractFullApiSelfTest.java | 4 +-
.../cache/IgniteExcangeFutureHistoryTest.java | 74 ++++++++
...gniteTopologyValidatorAbstractCacheTest.java | 183 +++++++++++++++++++
...iteTopologyValidatorAbstractTxCacheTest.java | 125 +++++++++++++
...ValidatorNearPartitionedAtomicCacheTest.java | 30 +++
...logyValidatorNearPartitionedTxCacheTest.java | 30 +++
...logyValidatorPartitionedAtomicCacheTest.java | 49 +++++
...TopologyValidatorPartitionedTxCacheTest.java | 30 +++
...ologyValidatorReplicatedAtomicCacheTest.java | 49 +++++
...eTopologyValidatorReplicatedTxCacheTest.java | 30 +++
.../IgniteCachePutGetRestartAbstractTest.java | 2 +-
...arDisabledFairAffinityPutGetRestartTest.java | 35 ++++
...acheSortedEvictionPolicyPerformanceTest.java | 135 ++++++++++++++
.../GridCacheLocalIsolatedNodesSelfTest.java | 102 +++++++++++
.../testframework/junits/GridAbstractTest.java | 15 ++
.../IgniteCacheFailoverTestSuite.java | 3 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 6 +
.../IgniteTopologyValidatorTestSuit.java | 43 +++++
.../processors/query/h2/IgniteH2Indexing.java | 6 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 34 +++-
.../h2/twostep/GridReduceQueryExecutor.java | 34 +++-
.../h2/GridIndexingSpiAbstractSelfTest.java | 2 +-
.../ignite/schema/generator/CodeGenerator.java | 60 +++++-
.../ignite/internal/GridFactorySelfTest.java | 3 +-
pom.xml | 14 +-
54 files changed, 1480 insertions(+), 103 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cdbaaba4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
[36/50] [abbrv] incubator-ignite git commit: # Refactoring
TcpDiscoverySelfTest: replace TcpDiscovery.onBeforeMessageSentAcrossRing()
with listeners.
Posted by sb...@apache.org.
# Refactoring TcpDiscoverySelfTest: replace TcpDiscovery.onBeforeMessageSentAcrossRing() with listeners.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bd7ae302
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bd7ae302
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bd7ae302
Branch: refs/heads/ignite-gg-10186
Commit: bd7ae302a11ddfe145ce85dd1fecc4403e5d2dc5
Parents: acb9f1c
Author: sevdokimov <se...@gridgain.com>
Authored: Wed May 6 16:14:06 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Wed May 6 16:14:20 2015 +0300
----------------------------------------------------------------------
.../spi/discovery/tcp/TcpDiscoverySpi.java | 22 ++++---
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 65 +++++++-------------
2 files changed, 38 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd7ae302/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index add83b3..46d90b5 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -288,6 +288,10 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
@SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized")
private ConcurrentLinkedDeque<String> debugLog;
+ /** */
+ private final CopyOnWriteArrayList<IgniteInClosure<TcpDiscoveryAbstractMessage>> sendMsgLsnrs =
+ new CopyOnWriteArrayList<>();
+
/** {@inheritDoc} */
@IgniteInstanceResource
@Override public void injectResources(Ignite ignite) {
@@ -2064,13 +2068,16 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
/**
* <strong>FOR TEST ONLY!!!</strong>
- * <p>
- * This method is intended for test purposes only.
- *
- * @param msg Message.
*/
- void onBeforeMessageSentAcrossRing(Serializable msg) {
- // No-op.
+ public void addSendMessageListener(IgniteInClosure<TcpDiscoveryAbstractMessage> msg) {
+ sendMsgLsnrs.add(msg);
+ }
+
+ /**
+ * <strong>FOR TEST ONLY!!!</strong>
+ */
+ public void removeSendMessageListener(IgniteInClosure<TcpDiscoveryAbstractMessage> msg) {
+ sendMsgLsnrs.remove(msg);
}
/**
@@ -2679,7 +2686,8 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
assert ring.hasRemoteNodes();
- onBeforeMessageSentAcrossRing(msg);
+ for (IgniteInClosure<TcpDiscoveryAbstractMessage> msgLsnr : sendMsgLsnrs)
+ msgLsnr.apply(msg);
if (redirectToClients(msg)) {
for (ClientMessageWorker clientMsgWorker : clientMsgWorkers.values())
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd7ae302/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
index 7bea1eb..5648c31 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
@@ -70,14 +70,7 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- TcpDiscoverySpi spi;
-
- if (gridName.contains("FailBeforeNodeAddedSentSpi"))
- spi = new FailBeforeNodeAddedSentSpi();
- else if (gridName.contains("FailBeforeNodeLeftSentSpi"))
- spi = new FailBeforeNodeLeftSentSpi();
- else
- spi = new TcpDiscoverySpi();
+ TcpDiscoverySpi spi = new TcpDiscoverySpi();
discoMap.put(gridName, spi);
@@ -600,7 +593,17 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
}
}, EVT_NODE_JOINED, EVT_NODE_FAILED);
- startGrid("FailBeforeNodeAddedSentSpi");
+ final Ignite g = startGrid("FailBeforeNodeAddedSentSpi");
+
+ discoMap.get(g.name()).addSendMessageListener(new IgniteInClosure<TcpDiscoveryAbstractMessage>() {
+ @Override public void apply(TcpDiscoveryAbstractMessage msg) {
+ if (msg instanceof TcpDiscoveryNodeAddedMessage) {
+ discoMap.get(g.name()).simulateNodeFailure();
+
+ throw new RuntimeException("Avoid message sending: " + msg.getClass());
+ }
+ }
+ });
startGrid(3);
@@ -620,7 +623,17 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
startGrid(1);
startGrid(2);
- startGrid("FailBeforeNodeLeftSentSpi");
+ final Ignite g = startGrid("FailBeforeNodeLeftSentSpi");
+
+ discoMap.get(g.name()).addSendMessageListener(new IgniteInClosure<TcpDiscoveryAbstractMessage>() {
+ @Override public void apply(TcpDiscoveryAbstractMessage msg) {
+ if (msg instanceof TcpDiscoveryNodeLeftMessage) {
+ discoMap.get(g.name()).simulateNodeFailure();
+
+ throw new RuntimeException("Avoid message sending: " + msg.getClass());
+ }
+ }
+ });
Ignite g3 = startGrid(3);
@@ -954,36 +967,4 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
private Ignite startGridNoOptimize(String gridName) throws Exception {
return G.start(getConfiguration(gridName));
}
-
- /**
- *
- */
- private static class FailBeforeNodeAddedSentSpi extends TcpDiscoverySpi {
- /** */
- private int i;
-
- /** {@inheritDoc} */
- @Override void onBeforeMessageSentAcrossRing(Serializable msg) {
- if (msg instanceof TcpDiscoveryNodeAddedMessage)
- if (++i == 2) {
- simulateNodeFailure();
-
- throw new RuntimeException("Avoid message sending: " + msg.getClass());
- }
- }
- }
-
- /**
- *
- */
- private static class FailBeforeNodeLeftSentSpi extends TcpDiscoverySpi {
- /** {@inheritDoc} */
- @Override void onBeforeMessageSentAcrossRing(Serializable msg) {
- if (msg instanceof TcpDiscoveryNodeLeftMessage) {
- simulateNodeFailure();
-
- throw new RuntimeException("Avoid message sending: " + msg.getClass());
- }
- }
- }
}
[26/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-646' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-646' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/957c206b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/957c206b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/957c206b
Branch: refs/heads/ignite-gg-10186
Commit: 957c206bdea433d9cef1a54d0bba0887d51123e8
Parents: d079850 b0374bc
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 30 16:13:24 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 30 16:13:24 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 314 +++++++++++++++----
.../processors/cache/GridCacheMessage.java | 8 +-
.../dht/atomic/GridDhtAtomicUpdateResponse.java | 8 +
.../dht/atomic/GridNearAtomicUpdateFuture.java | 2 +-
.../atomic/GridNearAtomicUpdateResponse.java | 18 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 6 +
.../dht/preloader/GridDhtForceKeysResponse.java | 54 +++-
.../distributed/near/GridNearGetResponse.java | 8 +-
.../IgniteCacheP2pUnmarshallingErrorTest.java | 189 +++++++++++
...gniteCacheP2pUnmarshallingNearErrorTest.java | 56 ++++
...CacheP2pUnmarshallingRebalanceErrorTest.java | 80 +++++
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 109 +++++++
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 +
...gniteCacheP2pUnmarshallingErrorTestSuit.java | 41 +++
...niteCacheP2pUnmarshallingQueryErrorTest.java | 56 ++++
.../IgniteCacheQuerySelfTestSuite.java | 3 +
16 files changed, 875 insertions(+), 78 deletions(-)
----------------------------------------------------------------------
[02/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a47974c3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a47974c3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a47974c3
Branch: refs/heads/ignite-gg-10186
Commit: a47974c3444da2f1804ca1c0b80cd74f92cdf137
Parents: 7a8e075
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 21 16:33:13 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 21 16:33:13 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 160 ++++++++++++-------
.../distributed/dht/GridDhtCacheAdapter.java | 19 ---
.../dht/atomic/GridDhtAtomicCache.java | 31 +---
.../IgniteCacheP2pUnmarshallingErrorTest.java | 46 +++---
4 files changed, 131 insertions(+), 125 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a47974c3/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 56ee65e..0df824f 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
@@ -24,6 +24,8 @@ import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.managers.deployment.*;
import org.apache.ignite.internal.processors.affinity.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -32,7 +34,6 @@ import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
import org.jsr166.*;
-import java.io.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
@@ -226,68 +227,66 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
unmarshall(nodeId, cacheMsg);
- if (cacheMsg.allowForStartup())
- processMessage(nodeId, cacheMsg, c);
+ if (cacheMsg.classError() != null)
+ processFailedMessage(nodeId, cacheMsg);
else {
- IgniteInternalFuture<?> startFut = startFuture(cacheMsg);
-
- if (startFut.isDone())
+ if (cacheMsg.allowForStartup())
processMessage(nodeId, cacheMsg, c);
else {
- if (log.isDebugEnabled())
- log.debug("Waiting for start future to complete for message [nodeId=" + nodeId +
- ", locId=" + cctx.localNodeId() + ", msg=" + cacheMsg + ']');
-
- // Don't hold this thread waiting for preloading to complete.
- startFut.listen(new CI1<IgniteInternalFuture<?>>() {
- @Override public void apply(final IgniteInternalFuture<?> f) {
- cctx.kernalContext().closure().runLocalSafe(
- new GridPlainRunnable() {
- @Override public void run() {
- rw.readLock();
-
- try {
- if (stopping) {
- if (log.isDebugEnabled())
- log.debug("Received cache communication message while stopping " +
- "(will ignore) [nodeId=" + nodeId + ", msg=" + cacheMsg + ']');
+ IgniteInternalFuture<?> startFut = startFuture(cacheMsg);
- return;
- }
+ if (startFut.isDone())
+ processMessage(nodeId, cacheMsg, c);
+ else {
+ if (log.isDebugEnabled())
+ log.debug("Waiting for start future to complete for message [nodeId=" + nodeId +
+ ", locId=" + cctx.localNodeId() + ", msg=" + cacheMsg + ']');
- f.get();
+ // Don't hold this thread waiting for preloading to complete.
+ startFut.listen(new CI1<IgniteInternalFuture<?>>() {
+ @Override public void apply(final IgniteInternalFuture<?> f) {
+ cctx.kernalContext().closure().runLocalSafe(
+ new GridPlainRunnable() {
+ @Override public void run() {
+ rw.readLock();
- if (log.isDebugEnabled())
- log.debug("Start future completed for message [nodeId=" + nodeId +
- ", locId=" + cctx.localNodeId() + ", msg=" + cacheMsg + ']');
+ try {
+ if (stopping) {
+ if (log.isDebugEnabled())
+ log.debug("Received cache communication message while stopping " +
+ "(will ignore) [nodeId=" + nodeId + ", msg=" + cacheMsg + ']');
- processMessage(nodeId, cacheMsg, c);
- }
- catch (IgniteCheckedException e) {
- // Log once.
- if (startErr.compareAndSet(false, true))
- U.error(log, "Failed to complete preload start future " +
- "(will ignore message) " +
- "[fut=" + f + ", nodeId=" + nodeId + ", msg=" + cacheMsg + ']', e);
- }
- finally {
- rw.readUnlock();
+ return;
+ }
+
+ f.get();
+
+ if (log.isDebugEnabled())
+ log.debug("Start future completed for message [nodeId=" + nodeId +
+ ", locId=" + cctx.localNodeId() + ", msg=" + cacheMsg + ']');
+
+ processMessage(nodeId, cacheMsg, c);
+ }
+ catch (IgniteCheckedException e) {
+ // Log once.
+ if (startErr.compareAndSet(false, true))
+ U.error(log, "Failed to complete preload start future " +
+ "(will ignore message) " +
+ "[fut=" + f + ", nodeId=" + nodeId + ", msg=" + cacheMsg + ']', e);
+ }
+ finally {
+ rw.readUnlock();
+ }
}
}
- }
- );
- }
- });
+ );
+ }
+ });
+ }
}
}
}
catch (Throwable e) {
-// if (X.hasCause(e, ClassNotFoundException.class))
-// U.error(log, "Failed to process message (note that distributed services " +
-// "do not support peer class loading, if you deploy distributed service " +
-// "you should have all required classes in CLASSPATH on all nodes in topology) " +
-// "[senderId=" + nodeId + ", err=" + X.cause(e, ClassNotFoundException.class).getMessage() + ']');
-// else
U.error(log, "Failed to process message [senderId=" + nodeId + ", messageType=" + cacheMsg.getClass() + ']', e);
}
finally {
@@ -298,6 +297,61 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
}
+ private void sendResponseOnFailedMessage(UUID nodeId, GridCacheMessage res, GridCacheContext ctx) {
+ try {
+ ctx.io().send(nodeId, res, ctx.ioPolicy());
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to send get response to node (is node still alive?) [nodeId=" + nodeId +
+ ",res=" + res + ']', e);
+ }
+ }
+
+ private void processFailedMessage(UUID nodeId, GridCacheMessage msg) {
+ GridCacheContext ctx = cctx.cacheContext(msg.cacheId());
+
+ switch (msg.directType()) {
+ case 38: {
+ GridDhtAtomicUpdateRequest req = (GridDhtAtomicUpdateRequest)msg;
+
+ GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(ctx.cacheId(), req.futureVersion());
+
+ res.onError(req.classError());
+
+ sendResponseOnFailedMessage(nodeId, res, ctx);
+ }
+
+ break;
+ case 40: {
+ GridNearAtomicUpdateRequest req = (GridNearAtomicUpdateRequest)msg;
+
+ GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(ctx.cacheId(),
+ nodeId,
+ req.futureVersion());
+
+ res.onError(req.classError());
+
+ sendResponseOnFailedMessage(nodeId, res, ctx);
+ }
+
+ break;
+ case 49: {
+ GridNearGetRequest req = (GridNearGetRequest)msg;
+
+ GridNearGetResponse res = new GridNearGetResponse(ctx.cacheId(),
+ req.futureId(),
+ req.miniId(),
+ req.version());
+
+ res.error(req.classError());
+
+ sendResponseOnFailedMessage(nodeId, res, ctx);
+ }
+
+ break;
+ }
+ }
+
/**
* @param cacheMsg Cache message to get start future.
* @return Preloader start future.
@@ -738,11 +792,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
cacheMsg.finishUnmarshal(cctx, cctx.deploy().globalLoader());
}
catch (IgniteCheckedException e) {
-// if (cacheMsg.ignoreClassErrors() && X.hasCause(e, InvalidClassException.class,
-// ClassNotFoundException.class, NoClassDefFoundError.class, UnsupportedClassVersionError.class))
- cacheMsg.onClassError(e);
-// else
-// throw e;
+ cacheMsg.onClassError(e);
}
catch (Error e) {
if (cacheMsg.ignoreClassErrors() && X.hasCause(e, NoClassDefFoundError.class,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a47974c3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index c6ebe0a..d85bc75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -606,25 +606,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
protected void processNearGetRequest(final UUID nodeId, final GridNearGetRequest req) {
assert ctx.affinityNode();
- if (req.classError() != null) {
- GridNearGetResponse res = new GridNearGetResponse(ctx.cacheId(),
- req.futureId(),
- req.miniId(),
- req.version());
-
- res.error(req.classError());
-
- try {
- ctx.io().send(nodeId, res, ctx.ioPolicy());
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to send get response to node (is node still alive?) [nodeId=" + nodeId +
- ",req=" + req + ", res=" + res + ']', e);
- }
-
- return;
- }
-
long ttl = req.accessTtl();
final CacheExpiryPolicy expiryPlc = CacheExpiryPolicy.forAccess(ttl);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a47974c3/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 ec9e5a6..85f11b5 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
@@ -2329,18 +2329,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
req.nodeId(ctx.localNodeId());
- if (req.classError() != null) {
- GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(ctx.cacheId(),
- nodeId,
- req.futureVersion());
-
- res.onError(req.classError());
-
- sendNearUpdateReply(nodeId, res);
- }
- else {
- updateAllAsyncInternal(nodeId, req, updateReplyClos);
- }
+ updateAllAsyncInternal(nodeId, req, updateReplyClos);
}
/**
@@ -2376,24 +2365,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
// Always send update reply.
GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(ctx.cacheId(), req.futureVersion());
- if (req.classError() != null) {
- res.onError(req.classError());
-
- try {
- ctx.io().send(nodeId, res, ctx.ioPolicy());
- }
- catch (ClusterTopologyCheckedException ignored) {
- U.warn(log, "Failed to send DHT atomic update response to node because it left grid: " +
- req.nodeId());
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to send DHT atomic update response (did node leave grid?) [nodeId=" + nodeId +
- ", req=" + req + ']', e);
- }
-
- return;
- }
-
Boolean replicate = ctx.isDrEnabled();
boolean intercept = req.forceTransformBackups() && ctx.config().getInterceptor() != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a47974c3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index d21c219..60f2226 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -26,11 +26,11 @@ import java.io.*;
import java.util.concurrent.atomic.*;
/**
- * Check behavior on exception while unmarshalling key
+ * Check behavior on exception while unmarshalling key.
*/
public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTest {
- /** Allows to change behavior of readExternal method */
- private static AtomicInteger nodeCnt = new AtomicInteger();
+ /** Allows to change behavior of readExternal method. */
+ private static AtomicInteger readCnt = new AtomicInteger();
/** {@inheritDoc} */
@Override protected int gridCount() {
@@ -67,18 +67,18 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
return cfg;
}
- /** Test key 1 */
+ /** Test key 1. */
public static class TestKey implements Externalizable {
- /** Test key 1 */
+ /** Test key 1. */
public TestKey(String field) {
this.field = field;
}
- /** Test key 1 */
+ /** Test key 1. */
public TestKey() {
}
- /** field */
+ /** field. */
private String field;
/** {@inheritDoc} */
@@ -105,29 +105,28 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- if (nodeCnt.decrementAndGet() < 1) { //will throw exception on backup node only
+ if (readCnt.decrementAndGet() <= 0) { //will throw exception on backup node only
throw new IOException("Class can not be unmarshalled");
}
}
}
/**
- * Test key 2.
- * Unmarshalling always failed.
+ * Test key 2. Unmarshalling always failed.
*/
public static class TestKeyAlwaysFailed extends TestKey {
- /** Test key 2 */
+ /** Test key 2. */
public TestKeyAlwaysFailed(String field) {
super(field);
}
- /** Test key 2 */
+ /** Test key 2. */
public TestKeyAlwaysFailed() {
}
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- nodeCnt.decrementAndGet();
+ readCnt.decrementAndGet();
throw new IOException("Class can not be unmarshalled"); //will throw exception on primary node
}
@@ -138,20 +137,23 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
*/
public void testResponseMessageOnUnmarshallingFailed() {
- nodeCnt.set(1);
+ //Checking failed unmarshalling on primary node.
+ readCnt.set(1);
try {
- jcache(0).put(new TestKeyAlwaysFailed("1"), "");
+ jcache(0).put(new TestKeyAlwaysFailed("1"), ""); //put will fail at primary node.
+
assert false : "p2p marshalling failed, but error response was not sent";
}
catch (CacheException e) {
assert X.hasCause(e, IOException.class);
}
- assert nodeCnt.get() == 0;//put request should not go to backup node in case failed at primary.
+ assert readCnt.get() == 0; //put request should not be handled by backup node in case failed at primary.
try {
assert jcache(0).get(new TestKeyAlwaysFailed("1")) == null;
+
assert false : "p2p marshalling failed, but error response was not sent";
}
catch (CacheException e) {
@@ -160,20 +162,22 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
assert grid(0).cachex().entrySet().size() == 0;
- nodeCnt.set(2); //put request will be unmarshalled twice (at primary and at backup node).
+ //Checking failed unmarshalling on backup node.
+ readCnt.set(2); //put request will be unmarshalled twice (at primary and at backup node).
try {
- jcache(0).put(new TestKey("1"), "");//put will fail at backup node.
+ jcache(0).put(new TestKey("1"), ""); //put will fail at backup node only.
+
assert false : "p2p marshalling failed, but error response was not sent";
}
catch (CacheException e) {
assert X.hasCause(e, IOException.class);
}
- assert nodeCnt.get() == 0;//put request should go to primary and backup node.
+ assert readCnt.get() == 0; //put request should be handled by primary and backup node.
- // Need to have to exception while unmarshalling getKeyResponse.
- nodeCnt.set(3); //get response will me unmarshalled twice (request at primary node and response at client).
+ // Need to have no exception while unmarshalling getKeyResponse.
+ readCnt.set(3); //get response will me unmarshalled twice (request at primary node and response at client).
assert jcache(0).get(new TestKey("1")) == null;
[29/50] [abbrv] incubator-ignite git commit: Release procedure changed
Posted by sb...@apache.org.
Release procedure 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/8c2e03e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8c2e03e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8c2e03e4
Branch: refs/heads/ignite-gg-10186
Commit: 8c2e03e43133d3a546e254fe827a2c4ffc79966a
Parents: 445c0a6
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 30 18:54:50 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 30 18:54:50 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8c2e03e4/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index 7618e6c..1562dc4 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -40,35 +40,27 @@ Specify gpg profile at settings.xml. It will be used to sign sources and artifac
</properties>
</profile>
-Configure access to people.apache.org/~<username>. It necessary to upload sources to site.
-See https://blogs.apache.org/infra/entry/committer_shell_access_to_people for details.
-Specify ignite-site server at settings.xml.
-
-<server>
- <id>ignite-site</id>
- <username>username</username>
- <privateKey>/home/username.ppk</privateKey>
- <passphrase>passphrase</passphrase>
-</server>
-
Ensure you have RELEASE (not SNAPSHOT) version at Ignite poms.
Maven release plugin release:prepare goal can be used to make release tag.
-Deploy Ignite release to maven repository and site:
+Deploy Ignite release candidate to maven repository and dev-svn:
-mvn deploy -P apache-release,gpg,release,scala,lgpl,deploy-ignite-site -Dignite.edition=fabric -DskipTests -Dignite.site=scp://people.apache.org:/home/<username>/public_html -B
+ mvn deploy -P apache-release,gpg,release,scala,lgpl,deploy-ignite-site -Dignite.edition=fabric -DskipTests -B
-You might need to allow connection to people.apache.org. Just do following at console:
+ Binary artifact name can be changed by setting additional property -Dignite.zip.pattern.
+ Sources package name is fixed. Sources package zip will be created automatically when apache-release profile used.
-ssh people.apache.org
+ In case you want to release both fabric and hadoop editions you have to build hadoop first, save /target/bin/*.zip,
+ make "mvn clean" and restore them before deploy step.
-and type "yes" + enter.
+ Nexus staging (repository.apache.org) should be closed when mvn deploy finished.
+ Checkout https://dist.apache.org/repos/dist/dev/incubator/ignite svn. Create new folder with name equals to released
+ version at svn root. Copy target/site folder content to svn/ignite/<version> folder and commit.
-In case you want to release both fabric and hadoop editions you have to build hadoop first, save /target/bin/*.zip, make "mvn clean" and
-restore them before deploy step.
+Start vote based on https://dist.apache.org/repos/dist/dev/incubator/ignite/<version>.
-Start vote based on people.apache.org/~<username>/ignite-version.
-Release nexus staging when version accepted.
+Release nexus staging and copy binaries and sources from https://dist.apache.org/repos/dist/dev/incubator/ignite/<version>
+to https://dist.apache.org/repos/dist/release/incubator/ignite/<version> when version accepted.
JCache TCK compliance
[03/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-646
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/03c54d89
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/03c54d89
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/03c54d89
Branch: refs/heads/ignite-gg-10186
Commit: 03c54d8907a4d77262e659dcae35ac509ad9c480
Parents: a47974c 6304fab
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 21 16:33:42 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 21 16:33:42 2015 +0300
----------------------------------------------------------------------
.../cache/GridCacheEvictionManager.java | 11 +++++-
.../dht/GridDhtAffinityAssignmentResponse.java | 21 +++++++++++-
.../distributed/dht/GridDhtTxFinishFuture.java | 2 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 2 +-
.../GridDiscoveryManagerAliveCacheSelfTest.java | 6 ++--
.../dht/GridCacheDhtPreloadSelfTest.java | 4 +--
...ledFairAffinityMultiNodeFullApiSelfTest.java | 36 ++++++++++++++++++++
...nlyFairAffinityMultiNodeFullApiSelfTest.java | 36 ++++++++++++++++++++
...ledFairAffinityMultiNodeFullApiSelfTest.java | 36 ++++++++++++++++++++
...derFairAffinityMultiNodeFullApiSelfTest.java | 36 ++++++++++++++++++++
...nlyFairAffinityMultiNodeFullApiSelfTest.java | 35 +++++++++++++++++++
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 1 +
...nedFairAffinityMultiNodeFullApiSelfTest.java | 3 +-
.../IgniteCacheFullApiSelfTestSuite.java | 11 ++++--
.../IgniteCacheQueryMultiThreadedSelfTest.java | 1 +
15 files changed, 228 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[11/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/163be30b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/163be30b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/163be30b
Branch: refs/heads/ignite-gg-10186
Commit: 163be30b3b0460967cdba5f8d093eb4ce3c1007a
Parents: db7aa24
Author: avinogradov <av...@gridgain.com>
Authored: Fri Apr 24 19:42:49 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri Apr 24 19:42:49 2015 +0300
----------------------------------------------------------------------
.../cache/IgniteCacheP2pUnmarshallingErrorTest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/163be30b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index a50f07c..277f10d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -32,7 +32,7 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
/** Allows to change behavior of readExternal method. */
protected static AtomicInteger readCnt = new AtomicInteger();
- /** iterable key */
+ /** Iterable key. */
protected static int key = 0;
/** {@inheritDoc} */
@@ -81,7 +81,7 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
public TestKey() {
}
- /** field. */
+ /** Field. */
private String field;
/** {@inheritDoc} */
@@ -160,15 +160,17 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
failAtomicGet();
+ //Check that cache is empty.
readCnt.set(100);
assert jcache(0).get(new TestKey("1")) == null;
+ //GridDhtAtomicUpdateRequest unmarshalling failed test
readCnt.set(2);
- //GridDhtAtomicUpdateRequest unmarshalling failed test
failAtomicPut();
+ //Check that cache is not empty.
readCnt.set(100);
assert jcache(0).get(new TestKey("1")) != null;
[10/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/db7aa241
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/db7aa241
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/db7aa241
Branch: refs/heads/ignite-gg-10186
Commit: db7aa241ac522c9b9720d3c9bd4198fb66b94df2
Parents: 9e4bc10
Author: avinogradov <av...@gridgain.com>
Authored: Fri Apr 24 19:38:04 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri Apr 24 19:38:04 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 15 ++++
.../IgniteCacheP2pUnmarshallingErrorTxTest.java | 72 ++++++++------------
2 files changed, 42 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/db7aa241/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 1fe1f50..c9af788 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
@@ -315,6 +315,21 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
GridCacheContext ctx = cctx.cacheContext(msg.cacheId());
switch (msg.directType()) {
+ case 30: {
+ GridDhtLockRequest req = (GridDhtLockRequest)msg;
+
+ GridDhtLockResponse res = new GridDhtLockResponse(
+ ctx.cacheId(),
+ req.version(),
+ req.futureId(),
+ req.miniId(),
+ 0);
+
+ sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
+ }
+
+ break;
+
case 34:{
GridDhtTxPrepareRequest req = (GridDhtTxPrepareRequest)msg;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/db7aa241/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
index 1a42407..06176aa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
@@ -23,6 +23,7 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.transactions.*;
+import javax.cache.*;
import java.io.*;
/**
@@ -35,8 +36,14 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
return CacheAtomicityMode.TRANSACTIONAL;
}
- @Override protected NearCacheConfiguration nearConfiguration() {
- return null;
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ if (!gridName.endsWith("0"))
+ cfg.getCacheConfiguration()[0].setRebalanceDelay(-1); //allows to check GridDhtLockRequest fail.
+
+ return cfg;
}
/**
@@ -68,28 +75,9 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
assert false : "p2p marshalling failed, but error response was not sent";
}
-// catch (IgniteException e) {
-// assert X.hasCause(e, IOException.class);
-// }
-
- assert readCnt.get() == 0; //ensure we have read count as expected.
- }
-
- /**
- * Sends put with pessimistic lock and handles fail.
- */
- protected void failPessimicticOnCommit() {
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
-
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
-
- tx.commit();
-
- assert false : "p2p marshalling failed, but error response was not sent";
+ catch (CacheException e) {
+ assert X.hasCause(e, IOException.class);
}
-// catch (IgniteException e) {
-// assert X.hasCause(e, IOException.class);
-// }
assert readCnt.get() == 0; //ensure we have read count as expected.
}
@@ -98,32 +86,26 @@ public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmars
* Tests that correct response will be sent to client node in case of unmarshalling failed.
*/
public void testResponseMessageOnUnmarshallingFailed() {
-// //GridNearTxPrepareRequest unmarshalling failed test
-// readCnt.set(2);
-//
-// failOptimistic();
-//
-// //GridDhtTxPrepareRequest unmarshalling failed test
-// readCnt.set(3);
-//
-// failOptimistic();
-
-// //GridNearLockRequest unmarshalling failed test
-// readCnt.set(2);
-//
-// failPessimictic();
-
- //? unmarshalling failed test
- readCnt.set(1000);
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+ //GridNearTxPrepareRequest unmarshalling failed test
+ readCnt.set(2);
- TestKey tstKey = new TestKey(String.valueOf(++key));
- jcache(0).put(tstKey, "");
- jcache(0).lock(tstKey).lock();
- }
+ failOptimistic();
+
+ //GridDhtTxPrepareRequest unmarshalling failed test
+ readCnt.set(3);
+ failOptimistic();
+ //GridNearLockRequest unmarshalling failed test
+ readCnt.set(2);
+ failPessimictic();
+ //GridDhtLockRequest unmarshalling failed test
+ readCnt.set(3);
+
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+ jcache(0).put(new TestKey(String.valueOf(++key)), ""); //No failure at client side.
+ }
}
}
[23/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2f24ee34
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2f24ee34
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2f24ee34
Branch: refs/heads/ignite-gg-10186
Commit: 2f24ee34b3033fc9789b46dd1afdff90abe7cd92
Parents: d617759 81ce0e6
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Apr 30 09:56:40 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Apr 30 09:56:40 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 2 +-
.../ignite/internal/GridUpdateNotifier.java | 66 +++++++++++++---
.../apache/ignite/internal/IgniteKernal.java | 83 +++++++++-----------
.../org/apache/ignite/internal/IgnitionEx.java | 15 +---
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 19 +++--
.../internal/GridUpdateNotifierSelfTest.java | 13 ++-
6 files changed, 121 insertions(+), 77 deletions(-)
----------------------------------------------------------------------
[38/50] [abbrv] incubator-ignite git commit: # sprint-5 Minor fix:
removed redundant space char.
Posted by sb...@apache.org.
# sprint-5 Minor fix: removed redundant space char.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/54e814a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/54e814a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/54e814a7
Branch: refs/heads/ignite-gg-10186
Commit: 54e814a7e8434e33f396733c4acdd0e79ac1524f
Parents: bd7ae30
Author: AKuznetsov <ak...@gridgain.com>
Authored: Thu May 7 15:31:24 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Thu May 7 15:31:24 2015 +0700
----------------------------------------------------------------------
.../java/org/apache/ignite/schema/generator/CodeGenerator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/54e814a7/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
index f8901d2..8a994f2 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
@@ -674,7 +674,7 @@ public class CodeGenerator {
if (!groups.isEmpty()) {
add2(src, "// Groups for " + tbl + ".");
add2(src, (first ? "Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> " : "") +
- " grps = new LinkedHashMap<>();");
+ "grps = new LinkedHashMap<>();");
add0(src, "");
for (Map.Entry<String, Map<String, IndexItem>> group : groups.entrySet()) {
[45/50] [abbrv] incubator-ignite git commit: # Remove unused methods
from GridFunc.
Posted by sb...@apache.org.
# Remove unused methods from GridFunc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/942abe45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/942abe45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/942abe45
Branch: refs/heads/ignite-gg-10186
Commit: 942abe45be1c0f6f844de06c6a6e6b03bedb5566
Parents: 4cf2133
Author: sevdokimov <se...@gridgain.com>
Authored: Thu May 7 20:51:42 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Thu May 7 20:51:42 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/util/lang/GridFunc.java | 7218 +++++-------------
1 file changed, 1842 insertions(+), 5376 deletions(-)
----------------------------------------------------------------------
[37/50] [abbrv] incubator-ignite git commit: "Version changed
Posted by sb...@apache.org.
"Version changed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0c13a08b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0c13a08b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0c13a08b
Branch: refs/heads/ignite-gg-10186
Commit: 0c13a08b7a0fa9e33fadadd3c4472556be338d70
Parents: c3f3dd1
Author: Ignite Teamcity <ig...@apache.org>
Authored: Thu May 7 11:00:19 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Thu May 7 11:00:19 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 14 ++++----------
31 files changed, 34 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 9dda753..3ac5a80 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index ef44603..38a593e 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 43f24bc..83eced2 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index ca93673..c90173f 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 8cb97d0..ddc2858 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9e03dab..15c3d5d 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62612f8..e3a7b97 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 0f8fdc0..cc6843f 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index df69c93..980db73 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 8b2a019..e4198b8 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 1ce3370..dc7a454 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 231808f..fba22c1 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index ed4dc07..f7d0443 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 6ff6039..e808ca3 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 8a3cec3..061e27c 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 9287f12..b6e0928 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index dff0a7e..d855911 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 9097614..95800ac 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 590d3f7..3160cc2 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 2c09ed9..4cda672 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 0684d11..51b5ff0 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 1f78f42..d7109c2 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 1390a39..26dfc14 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 867e9be..82a7983 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 625eeaa..b38de40 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 231a576..c711902 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 07e27a0..a70dd2c 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 4e58ab8..96e7b17 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index de50712..92f9aa7 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 6bd65cc..7298f6b 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c859021..3dafeed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,12 +32,12 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
- <!--fix <attachartifact>...</> at apache-release profile if changed-->
+ <!--fix <attachartifact>...< /> at apache-release profile if changed-->
<ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-incubating</ignite.zip.pattern>
</properties>
@@ -508,14 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact
- file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip"
- classifier="fabric"
- type="zip"/>
- <attachartifact
- file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip"
- classifier="hadoop"
- type="zip"/>
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
[12/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a8a9d108
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a8a9d108
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a8a9d108
Branch: refs/heads/ignite-gg-10186
Commit: a8a9d1089d3bf3d6a4adb56a71aede309fa42977
Parents: 163be30
Author: avinogradov <av...@gridgain.com>
Authored: Mon Apr 27 17:41:10 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon Apr 27 17:41:10 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 72 +++++++++++-
.../atomic/GridNearAtomicUpdateResponse.java | 2 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 6 +
.../dht/preloader/GridDhtForceKeysResponse.java | 19 ++++
.../IgniteCacheP2pUnmarshallingErrorTest.java | 41 ++++---
.../IgniteCacheP2pUnmarshallingErrorTxTest.java | 111 -------------------
...gniteCacheP2pUnmarshallingNearErrorTest.java | 56 ++++++++++
...CacheP2pUnmarshallingRebalanceErrorTest.java | 69 ++++++++++++
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 109 ++++++++++++++++++
...niteCacheP2pUnmarshallingQueryErrorTest.java | 58 ++++++++++
10 files changed, 410 insertions(+), 133 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/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 c9af788..14d6f7c 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
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.managers.deployment.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.lang.*;
@@ -301,7 +302,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
}
- private void sendResponseOnFailedMessage(UUID nodeId, GridCacheMessage res, GridCacheSharedContext cctx, GridIoPolicy plc) {
+ private void sendResponseOnFailedMessage(UUID nodeId, GridCacheMessage res, GridCacheSharedContext cctx,
+ GridIoPolicy plc) {
try {
cctx.io().send(nodeId, res, plc);
}
@@ -311,10 +313,24 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
}
- private void processFailedMessage(UUID nodeId, GridCacheMessage msg) throws IgniteCheckedException{
+ private void processFailedMessage(UUID nodeId, GridCacheMessage msg) throws IgniteCheckedException {
GridCacheContext ctx = cctx.cacheContext(msg.cacheId());
switch (msg.directType()) {
+ case 14: {
+ GridCacheEvictionRequest req = (GridCacheEvictionRequest)msg;
+
+ GridCacheEvictionResponse res = new GridCacheEvictionResponse(
+ ctx.cacheId(),
+ req.futureId(),
+ req.classError() != null
+ );
+
+ sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
+ }
+
+ break;
+
case 30: {
GridDhtLockRequest req = (GridDhtLockRequest)msg;
@@ -330,7 +346,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
break;
- case 34:{
+ case 34: {
GridDhtTxPrepareRequest req = (GridDhtTxPrepareRequest)msg;
GridDhtTxPrepareResponse res = new GridDhtTxPrepareResponse(
@@ -367,13 +383,37 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
nodeId,
req.futureVersion());
- res.onError(req.classError());
+ res.error(req.classError());
+
+ sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
+ }
+
+ break;
+
+ case 42: {
+ GridDhtForceKeysRequest req = (GridDhtForceKeysRequest)msg;
+
+ GridDhtForceKeysResponse res = new GridDhtForceKeysResponse(
+ ctx.cacheId(),
+ req.futureId(),
+ req.miniId()
+ );
+
+ res.error(req.classError());
sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
}
break;
+ case 45: {
+ GridDhtPartitionSupplyMessage req = (GridDhtPartitionSupplyMessage)msg;
+
+ U.error(log, "Supply message cannot be unmarshalled.", req.classError());
+ }
+
+ break;
+
case 49: {
GridNearGetRequest req = (GridNearGetRequest)msg;
@@ -390,6 +430,26 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
break;
+ case 50: {
+ GridNearGetResponse res = (GridNearGetResponse)msg;
+
+ GridPartitionedGetFuture fut = (GridPartitionedGetFuture)ctx.mvcc().future(
+ res.version(), res.futureId());
+
+ if (fut == null) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to find future for get response [sender=" + nodeId + ", res=" + res + ']');
+
+ return;
+ }
+
+ res.error(res.classError());
+
+ fut.onResult(nodeId, res);
+ }
+
+ break;
+
case 51: {
GridNearLockRequest req = (GridNearLockRequest)msg;
@@ -878,7 +938,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
catch (Error e) {
if (cacheMsg.ignoreClassErrors() && X.hasCause(e, NoClassDefFoundError.class,
UnsupportedClassVersionError.class))
- cacheMsg.onClassError(new IgniteCheckedException("Failed to load class during unmarshalling: " + e, e));
+ cacheMsg.onClassError(new IgniteCheckedException("Failed to load class during unmarshalling: " + e, e));
else
throw e;
}
@@ -907,7 +967,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
/** {@inheritDoc} */
- @SuppressWarnings( {"CatchGenericClass", "unchecked"})
+ @SuppressWarnings({"CatchGenericClass", "unchecked"})
@Override public void onMessage(final UUID nodeId, Object msg) {
if (log.isDebugEnabled())
log.debug("Received cache ordered message [nodeId=" + nodeId + ", msg=" + msg + ']');
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index 773b847..330e43c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -140,7 +140,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
* Sets update error.
* @param err
*/
- public void onError(IgniteCheckedException err){
+ public void error(IgniteCheckedException err){
this.err = err;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
index 61aaa14..78966d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
@@ -451,6 +451,12 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec
* @param res Result callback.
*/
void onResult(GridDhtForceKeysResponse res) {
+ if (res.error() != null) {
+ onDone(res.error());
+
+ return;
+ }
+
Collection<KeyCacheObject> missedKeys = res.missedKeys();
boolean remapMissed = false;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index 8919185..1d49b34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -42,6 +42,10 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
/** Mini-future ID. */
private IgniteUuid miniId;
+ /** Error. */
+ @GridDirectTransient
+ private volatile IgniteCheckedException err;
+
/** Missed (not found) keys. */
@GridToStringInclude
@GridDirectCollection(KeyCacheObject.class)
@@ -73,6 +77,21 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
this.miniId = miniId;
}
+ /**
+ * Sets error.
+ * @param err
+ */
+ public void error(IgniteCheckedException err){
+ this.err = err;
+ }
+
+ /**
+ * @return Error, if any.
+ */
+ public IgniteCheckedException error() {
+ return err;
+ }
+
/** {@inheritDoc} */
@Override public boolean allowForStartup() {
return true;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index 277f10d..b358b15 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -82,6 +83,7 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
}
/** Field. */
+ @QuerySqlField(index = true)
private String field;
/** {@inheritDoc} */
@@ -110,7 +112,7 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
field = (String)in.readObject();
- if (readCnt.decrementAndGet() <= 0) { //will throw exception on backup node only
+ if (readCnt.decrementAndGet() <= 0) {
throw new IOException("Class can not be unmarshalled");
}
}
@@ -119,9 +121,9 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
/**
* Sends put atomically and handles fail.
*/
- protected void failAtomicPut() {
+ protected void failAtomicPut(int k) {
try {
- jcache(0).put(new TestKey("1"), "");
+ jcache(0).put(new TestKey(String.valueOf(k)), "");
assert false : "p2p marshalling failed, but error response was not sent";
}
@@ -135,9 +137,9 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
/**
* Sends get atomically and handles fail.
*/
- protected void failAtomicGet() {
+ protected void failAtomicGet(int k) {
try {
- jcache(0).get(new TestKey("1"));
+ jcache(0).get(new TestKey(String.valueOf(k)));
assert false : "p2p marshalling failed, but error response was not sent";
}
@@ -149,30 +151,39 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
/**
* Tests that correct response will be sent to client node in case of unmarshalling failed.
*/
- public void testResponseMessageOnUnmarshallingFailed() {
+ public void testResponseMessageOnUnmarshallingFailed() throws Exception {
//GridNearAtomicUpdateRequest unmarshalling failed test
readCnt.set(1);
- failAtomicPut();
-
- //GridNearGetRequest unmarshalling failed test
- readCnt.set(1);
-
- failAtomicGet();
+ failAtomicPut(++key);
//Check that cache is empty.
readCnt.set(100);
- assert jcache(0).get(new TestKey("1")) == null;
+ assert jcache(0).get(new TestKey(String.valueOf(key))) == null;
//GridDhtAtomicUpdateRequest unmarshalling failed test
readCnt.set(2);
- failAtomicPut();
+ failAtomicPut(++key);
//Check that cache is not empty.
readCnt.set(100);
- assert jcache(0).get(new TestKey("1")) != null;
+ assert jcache(0).get(new TestKey(String.valueOf(key))) != null;
+
+ //GridNearGetRequest unmarshalling failed test
+ readCnt.set(1);
+
+ failAtomicGet(++key);
+
+ //GridNearGetResponse unmarshalling failed test
+ readCnt.set(100);
+
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+
+ readCnt.set(2);
+
+ failAtomicGet(key);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
deleted file mode 100644
index 06176aa..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTxTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.transactions.*;
-
-import javax.cache.*;
-import java.io.*;
-
-/**
- * Check behavior on exception while unmarshalling key.
- */
-public class IgniteCacheP2pUnmarshallingErrorTxTest extends IgniteCacheP2pUnmarshallingErrorTest {
-
- /** {@inheritDoc} */
- @Override protected CacheAtomicityMode atomicityMode() {
- return CacheAtomicityMode.TRANSACTIONAL;
- }
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- if (!gridName.endsWith("0"))
- cfg.getCacheConfiguration()[0].setRebalanceDelay(-1); //allows to check GridDhtLockRequest fail.
-
- return cfg;
- }
-
- /**
- * Sends put with optimistic lock and handles fail.
- */
- protected void failOptimistic() {
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
-
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
-
- tx.commit();
-
- assert false : "p2p marshalling failed, but error response was not sent";
- }
- catch (IgniteException e) {
- assert X.hasCause(e, IOException.class);
- }
-
- assert readCnt.get() == 0; //ensure we have read count as expected.
- }
-
- /**
- * Sends put with pessimistic lock and handles fail.
- */
- protected void failPessimictic() {
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
-
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
-
- assert false : "p2p marshalling failed, but error response was not sent";
- }
- catch (CacheException e) {
- assert X.hasCause(e, IOException.class);
- }
-
- assert readCnt.get() == 0; //ensure we have read count as expected.
- }
-
- /**
- * Tests that correct response will be sent to client node in case of unmarshalling failed.
- */
- public void testResponseMessageOnUnmarshallingFailed() {
- //GridNearTxPrepareRequest unmarshalling failed test
- readCnt.set(2);
-
- failOptimistic();
-
- //GridDhtTxPrepareRequest unmarshalling failed test
- readCnt.set(3);
-
- failOptimistic();
-
- //GridNearLockRequest unmarshalling failed test
- readCnt.set(2);
-
- failPessimictic();
-
- //GridDhtLockRequest unmarshalling failed test
- readCnt.set(3);
-
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
- jcache(0).put(new TestKey(String.valueOf(++key)), ""); //No failure at client side.
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
new file mode 100644
index 0000000..0b9226f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.eviction.fifo.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ * Check behavior on exception while unmarshalling key.
+ */
+public class IgniteCacheP2pUnmarshallingNearErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
+ /** {@inheritDoc} */
+ @Override protected NearCacheConfiguration nearConfiguration() {
+ return new NearCacheConfiguration();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.getCacheConfiguration()[0].setEvictMaxOverflowRatio(0);
+ cfg.getCacheConfiguration()[0].setEvictSynchronized(true);
+ cfg.getCacheConfiguration()[0].setEvictSynchronizedKeyBufferSize(1);
+ cfg.getCacheConfiguration()[0].setEvictionPolicy(new FifoEvictionPolicy(1));
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testResponseMessageOnUnmarshallingFailed() throws InterruptedException {
+ //GridCacheEvictionRequest unmarshalling failed test
+ readCnt.set(5);
+
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+
+ //Eviction request unmarshalling failed but ioManager does not hangs up.
+
+ Thread.sleep(1000); //todo: wait for eviction complete
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
new file mode 100644
index 0000000..f247a00
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.affinity.*;
+
+/**
+ * Check behavior on exception while unmarshalling key.
+ */
+public class IgniteCacheP2pUnmarshallingRebalanceErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 2;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testResponseMessageOnUnmarshallingFailed() throws Exception {
+ //GridDhtPartitionSupplyMessage unmarshalling failed test
+ readCnt.set(100);
+
+ for (int i = 0; i <= 20; i++) {
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+ }
+
+ readCnt.set(1);
+
+ startGrid(3);
+
+ //GridDhtPartitionSupplyMessage unmarshalling failed but ioManager does not hangs up.
+
+ Thread.sleep(1000);
+
+ //GridDhtForceKeysRequest unmarshalling failed test
+ stopGrid(3);
+
+ readCnt.set(Integer.MAX_VALUE);
+
+ for (int i = 0; i <= 1000; i++) {
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+ }
+
+ startGrid(3);
+
+ Affinity<Object> aff = affinity(grid(3).cache(null));
+
+ while (!aff.isPrimary(grid(3).localNode(), new TestKey(String.valueOf(key)))) {
+ --key;
+ }
+
+ readCnt.set(1);
+
+ jcache(3).get(new TestKey(String.valueOf(key)));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
new file mode 100644
index 0000000..ca48507
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.transactions.*;
+
+import javax.cache.*;
+import java.io.*;
+
+/**
+ * Check behavior on exception while unmarshalling key.
+ */
+public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ if (!gridName.endsWith("0"))
+ cfg.getCacheConfiguration()[0].setRebalanceDelay(-1); //allows to check GridDhtLockRequest fail.
+
+ return cfg;
+ }
+
+ /**
+ * Sends put with optimistic lock and handles fail.
+ */
+ protected void failOptimistic() {
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+
+ tx.commit();
+
+ assert false : "p2p marshalling failed, but error response was not sent";
+ }
+ catch (IgniteException e) {
+ assert X.hasCause(e, IOException.class);
+ }
+
+ assert readCnt.get() == 0; //ensure we have read count as expected.
+ }
+
+ /**
+ * Sends put with pessimistic lock and handles fail.
+ */
+ protected void failPessimictic() {
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+
+ jcache(0).put(new TestKey(String.valueOf(++key)), "");
+
+ assert false : "p2p marshalling failed, but error response was not sent";
+ }
+ catch (CacheException e) {
+ assert X.hasCause(e, IOException.class);
+ }
+
+ assert readCnt.get() == 0; //ensure we have read count as expected.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testResponseMessageOnUnmarshallingFailed() {
+ //GridNearTxPrepareRequest unmarshalling failed test
+ readCnt.set(2);
+
+ failOptimistic();
+
+ //GridDhtTxPrepareRequest unmarshalling failed test
+ readCnt.set(3);
+
+ failOptimistic();
+
+ //GridNearLockRequest unmarshalling failed test
+ readCnt.set(2);
+
+ failPessimictic();
+
+ //GridDhtLockRequest unmarshalling failed test
+ readCnt.set(3);
+
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+ jcache(0).put(new TestKey(String.valueOf(++key)), ""); //No failure at client side.
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a8a9d108/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
new file mode 100644
index 0000000..265490c
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.configuration.*;
+
+import javax.cache.*;
+
+/**
+ * Check behavior on exception while unmarshalling key.
+ */
+public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.getCacheConfiguration()[0].setIndexedTypes(TestKey.class, String.class);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testResponseMessageOnUnmarshallingFailed() {
+ readCnt.set(100);
+
+ TestKey val = new TestKey(String.valueOf(++key));
+
+ jcache(0).put(val, "");
+
+ //GridCacheQueryRequest unmarshalling failed test
+ readCnt.set(1);
+
+ try {
+ jcache(0).query(new SqlQuery<TestKey, String>(String.class, "field like '" + key + "'")).getAll();
+
+ assert false : "p2p marshalling failed, but error response was not sent";
+ }
+ catch (CacheException e) {
+ // No-op
+ }
+ }
+}
[19/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1f35f3aa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1f35f3aa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1f35f3aa
Branch: refs/heads/ignite-gg-10186
Commit: 1f35f3aae55fff2b6ab634f5e12fc0e52f276e58
Parents: eb20e01
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 28 21:09:57 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 28 21:09:57 2015 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/preloader/GridDhtForceKeysResponse.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1f35f3aa/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index 1d49b34..5c6e24f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -43,7 +43,6 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
private IgniteUuid miniId;
/** Error. */
- @GridDirectTransient
private volatile IgniteCheckedException err;
/** Missed (not found) keys. */
[32/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/57ab09ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/57ab09ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/57ab09ee
Branch: refs/heads/ignite-gg-10186
Commit: 57ab09ee168d70cbd65266944d263681c51a4f3c
Parents: da3d9e7 54f9492
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue May 5 12:09:09 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 5 12:09:09 2015 +0300
----------------------------------------------------------------------
.../streaming/wordcount/CacheConfig.java | 5 -
.../config/grid-client-config.properties | 50 +-
.../ClientPropertiesConfigurationSelfTest.java | 12 +-
.../java/org/apache/ignite/IgniteCache.java | 5 +
.../org/apache/ignite/IgniteJdbcDriver.java | 81 ++-
.../ignite/compute/ComputeTaskAdapter.java | 14 +-
.../client/GridClientConfiguration.java | 2 +-
.../processors/cache/GridCacheAdapter.java | 503 +++++++++----------
.../processors/cache/GridCacheProcessor.java | 109 ++--
.../apache/ignite/lang/IgniteAsyncSupport.java | 4 +-
pom.xml | 39 +-
11 files changed, 389 insertions(+), 435 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ab09ee/pom.xml
----------------------------------------------------------------------
[13/50] [abbrv] incubator-ignite git commit: ignite-646
Posted by sb...@apache.org.
ignite-646
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a5547797
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a5547797
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a5547797
Branch: refs/heads/ignite-gg-10186
Commit: a55477970a2fdae5e93bcace708c98892937b97b
Parents: a8a9d10
Author: avinogradov <av...@gridgain.com>
Authored: Mon Apr 27 17:42:03 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Mon Apr 27 17:42:03 2015 +0300
----------------------------------------------------------------------
.../processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java | 6 +++---
.../cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java | 2 +-
.../cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5547797/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index b358b15..2a3f08a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -158,7 +158,7 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
failAtomicPut(++key);
//Check that cache is empty.
- readCnt.set(100);
+ readCnt.set(Integer.MAX_VALUE);
assert jcache(0).get(new TestKey(String.valueOf(key))) == null;
@@ -168,7 +168,7 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
failAtomicPut(++key);
//Check that cache is not empty.
- readCnt.set(100);
+ readCnt.set(Integer.MAX_VALUE);
assert jcache(0).get(new TestKey(String.valueOf(key))) != null;
@@ -178,7 +178,7 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
failAtomicGet(++key);
//GridNearGetResponse unmarshalling failed test
- readCnt.set(100);
+ readCnt.set(Integer.MAX_VALUE);
jcache(0).put(new TestKey(String.valueOf(++key)), "");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5547797/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
index f247a00..95d38e1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
@@ -31,7 +31,7 @@ public class IgniteCacheP2pUnmarshallingRebalanceErrorTest extends IgniteCacheP2
/** {@inheritDoc} */
@Override public void testResponseMessageOnUnmarshallingFailed() throws Exception {
//GridDhtPartitionSupplyMessage unmarshalling failed test
- readCnt.set(100);
+ readCnt.set(Integer.MAX_VALUE);
for (int i = 0; i <= 20; i++) {
jcache(0).put(new TestKey(String.valueOf(++key)), "");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5547797/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
index 265490c..afb96be 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
@@ -37,7 +37,7 @@ public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnm
/** {@inheritDoc} */
@Override public void testResponseMessageOnUnmarshallingFailed() {
- readCnt.set(100);
+ readCnt.set(Integer.MAX_VALUE);
TestKey val = new TestKey(String.valueOf(++key));
[35/50] [abbrv] incubator-ignite git commit: # ignite-664: split
IgniteCacheTestSuite on 4 parts
Posted by sb...@apache.org.
# ignite-664: split IgniteCacheTestSuite on 4 parts
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/acb9f1c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/acb9f1c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/acb9f1c6
Branch: refs/heads/ignite-gg-10186
Commit: acb9f1c6b5f5775b18e881f2a8d3a49e31d83cce
Parents: 6f1d642
Author: Artem Shutak <as...@gridgain.com>
Authored: Wed May 6 16:09:21 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Wed May 6 16:09:21 2015 +0300
----------------------------------------------------------------------
.../ignite/testsuites/IgniteCacheTestSuite.java | 296 -------------------
.../testsuites/IgniteCacheTestSuite2.java | 141 +++++++++
.../testsuites/IgniteCacheTestSuite3.java | 143 +++++++++
.../testsuites/IgniteCacheTestSuite4.java | 131 ++++++++
4 files changed, 415 insertions(+), 296 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/acb9f1c6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index bb019ae..9fd4e88 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -23,17 +23,11 @@ import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.fair.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.cache.store.jdbc.*;
-import org.apache.ignite.internal.processors.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.context.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.*;
-import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
-import org.apache.ignite.internal.processors.cache.distributed.replicated.preloader.*;
-import org.apache.ignite.internal.processors.cache.integration.*;
-import org.apache.ignite.internal.processors.cache.local.*;
import org.apache.ignite.internal.processors.datastreamer.*;
/**
@@ -159,296 +153,6 @@ public class IgniteCacheTestSuite extends TestSuite {
// suite.addTestSuite(GridCacheNearTxExceptionSelfTest.class);
// suite.addTestSuite(GridCacheStopSelfTest.class); TODO IGNITE-257
- // Local cache.
- suite.addTestSuite(GridCacheLocalBasicApiSelfTest.class);
- suite.addTestSuite(GridCacheLocalBasicStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalAtomicBasicStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalAtomicGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheLocalLoadAllSelfTest.class);
- suite.addTestSuite(GridCacheLocalLockSelfTest.class);
- suite.addTestSuite(GridCacheLocalMultithreadedSelfTest.class);
- suite.addTestSuite(GridCacheLocalTxSingleThreadedSelfTest.class);
- suite.addTestSuite(GridCacheLocalTxTimeoutSelfTest.class);
- suite.addTestSuite(GridCacheLocalEventSelfTest.class);
- suite.addTestSuite(GridCacheLocalEvictionEventSelfTest.class);
- suite.addTestSuite(GridCacheVariableTopologySelfTest.class);
- suite.addTestSuite(GridCacheLocalTxMultiThreadedSelfTest.class);
- suite.addTestSuite(GridCacheTransformEventSelfTest.class);
- suite.addTestSuite(GridCacheLocalIsolatedNodesSelfTest.class);
-
- // Partitioned cache.
- suite.addTestSuite(GridCachePartitionedGetSelfTest.class);
- suite.addTest(new TestSuite(GridCachePartitionedBasicApiTest.class));
- suite.addTest(new TestSuite(GridCacheNearMultiGetSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearJobExecutionSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearOneNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicNearMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearReadersSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicNearReadersSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAffinitySelfTest.class));
- suite.addTest(new TestSuite(GridCacheRendezvousAffinityFunctionExcludeNeighborsSelfTest.class));
- suite.addTest(new TestSuite(GridCacheRendezvousAffinityClientSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedProjectionAffinitySelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedBasicOpSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedBasicStoreSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedGetAndTransformStoreSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAtomicGetAndTransformStoreSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedBasicStoreMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedEventSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedLockSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedMultiNodeLockSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedMultiNodeSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedMultiThreadedPutGetSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedNodeFailureSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedExplicitLockNodeFailureSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedTxSingleThreadedSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedTxSingleThreadedSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedTxTimeoutSelfTest.class));
- suite.addTest(new TestSuite(GridCacheFinishPartitionsSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEntrySelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtInternalEntrySelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtMappingSelfTest.class));
-// suite.addTest(new TestSuite(GridCachePartitionedTxMultiThreadedSelfTest.class)); TODO-gg-4066
- suite.addTest(new TestSuite(GridCacheDhtPreloadSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadOffHeapSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadBigDataSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadPutGetSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadDisabledSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadMultiThreadedSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedPreloadRestartSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearPreloadRestartSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadStartStopSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadUnloadSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAffinityFilterSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedPreloadLifecycleSelfTest.class));
- suite.addTest(new TestSuite(CacheLoadingConcurrentGridStartSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtPreloadDelayedSelfTest.class));
- suite.addTest(new TestSuite(GridPartitionedBackupLoadSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedLoadCacheSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionNotLoadedEventSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEvictionsDisabledSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearEvictionEventSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicNearEvictionEventSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEvictionSelfTest.class));
- suite.addTest(new TestSuite(GridCacheReplicatedEvictionSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtEvictionNearReadersSelfTest.class));
- suite.addTest(new TestSuite(GridCacheDhtAtomicEvictionNearReadersSelfTest.class));
-// suite.addTest(new TestSuite(GridCachePartitionedTopologyChangeSelfTest.class)); TODO-gg-5489
- suite.addTest(new TestSuite(GridCachePartitionedPreloadEventsSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedUnloadEventsSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedAffinityHashIdResolverSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedOptimisticTransactionSelfTest.class));
- suite.addTestSuite(GridCacheAtomicMessageCountSelfTest.class);
- suite.addTest(new TestSuite(GridCacheNearPartitionedClearSelfTest.class));
-
- suite.addTest(new TestSuite(GridCacheDhtExpiredEntriesPreloadSelfTest.class));
- suite.addTest(new TestSuite(GridCacheNearExpiredEntriesPreloadSelfTest.class));
- suite.addTest(new TestSuite(GridCacheAtomicExpiredEntriesPreloadSelfTest.class));
-
- suite.addTest(new TestSuite(GridCacheOffheapUpdateSelfTest.class));
-
- // TODO: GG-7242, GG-7243: Enabled when fixed.
-// suite.addTest(new TestSuite(GridCacheDhtRemoveFailureTest.class));
-// suite.addTest(new TestSuite(GridCacheNearRemoveFailureTest.class));
- // TODO: GG-7201: Enable when fixed.
- //suite.addTest(new TestSuite(GridCacheDhtAtomicRemoveFailureTest.class));
-
- suite.addTest(new TestSuite(GridCacheNearPrimarySyncSelfTest.class));
- suite.addTest(new TestSuite(GridCacheColocatedPrimarySyncSelfTest.class));
-
- // Value consistency tests.
- suite.addTestSuite(GridCacheValueConsistencyAtomicSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyAtomicNearEnabledSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderNearEnabledSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyTransactionalSelfTest.class);
- suite.addTestSuite(GridCacheValueConsistencyTransactionalNearEnabledSelfTest.class);
- suite.addTestSuite(GridCacheValueBytesPreloadingSelfTest.class);
-
- // Replicated cache.
- suite.addTestSuite(GridCacheReplicatedBasicApiTest.class);
- suite.addTestSuite(GridCacheReplicatedBasicOpSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedBasicStoreSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedAtomicGetAndTransformStoreSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedEventSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedSynchronousCommitTest.class);
-
- // TODO: GG-7437.
- // suite.addTestSuite(GridCacheReplicatedInvalidateSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedLockSelfTest.class);
- // TODO: enable when GG-7437 is fixed.
- //suite.addTestSuite(GridCacheReplicatedMultiNodeLockSelfTest.class);
- //suite.addTestSuite(GridCacheReplicatedMultiNodeSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedNodeFailureSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedTxSingleThreadedSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedTxTimeoutSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadOffHeapSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadLifecycleSelfTest.class);
- suite.addTestSuite(GridCacheSyncReplicatedPreloadSelfTest.class);
-
- suite.addTestSuite(GridCacheDeploymentSelfTest.class);
- suite.addTestSuite(GridCacheDeploymentOffHeapSelfTest.class);
-
- suite.addTestSuite(GridCachePutArrayValueSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedUnswapAdvancedSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedEvictionEventSelfTest.class);
- // TODO: GG-7569.
- // suite.addTestSuite(GridCacheReplicatedTxMultiThreadedSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadEventsSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedPreloadStartStopEventsSelfTest.class);
- // TODO: GG-7434
- // suite.addTestSuite(GridReplicatedTxPreloadTest.class);
-
- suite.addTestSuite(IgniteTxReentryNearSelfTest.class);
- suite.addTestSuite(IgniteTxReentryColocatedSelfTest.class);
-
- suite.addTestSuite(GridCacheOrderedPreloadingSelfTest.class);
-
- // Test for byte array value special case.
-// suite.addTestSuite(GridCacheLocalByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheNearPartitionedP2PEnabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheNearPartitionedP2PDisabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCachePartitionedOnlyP2PEnabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCachePartitionedOnlyP2PDisabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.class);
-
- // Near-only cache.
- suite.addTest(IgniteCacheNearOnlySelfTestSuite.suite());
-
- // Test cache with daemon nodes.
- suite.addTestSuite(GridCacheDaemonNodeLocalSelfTest.class);
- suite.addTestSuite(GridCacheDaemonNodePartitionedSelfTest.class);
- suite.addTestSuite(GridCacheDaemonNodeReplicatedSelfTest.class);
-
- // Write-behind.
- suite.addTest(IgniteCacheWriteBehindTestSuite.suite());
-
- // Transform.
- suite.addTestSuite(GridCachePartitionedTransformWriteThroughBatchUpdateSelfTest.class);
-
- suite.addTestSuite(GridCacheEntryVersionSelfTest.class);
- suite.addTestSuite(GridCacheVersionSelfTest.class);
-
- // Memory leak tests.
- suite.addTestSuite(GridCacheReferenceCleanupSelfTest.class);
- suite.addTestSuite(GridCacheReloadSelfTest.class);
-
- suite.addTestSuite(GridCacheMixedModeSelfTest.class);
-
- // Cache metrics.
- suite.addTest(IgniteCacheMetricsSelfTestSuite.suite());
-
- // Topology validator.
- suite.addTest(IgniteTopologyValidatorTestSuit.suite());
-
- // Eviction.
- suite.addTest(IgniteCacheEvictionSelfTestSuite.suite());
-
- // Iterators.
- suite.addTest(IgniteCacheIteratorsSelfTestSuite.suite());
-
- // Add tx recovery test suite.
- suite.addTest(IgniteCacheTxRecoverySelfTestSuite.suite());
-
- // Cache interceptor tests.
- suite.addTest(IgniteCacheInterceptorSelfTestSuite.suite());
-
- // Multi node update.
- suite.addTestSuite(GridCacheMultinodeUpdateSelfTest.class);
- // TODO: GG-5353.
- // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledSelfTest.class);
- // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.class);
- suite.addTestSuite(GridCacheMultinodeUpdateAtomicSelfTest.class);
- suite.addTestSuite(GridCacheMultinodeUpdateAtomicNearEnabledSelfTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicLoadAllTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalLoadAllTest.class);
- suite.addTestSuite(IgniteCacheTxLoadAllTest.class);
- suite.addTestSuite(IgniteCacheTxLocalLoadAllTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicLoaderWriterTest.class);
- suite.addTestSuite(IgniteCacheTxLoaderWriterTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicStoreSessionTest.class);
- suite.addTestSuite(IgniteCacheTxStoreSessionTest.class);
- suite.addTestSuite(IgniteCacheAtomicStoreSessionWriteBehindTest.class);
- suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledNoReadThroughTest.class);
- suite.addTestSuite(IgniteCacheTxLocalNoReadThroughTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheTxNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledNoLoadPreviousValueTest.class);
- suite.addTestSuite(IgniteCacheTxLocalNoLoadPreviousValueTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledNoWriteThroughTest.class);
- suite.addTestSuite(IgniteCacheTxLocalNoWriteThroughTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicPeekModesTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearPeekModesTest.class);
- suite.addTestSuite(IgniteCacheAtomicReplicatedPeekModesTest.class);
- suite.addTestSuite(IgniteCacheAtomicLocalPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxNearPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxLocalPeekModesTest.class);
- suite.addTestSuite(IgniteCacheTxReplicatedPeekModesTest.class);
-
- // TODO: IGNITE-114.
- // suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class);
- // suite.addTestSuite(GridCacheVersionMultinodeTest.class);
-
- suite.addTestSuite(IgniteCacheNearReadCommittedTest.class);
- suite.addTestSuite(IgniteCacheAtomicCopyOnReadDisabledTest.class);
- suite.addTestSuite(IgniteCacheTxCopyOnReadDisabledTest.class);
-
- suite.addTestSuite(IgniteCacheTxPreloadNoWriteTest.class);
-
- suite.addTestSuite(IgniteDynamicCacheStartSelfTest.class);
- suite.addTestSuite(IgniteCacheDynamicStopSelfTest.class);
- suite.addTestSuite(IgniteCacheConfigurationTemplateTest.class);
- suite.addTestSuite(IgniteCacheConfigurationDefaultTemplateTest.class);
-
- suite.addTestSuite(GridCacheTxLoadFromStoreOnLockSelfTest.class);
-
- suite.addTestSuite(GridCacheMarshallingNodeJoinSelfTest.class);
-
- suite.addTestSuite(IgniteCacheJdbcBlobStoreNodeRestartTest.class);
-
- suite.addTestSuite(IgniteCacheAtomicLocalStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicNearEnabledStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderStoreValueTest.class);
- suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderNearEnabledStoreValueTest.class);
- suite.addTestSuite(IgniteCacheTxLocalStoreValueTest.class);
- suite.addTestSuite(IgniteCacheTxStoreValueTest.class);
- suite.addTestSuite(IgniteCacheTxNearEnabledStoreValueTest.class);
-
- suite.addTestSuite(IgniteCacheLockFailoverSelfTest.class);
- suite.addTestSuite(IgniteCacheMultiTxLockSelfTest.class);
-
- suite.addTestSuite(IgniteInternalCacheTypesTest.class);
-
- suite.addTestSuite(IgniteExchangeFutureHistoryTest.class);
-
- suite.addTestSuite(CacheNoValueClassOnServerNodeTest.class);
-
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/acb9f1c6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
new file mode 100644
index 0000000..dfd88a8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.distributed.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+import org.apache.ignite.internal.processors.cache.local.*;
+
+/**
+ * Test suite.
+ */
+public class IgniteCacheTestSuite2 extends TestSuite {
+ /**
+ * @return IgniteCache test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("IgniteCache Test Suite part 2");
+
+ // Local cache.
+ suite.addTestSuite(GridCacheLocalBasicApiSelfTest.class);
+ suite.addTestSuite(GridCacheLocalBasicStoreSelfTest.class);
+ suite.addTestSuite(GridCacheLocalAtomicBasicStoreSelfTest.class);
+ suite.addTestSuite(GridCacheLocalGetAndTransformStoreSelfTest.class);
+ suite.addTestSuite(GridCacheLocalAtomicGetAndTransformStoreSelfTest.class);
+ suite.addTestSuite(GridCacheLocalLoadAllSelfTest.class);
+ suite.addTestSuite(GridCacheLocalLockSelfTest.class);
+ suite.addTestSuite(GridCacheLocalMultithreadedSelfTest.class);
+ suite.addTestSuite(GridCacheLocalTxSingleThreadedSelfTest.class);
+ suite.addTestSuite(GridCacheLocalTxTimeoutSelfTest.class);
+ suite.addTestSuite(GridCacheLocalEventSelfTest.class);
+ suite.addTestSuite(GridCacheLocalEvictionEventSelfTest.class);
+ suite.addTestSuite(GridCacheVariableTopologySelfTest.class);
+ suite.addTestSuite(GridCacheLocalTxMultiThreadedSelfTest.class);
+ suite.addTestSuite(GridCacheTransformEventSelfTest.class);
+ suite.addTestSuite(GridCacheLocalIsolatedNodesSelfTest.class);
+
+ // Partitioned cache.
+ suite.addTestSuite(GridCachePartitionedGetSelfTest.class);
+ suite.addTest(new TestSuite(GridCachePartitionedBasicApiTest.class));
+ suite.addTest(new TestSuite(GridCacheNearMultiGetSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearJobExecutionSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearOneNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheAtomicNearMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearReadersSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheAtomicNearReadersSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedAffinitySelfTest.class));
+ suite.addTest(new TestSuite(GridCacheRendezvousAffinityFunctionExcludeNeighborsSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheRendezvousAffinityClientSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedProjectionAffinitySelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedBasicOpSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedBasicStoreSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedGetAndTransformStoreSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedAtomicGetAndTransformStoreSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedBasicStoreMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedEventSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedLockSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedMultiNodeLockSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedMultiThreadedPutGetSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedNodeFailureSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedExplicitLockNodeFailureSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedTxSingleThreadedSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheColocatedTxSingleThreadedSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedTxTimeoutSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheFinishPartitionsSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtEntrySelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtInternalEntrySelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtMappingSelfTest.class));
+// suite.addTest(new TestSuite(GridCachePartitionedTxMultiThreadedSelfTest.class)); TODO-gg-4066
+ suite.addTest(new TestSuite(GridCacheDhtPreloadSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadOffHeapSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadBigDataSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadPutGetSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadDisabledSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadMultiThreadedSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheColocatedPreloadRestartSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearPreloadRestartSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadStartStopSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadUnloadSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedAffinityFilterSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedPreloadLifecycleSelfTest.class));
+ suite.addTest(new TestSuite(CacheLoadingConcurrentGridStartSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtPreloadDelayedSelfTest.class));
+ suite.addTest(new TestSuite(GridPartitionedBackupLoadSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedLoadCacheSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionNotLoadedEventSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtEvictionsDisabledSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearEvictionEventSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheAtomicNearEvictionEventSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtEvictionSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheReplicatedEvictionSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtEvictionNearReadersSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheDhtAtomicEvictionNearReadersSelfTest.class));
+// suite.addTest(new TestSuite(GridCachePartitionedTopologyChangeSelfTest.class)); TODO-gg-5489
+ suite.addTest(new TestSuite(GridCachePartitionedPreloadEventsSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedUnloadEventsSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedAffinityHashIdResolverSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheColocatedOptimisticTransactionSelfTest.class));
+ suite.addTestSuite(GridCacheAtomicMessageCountSelfTest.class);
+ suite.addTest(new TestSuite(GridCacheNearPartitionedClearSelfTest.class));
+
+ suite.addTest(new TestSuite(GridCacheDhtExpiredEntriesPreloadSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheNearExpiredEntriesPreloadSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheAtomicExpiredEntriesPreloadSelfTest.class));
+
+ suite.addTest(new TestSuite(GridCacheOffheapUpdateSelfTest.class));
+
+ // TODO: GG-7242, GG-7243: Enabled when fixed.
+// suite.addTest(new TestSuite(GridCacheDhtRemoveFailureTest.class));
+// suite.addTest(new TestSuite(GridCacheNearRemoveFailureTest.class));
+ // TODO: GG-7201: Enable when fixed.
+ //suite.addTest(new TestSuite(GridCacheDhtAtomicRemoveFailureTest.class));
+
+ suite.addTest(new TestSuite(GridCacheNearPrimarySyncSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheColocatedPrimarySyncSelfTest.class));
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/acb9f1c6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
new file mode 100644
index 0000000..2e56b7a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.distributed.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.preloader.*;
+import org.apache.ignite.internal.processors.cache.local.*;
+
+/**
+ * Test suite.
+ */
+public class IgniteCacheTestSuite3 extends TestSuite {
+ /**
+ * @return IgniteCache test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("IgniteCache Test Suite part 3");
+
+ // Value consistency tests.
+ suite.addTestSuite(GridCacheValueConsistencyAtomicSelfTest.class);
+ suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.class);
+ suite.addTestSuite(GridCacheValueConsistencyAtomicNearEnabledSelfTest.class);
+ suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderNearEnabledSelfTest.class);
+ suite.addTestSuite(GridCacheValueConsistencyTransactionalSelfTest.class);
+ suite.addTestSuite(GridCacheValueConsistencyTransactionalNearEnabledSelfTest.class);
+ suite.addTestSuite(GridCacheValueBytesPreloadingSelfTest.class);
+
+ // Replicated cache.
+ suite.addTestSuite(GridCacheReplicatedBasicApiTest.class);
+ suite.addTestSuite(GridCacheReplicatedBasicOpSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedBasicStoreSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedGetAndTransformStoreSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedAtomicGetAndTransformStoreSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedEventSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedSynchronousCommitTest.class);
+
+ // TODO: GG-7437.
+ // suite.addTestSuite(GridCacheReplicatedInvalidateSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedLockSelfTest.class);
+ // TODO: enable when GG-7437 is fixed.
+ //suite.addTestSuite(GridCacheReplicatedMultiNodeLockSelfTest.class);
+ //suite.addTestSuite(GridCacheReplicatedMultiNodeSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedNodeFailureSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedTxSingleThreadedSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedTxTimeoutSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedPreloadSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedPreloadOffHeapSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedPreloadLifecycleSelfTest.class);
+ suite.addTestSuite(GridCacheSyncReplicatedPreloadSelfTest.class);
+
+ suite.addTestSuite(GridCacheDeploymentSelfTest.class);
+ suite.addTestSuite(GridCacheDeploymentOffHeapSelfTest.class);
+
+ suite.addTestSuite(GridCachePutArrayValueSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedUnswapAdvancedSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedEvictionEventSelfTest.class);
+ // TODO: GG-7569.
+ // suite.addTestSuite(GridCacheReplicatedTxMultiThreadedSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedPreloadEventsSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedPreloadStartStopEventsSelfTest.class);
+ // TODO: GG-7434
+ // suite.addTestSuite(GridReplicatedTxPreloadTest.class);
+
+ suite.addTestSuite(IgniteTxReentryNearSelfTest.class);
+ suite.addTestSuite(IgniteTxReentryColocatedSelfTest.class);
+
+ suite.addTestSuite(GridCacheOrderedPreloadingSelfTest.class);
+
+ // Test for byte array value special case.
+// suite.addTestSuite(GridCacheLocalByteArrayValuesSelfTest.class);
+ suite.addTestSuite(GridCacheNearPartitionedP2PEnabledByteArrayValuesSelfTest.class);
+ suite.addTestSuite(GridCacheNearPartitionedP2PDisabledByteArrayValuesSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOnlyP2PEnabledByteArrayValuesSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOnlyP2PDisabledByteArrayValuesSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.class);
+
+ // Near-only cache.
+ suite.addTest(IgniteCacheNearOnlySelfTestSuite.suite());
+
+ // Test cache with daemon nodes.
+ suite.addTestSuite(GridCacheDaemonNodeLocalSelfTest.class);
+ suite.addTestSuite(GridCacheDaemonNodePartitionedSelfTest.class);
+ suite.addTestSuite(GridCacheDaemonNodeReplicatedSelfTest.class);
+
+ // Write-behind.
+ suite.addTest(IgniteCacheWriteBehindTestSuite.suite());
+
+ // Transform.
+ suite.addTestSuite(GridCachePartitionedTransformWriteThroughBatchUpdateSelfTest.class);
+
+ suite.addTestSuite(GridCacheEntryVersionSelfTest.class);
+ suite.addTestSuite(GridCacheVersionSelfTest.class);
+
+ // Memory leak tests.
+ suite.addTestSuite(GridCacheReferenceCleanupSelfTest.class);
+ suite.addTestSuite(GridCacheReloadSelfTest.class);
+
+ suite.addTestSuite(GridCacheMixedModeSelfTest.class);
+
+ // Cache metrics.
+ suite.addTest(IgniteCacheMetricsSelfTestSuite.suite());
+
+ // Topology validator.
+ suite.addTest(IgniteTopologyValidatorTestSuit.suite());
+
+ // Eviction.
+ suite.addTest(IgniteCacheEvictionSelfTestSuite.suite());
+
+ // Iterators.
+ suite.addTest(IgniteCacheIteratorsSelfTestSuite.suite());
+
+ // Add tx recovery test suite.
+ suite.addTest(IgniteCacheTxRecoverySelfTestSuite.suite());
+
+ // Cache interceptor tests.
+ suite.addTest(IgniteCacheInterceptorSelfTestSuite.suite());
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/acb9f1c6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
new file mode 100644
index 0000000..f7272d4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.processors.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.distributed.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.cache.integration.*;
+
+/**
+ * Test suite.
+ */
+public class IgniteCacheTestSuite4 extends TestSuite {
+ /**
+ * @return IgniteCache test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("IgniteCache Test Suite part 4");
+
+ // Multi node update.
+ suite.addTestSuite(GridCacheMultinodeUpdateSelfTest.class);
+ // TODO: GG-5353.
+ // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledSelfTest.class);
+ // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.class);
+ suite.addTestSuite(GridCacheMultinodeUpdateAtomicSelfTest.class);
+ suite.addTestSuite(GridCacheMultinodeUpdateAtomicNearEnabledSelfTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicLoadAllTest.class);
+ suite.addTestSuite(IgniteCacheAtomicLocalLoadAllTest.class);
+ suite.addTestSuite(IgniteCacheTxLoadAllTest.class);
+ suite.addTestSuite(IgniteCacheTxLocalLoadAllTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicLoaderWriterTest.class);
+ suite.addTestSuite(IgniteCacheTxLoaderWriterTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicStoreSessionTest.class);
+ suite.addTestSuite(IgniteCacheTxStoreSessionTest.class);
+ suite.addTestSuite(IgniteCacheAtomicStoreSessionWriteBehindTest.class);
+ suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicNoReadThroughTest.class);
+ suite.addTestSuite(IgniteCacheAtomicNearEnabledNoReadThroughTest.class);
+ suite.addTestSuite(IgniteCacheAtomicLocalNoReadThroughTest.class);
+ suite.addTestSuite(IgniteCacheTxNoReadThroughTest.class);
+ suite.addTestSuite(IgniteCacheTxNearEnabledNoReadThroughTest.class);
+ suite.addTestSuite(IgniteCacheTxLocalNoReadThroughTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicNoLoadPreviousValueTest.class);
+ suite.addTestSuite(IgniteCacheAtomicNearEnabledNoLoadPreviousValueTest.class);
+ suite.addTestSuite(IgniteCacheAtomicLocalNoLoadPreviousValueTest.class);
+ suite.addTestSuite(IgniteCacheTxNoLoadPreviousValueTest.class);
+ suite.addTestSuite(IgniteCacheTxNearEnabledNoLoadPreviousValueTest.class);
+ suite.addTestSuite(IgniteCacheTxLocalNoLoadPreviousValueTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicNoWriteThroughTest.class);
+ suite.addTestSuite(IgniteCacheAtomicNearEnabledNoWriteThroughTest.class);
+ suite.addTestSuite(IgniteCacheAtomicLocalNoWriteThroughTest.class);
+ suite.addTestSuite(IgniteCacheTxNoWriteThroughTest.class);
+ suite.addTestSuite(IgniteCacheTxNearEnabledNoWriteThroughTest.class);
+ suite.addTestSuite(IgniteCacheTxLocalNoWriteThroughTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicPeekModesTest.class);
+ suite.addTestSuite(IgniteCacheAtomicNearPeekModesTest.class);
+ suite.addTestSuite(IgniteCacheAtomicReplicatedPeekModesTest.class);
+ suite.addTestSuite(IgniteCacheAtomicLocalPeekModesTest.class);
+ suite.addTestSuite(IgniteCacheTxPeekModesTest.class);
+ suite.addTestSuite(IgniteCacheTxNearPeekModesTest.class);
+ suite.addTestSuite(IgniteCacheTxLocalPeekModesTest.class);
+ suite.addTestSuite(IgniteCacheTxReplicatedPeekModesTest.class);
+
+ // TODO: IGNITE-114.
+ // suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class);
+ // suite.addTestSuite(GridCacheVersionMultinodeTest.class);
+
+ suite.addTestSuite(IgniteCacheNearReadCommittedTest.class);
+ suite.addTestSuite(IgniteCacheAtomicCopyOnReadDisabledTest.class);
+ suite.addTestSuite(IgniteCacheTxCopyOnReadDisabledTest.class);
+
+ suite.addTestSuite(IgniteCacheTxPreloadNoWriteTest.class);
+
+ suite.addTestSuite(IgniteDynamicCacheStartSelfTest.class);
+ suite.addTestSuite(IgniteCacheDynamicStopSelfTest.class);
+ suite.addTestSuite(IgniteCacheConfigurationTemplateTest.class);
+ suite.addTestSuite(IgniteCacheConfigurationDefaultTemplateTest.class);
+
+ suite.addTestSuite(GridCacheTxLoadFromStoreOnLockSelfTest.class);
+
+ suite.addTestSuite(GridCacheMarshallingNodeJoinSelfTest.class);
+
+ suite.addTestSuite(IgniteCacheJdbcBlobStoreNodeRestartTest.class);
+
+ suite.addTestSuite(IgniteCacheAtomicLocalStoreValueTest.class);
+ suite.addTestSuite(IgniteCacheAtomicStoreValueTest.class);
+ suite.addTestSuite(IgniteCacheAtomicNearEnabledStoreValueTest.class);
+ suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderStoreValueTest.class);
+ suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderNearEnabledStoreValueTest.class);
+ suite.addTestSuite(IgniteCacheTxLocalStoreValueTest.class);
+ suite.addTestSuite(IgniteCacheTxStoreValueTest.class);
+ suite.addTestSuite(IgniteCacheTxNearEnabledStoreValueTest.class);
+
+ suite.addTestSuite(IgniteCacheLockFailoverSelfTest.class);
+ suite.addTestSuite(IgniteCacheMultiTxLockSelfTest.class);
+
+ suite.addTestSuite(IgniteInternalCacheTypesTest.class);
+
+ suite.addTestSuite(IgniteExchangeFutureHistoryTest.class);
+
+ suite.addTestSuite(CacheNoValueClassOnServerNodeTest.class);
+
+ return suite;
+ }
+}
[40/50] [abbrv] incubator-ignite git commit: Minor tests fix
Posted by sb...@apache.org.
Minor tests 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/29da67ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/29da67ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/29da67ce
Branch: refs/heads/ignite-gg-10186
Commit: 29da67ce0bbee3c7837126423a6290a6cc2a22cf
Parents: 61808ed
Author: agura <ag...@gridgain.com>
Authored: Thu May 7 15:18:34 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Thu May 7 15:18:34 2015 +0300
----------------------------------------------------------------------
...CacheLoadingConcurrentGridStartSelfTest.java | 49 ++++++++++++--------
1 file changed, 29 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/29da67ce/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
index 74273d1..798494f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
@@ -30,6 +30,7 @@ import org.jetbrains.annotations.*;
import javax.cache.*;
import javax.cache.configuration.*;
import javax.cache.integration.*;
+import java.io.*;
import java.util.concurrent.*;
import static org.apache.ignite.cache.CacheMode.*;
@@ -55,26 +56,7 @@ public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractT
ccfg.setBackups(1);
- CacheStore<Integer, String> store = new CacheStoreAdapter<Integer, String>() {
- @Override public void loadCache(IgniteBiInClosure<Integer, String> f, Object... args) {
- for (int i = 0; i < KEYS_CNT; i++)
- f.apply(i, Integer.toString(i));
- }
-
- @Nullable @Override public String load(Integer i) throws CacheLoaderException {
- return null;
- }
-
- @Override public void write(Cache.Entry<? extends Integer, ? extends String> entry) throws CacheWriterException {
- // No-op.
- }
-
- @Override public void delete(Object o) throws CacheWriterException {
- // No-op.
- }
- };
-
- ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+ ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestCacheStoreAdapter()));
cfg.setCacheConfiguration(ccfg);
@@ -151,4 +133,31 @@ public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractT
assertEquals(KEYS_CNT, total);
}
+
+ /**
+ * Cache store adapter.
+ */
+ private static class TestCacheStoreAdapter extends CacheStoreAdapter<Integer, String> implements Serializable {
+ /** {@inheritDoc} */
+ @Override public void loadCache(IgniteBiInClosure<Integer, String> f, Object... args) {
+ for (int i = 0; i < KEYS_CNT; i++)
+ f.apply(i, Integer.toString(i));
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String load(Integer i) throws CacheLoaderException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void write(Cache.Entry<? extends Integer, ? extends String> entry)
+ throws CacheWriterException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void delete(Object o) throws CacheWriterException {
+ // No-op.
+ }
+ }
}
[39/50] [abbrv] incubator-ignite git commit: # sprint-5 Minor code
formatting.
Posted by sb...@apache.org.
# sprint-5 Minor code formatting.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/61808edc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/61808edc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/61808edc
Branch: refs/heads/ignite-gg-10186
Commit: 61808edc62f0bd9f9306f86d99d0488c196793e7
Parents: 54e814a
Author: AKuznetsov <ak...@gridgain.com>
Authored: Thu May 7 15:33:03 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Thu May 7 15:33:03 2015 +0700
----------------------------------------------------------------------
.../java/org/apache/ignite/schema/generator/CodeGenerator.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/61808edc/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
index 8a994f2..5b74cdd 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
@@ -69,7 +69,7 @@ public class CodeGenerator {
* @throws IllegalStateException If passed string is not valid java identifier.
*/
private static void checkValidJavaIdentifier(String identifier, boolean split, String msg, String type)
- throws IllegalStateException{
+ throws IllegalStateException {
if (identifier.isEmpty())
throw new IllegalStateException(msg + " could not be empty!");
@@ -679,7 +679,7 @@ public class CodeGenerator {
for (Map.Entry<String, Map<String, IndexItem>> group : groups.entrySet()) {
add2(src, (firstGrp ? "LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>> " : "") +
- "grpItems = new LinkedHashMap<>();");
+ "grpItems = new LinkedHashMap<>();");
add0(src, "");
for (Map.Entry<String, IndexItem> grpItem : group.getValue().entrySet()) {
[30/50] [abbrv] incubator-ignite git commit: IGNITE-620. Add CI
tooling code for patch validation
Posted by sb...@apache.org.
IGNITE-620. Add CI tooling code for patch validation
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/114a8528
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/114a8528
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/114a8528
Branch: refs/heads/ignite-gg-10186
Commit: 114a8528c6c0030434227a26523e3c16588145c1
Parents: 8c2e03e
Author: Konstantin Boudnik <co...@wandisco.com>
Authored: Thu Mar 26 12:46:19 2015 -0700
Committer: Konstantin Boudnik <co...@wandisco.com>
Committed: Fri May 1 16:49:09 2015 -0700
----------------------------------------------------------------------
dev-tools/.gitignore | 2 +
dev-tools/build.gradle | 46 ++++++++
dev-tools/src/main/groovy/jiraslurp.groovy | 147 ++++++++++++++++++++++++
3 files changed, 195 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/114a8528/dev-tools/.gitignore
----------------------------------------------------------------------
diff --git a/dev-tools/.gitignore b/dev-tools/.gitignore
new file mode 100644
index 0000000..3036616
--- /dev/null
+++ b/dev-tools/.gitignore
@@ -0,0 +1,2 @@
+validated-jira.txt
+.gradle
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/114a8528/dev-tools/build.gradle
----------------------------------------------------------------------
diff --git a/dev-tools/build.gradle b/dev-tools/build.gradle
new file mode 100644
index 0000000..30ae6b7
--- /dev/null
+++ b/dev-tools/build.gradle
@@ -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.
+ */
+apply plugin: 'groovy'
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile 'org.codehaus.groovy:groovy-all:2.2.1'
+}
+
+task help {
+ println '''There are two interfaces to work with JIRA attachment validation tool
+ - to do the batch validation of all latest patch attachments
+ gradle slurp
+ - to grab a single JIRA's latest attachment and run test validation on it
+ JIRA_NUM=INGITE-### gradle patchapply'''
+}
+
+task slurp (dependsOn: 'classes', type: JavaExec) {
+ args (project.buildDir, 'slurp')
+ main = 'jiraslurp'
+ classpath = sourceSets.main.runtimeClasspath
+}
+
+task patchapply (dependsOn: 'classes', type: JavaExec) {
+ args ("JIRA_NUM=${System.getenv('JIRA_NUM')}")
+ main = 'jiraslurp'
+ classpath = sourceSets.main.runtimeClasspath
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/114a8528/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
new file mode 100644
index 0000000..332686f
--- /dev/null
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -0,0 +1,147 @@
+/*
+ * 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.
+ */
+/**
+ * Parsing a special filter from Apache Ignite JIRA and picking up latest by ID
+ * attachments to process.
+ */
+final GIT_REPO = "https://git1-us-west.apache.org/repos/asf/incubator-ignite.git"
+final ATTACHMENT_URL = "https://issues.apache.org/jira/secure/attachment"
+final validated_filename = "validated-jira.txt"
+final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_Main/.lastSuccessful/$validated_filename"
+
+final def JIRA_CMD = System.getProperty('JIRA_COMMAND', 'jira.sh')
+LinkedHashMap<String, String> jirasAttached = [:]
+
+def readHistory = {
+ final int MAX_HISTORY = 5000
+
+ List validated_list = []
+ def validated = new File(validated_filename)
+ if (validated.exists()) {
+ validated_list = validated.text.split('\n')
+ validated.delete()
+ } else {
+ try {
+ validated_list =
+ new URL("http://204.14.53.152/$LAST_SUCCESSFUL_ARTIFACT").text.split('\n')
+ } catch (Exception e) {
+ println e.getMessage()
+ }
+ }
+ // Let's make sure the preserved history isn't too long
+ if (validated_list.size > MAX_HISTORY) {
+ validated_list = validated_list[validated_list.size-MAX_HISTORY..validated_list.size-1]
+ }
+ validated_list
+}
+
+/**
+ * Accepting the <jira> XML element from JIRA stream
+ * @return <code>null</code> or <code>JIRA-###,latest_attach_id</code>
+ */
+def getLatestAttachment = { jira ->
+ def latestAttr = jira.attachments[0].attachment.list().sort {
+ it.@id.toInteger()
+ }.reverse()[0]
+ String row = null
+ if (latestAttr == null) {
+ println "${jira.key} is in invalid state: patch is not available"
+ } else {
+ row = "${jira.key},${latestAttr.@id}"
+ }
+}
+
+def checkForAttachments = {
+ def JIRA_FILTER =
+ "https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/12330308/SearchRequest-12330308.xml?tempMax=100&field=key&field=attachments"
+ def rss = new XmlSlurper().parse(JIRA_FILTER)
+ List list = readHistory{}
+
+ rss.channel.item.each { jira ->
+ String row = getLatestAttachment (jira)
+ if (row != null && !list.contains(row)) {
+ def pair = row.split(',')
+ jirasAttached.put(pair[0] as String, pair[1] as String)
+ list.add(row)
+ }
+ }
+
+ // Write everything back to persist the list
+ def validated = new File(validated_filename)
+ validated << list.join('\n')
+}
+
+def checkprocess = { process ->
+ process.waitFor()
+ if (process.exitValue() != 0) {
+ println "Return code: " + process.exitValue()
+ println "Errout:\n" + process.err.text
+ assert process.exitValue() == 0 || process.exitValue() == 128
+ }
+}
+
+def create_gitbranch = {jira, attachementURL ->
+ println jira
+ GIT_REPO
+ println "$ATTACHMENT_URL/$attachementURL/"
+
+ def patchFile = new File("${jira}.patch")
+ patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text
+ checkprocess "git clone --depth 1 $GIT_REPO".execute()
+ checkprocess "git checkout -b sprint-2 origin/sprint-2".execute(null, new File('incubator-ignite'))
+ checkprocess "git am ../${patchFile.name}".execute(null, new File('incubator-ignite'))
+ patchFile.delete()
+}
+
+def JIRA_xml = { jiranum ->
+ "https://issues.apache.org/jira/si/jira.issueviews:issue-xml/$jiranum/${jiranum}.xml"
+}
+
+args.each {
+ println it
+ def parameters = it.split('=')
+
+ if (parameters[0] == 'slurp') {
+ checkForAttachments()
+ // For each ticket with new attachment, let's trigger remove build
+ jirasAttached.each { k, v ->
+ // Trailing slash is important for download; only need to pass JIRA number
+ println "Triggering the build for: $k = $ATTACHMENT_URL/$v/"
+ }
+ } else if (parameters.length == 2 && parameters[0] == 'JIRA_NUM' && parameters[1] ==~ /\w+-\d+/) {
+ // Extract JIRA rss from the and pass the ticket element into attachment extraction
+ def rss = new XmlSlurper().parse(JIRA_xml(parameters[1]))
+ String row = getLatestAttachment(rss.channel.item)
+ if (row != null) {
+ def pair = row.split(',')
+ create_gitbranch(pair[0], pair[1])
+ }
+ }
+}
+
+/* Workflow:
+ 1. download an attachment if JIRA num's set; otherwise get all latest attachments not mentioned in the
+ validated-jira.txt file from the last successful build
+ 2. trigger test build(s) parametrised by JIRA no.
+ 3. test build will download JIRA's latest attachment and apply it to currently checked out repo;
+ - build will fail with comment on JIRA if that can not apply
+ - build will post error/success comment depends on the test results
+*/
+// TODO
+// - TC's test job needs to send a comment to JIRA
+// $JIRA_CMD -a addComment -s https://issues.apache.org/jira -u ignite-ci -p ci-of-1gnit3 --issue IGNITE-495 --comment "Trying latest version of the jira-cli"
[34/50] [abbrv] incubator-ignite git commit: # ignite-sprint-5: fix
license headers
Posted by sb...@apache.org.
# ignite-sprint-5: fix license headers
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6f1d6421
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6f1d6421
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6f1d6421
Branch: refs/heads/ignite-gg-10186
Commit: 6f1d642167ebb4563a9c9c7b3429d84214b433cd
Parents: 5f8f6f4
Author: Artem Shutak <as...@gridgain.com>
Authored: Tue May 5 18:34:08 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Tue May 5 18:34:08 2015 +0300
----------------------------------------------------------------------
dev-tools/build.gradle | 15 +++++++--------
dev-tools/src/main/groovy/jiraslurp.groovy | 15 +++++++--------
2 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6f1d6421/dev-tools/build.gradle
----------------------------------------------------------------------
diff --git a/dev-tools/build.gradle b/dev-tools/build.gradle
index 30ae6b7..b760bc1 100644
--- a/dev-tools/build.gradle
+++ b/dev-tools/build.gradle
@@ -1,13 +1,12 @@
/*
- * 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
+ * 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
+ * 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,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6f1d6421/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index 332686f..0a876fa 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -1,13 +1,12 @@
/*
- * 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
+ * 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
+ * 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,
[42/50] [abbrv] incubator-ignite git commit: ignite-853
Posted by sb...@apache.org.
ignite-853
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cc679f54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cc679f54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cc679f54
Branch: refs/heads/ignite-gg-10186
Commit: cc679f5412d6735f37e9fc54ce4fe4734c6b82cd
Parents: 5f8f6f4
Author: avinogradov <av...@gridgain.com>
Authored: Thu May 7 18:57:43 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu May 7 18:57:43 2015 +0300
----------------------------------------------------------------------
pom.xml | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc679f54/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9321a28..aa30216 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
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>
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.ignite</groupId>
@@ -37,13 +37,14 @@
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
- <!--fix <attachartifact>...</> at apache-release profile if changed-->
- <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-incubating</ignite.zip.pattern>
+ <ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
+ <!--fix <attachartifact>...< /> at apache-release profile if changed-->
+ <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
</properties>
<scm>
<url>https://git-wip-us.apache.org/repos/asf/incubator-ignite</url>
- <connection>scm:git:git://git-wip-us.apache.org/repos/asf/incubator-ignite</connection>
+ <connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ignite</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ignite</developerConnection>
<tag>HEAD</tag>
</scm>
@@ -51,7 +52,7 @@
<distributionManagement>
<site>
<id>ignite-site</id>
- <url>${ignite.site}/${project.artifactId}-${project.version}</url>
+ <url>${ignite.site}/${ignite.site.folder}</url>
</site>
</distributionManagement>
@@ -116,7 +117,6 @@
<id>dev-libs</id>
<activation>
<activeByDefault>true</activeByDefault>
- <jdk>[1.7,)</jdk>
</activation>
<build>
<plugins>
@@ -488,7 +488,7 @@
<descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
</descriptorRefs>
<tarLongFileMode>gnu</tarLongFileMode>
- <finalName>incubator-ignite-${project.version}-src</finalName>
+ <finalName>ignite-${project.version}-src</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
@@ -508,14 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact
- file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip"
- classifier="fabric"
- type="zip"/>
- <attachartifact
- file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip"
- classifier="hadoop"
- type="zip"/>
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
@@ -562,7 +556,7 @@
<fileSet>
<directory>${basedir}/target</directory>
<includes>
- <include>incubator-ignite-${project.version}-src.zip</include>
+ <include>ignite-${project.version}-src.zip</include>
<include>bin/*.zip</include>
</includes>
</fileSet>
@@ -590,10 +584,10 @@
<failOnError>false</failOnError>
<target>
<mkdir dir="${basedir}/target/site" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.asc" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.md5" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.sha1" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip" tofile="${basedir}/target/site/ignite-${project.version}-src.zip" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.asc" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.md5" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.sha1" failonerror="false" />
<copy todir="${basedir}/target/site">
<fileset dir="${basedir}/target/bin">
<include name="**/*" />
[28/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/445c0a61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/445c0a61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/445c0a61
Branch: refs/heads/ignite-gg-10186
Commit: 445c0a61544fc3d05cef77b0c0653b93859e7da7
Parents: e406987 44b00ea
Author: avinogradov <av...@gridgain.com>
Authored: Thu Apr 30 18:53:36 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu Apr 30 18:53:36 2015 +0300
----------------------------------------------------------------------
pom.xml | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/445c0a61/pom.xml
----------------------------------------------------------------------