You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2016/01/21 10:04:46 UTC
[01/12] ignite git commit: IGNITE-2414 .NET: TestWithExpiryPolicy is
split into two parts: one is fine, another one is muted due to IGNITE-1423.
Repository: ignite
Updated Branches:
refs/heads/ignite-gg-10837 afc4c1586 -> 5af72825a
IGNITE-2414 .NET: TestWithExpiryPolicy is split into two parts: one is fine, another one is muted due to IGNITE-1423.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5cea2330
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5cea2330
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5cea2330
Branch: refs/heads/ignite-gg-10837
Commit: 5cea23302f44ddd279df7a5e9ddd0a814b781ffb
Parents: c1c2081
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Wed Jan 20 13:48:41 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Jan 20 13:48:41 2016 +0300
----------------------------------------------------------------------
.../Cache/CacheAbstractTest.cs | 70 ++++++++++++++------
1 file changed, 48 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5cea2330/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
index 57e4949..0237a41 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
@@ -935,35 +935,66 @@ namespace Apache.Ignite.Core.Tests.Cache
cache0.RemoveAll(new List<int> { key0, key1 });
- // Test zero expiration.
- cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero));
+ // Test regular expiration.
+ cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(100),
+ TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100)));
cache.Put(key0, key0);
cache.Put(key1, key1);
+ Assert.IsTrue(cache0.ContainsKey(key0));
+ Assert.IsTrue(cache0.ContainsKey(key1));
+ Thread.Sleep(200);
Assert.IsFalse(cache0.ContainsKey(key0));
Assert.IsFalse(cache0.ContainsKey(key1));
cache0.Put(key0, key0);
cache0.Put(key1, key1);
- Assert.IsTrue(cache0.ContainsKey(key0));
- Assert.IsTrue(cache0.ContainsKey(key1));
cache.Put(key0, key0 + 1);
cache.Put(key1, key1 + 1);
+ Assert.IsTrue(cache0.ContainsKey(key0));
+ Assert.IsTrue(cache0.ContainsKey(key1));
+ Thread.Sleep(200);
Assert.IsFalse(cache0.ContainsKey(key0));
Assert.IsFalse(cache0.ContainsKey(key1));
cache0.Put(key0, key0);
cache0.Put(key1, key1);
- cache.Get(key0);
+ cache.Get(key0);
cache.Get(key1);
+ Assert.IsTrue(cache0.ContainsKey(key0));
+ Assert.IsTrue(cache0.ContainsKey(key1));
+ Thread.Sleep(200);
Assert.IsFalse(cache0.ContainsKey(key0));
Assert.IsFalse(cache0.ContainsKey(key1));
+ }
+
+ /// <summary>
+ /// Expiry policy tests for zero and negative expiry values.
+ /// </summary>
+ [Test]
+ [Ignore("IGNITE-1423")]
+ public void TestWithExpiryPolicyZeroNegative()
+ {
+ ICache<int, int> cache0 = Cache(0);
+
+ int key0;
+ int key1;
- cache0.RemoveAll(new List<int> { key0, key1 });
+ if (LocalCache())
+ {
+ key0 = 0;
+ key1 = 1;
+ }
+ else
+ {
+ key0 = PrimaryKeyForCache(cache0);
+ key1 = PrimaryKeyForCache(Cache(1));
+ }
- // Test negative expiration.
- cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(-100),
- TimeSpan.FromMilliseconds(-100), TimeSpan.FromMilliseconds(-100)));
+ var cache = cache0.WithExpiryPolicy(new ExpiryPolicy(null, null, null));
+
+ // Test zero expiration.
+ cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero));
cache.Put(key0, key0);
cache.Put(key1, key1);
@@ -988,37 +1019,32 @@ namespace Apache.Ignite.Core.Tests.Cache
cache0.RemoveAll(new List<int> { key0, key1 });
- // Test regular expiration.
- cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(100),
- TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100)));
+ // Test negative expiration.
+ cache = cache0.WithExpiryPolicy(new ExpiryPolicy(TimeSpan.FromMilliseconds(-100),
+ TimeSpan.FromMilliseconds(-100), TimeSpan.FromMilliseconds(-100)));
cache.Put(key0, key0);
cache.Put(key1, key1);
- Assert.IsTrue(cache0.ContainsKey(key0));
- Assert.IsTrue(cache0.ContainsKey(key1));
- Thread.Sleep(200);
Assert.IsFalse(cache0.ContainsKey(key0));
Assert.IsFalse(cache0.ContainsKey(key1));
cache0.Put(key0, key0);
cache0.Put(key1, key1);
- cache.Put(key0, key0 + 1);
- cache.Put(key1, key1 + 1);
Assert.IsTrue(cache0.ContainsKey(key0));
Assert.IsTrue(cache0.ContainsKey(key1));
- Thread.Sleep(200);
+ cache.Put(key0, key0 + 1);
+ cache.Put(key1, key1 + 1);
Assert.IsFalse(cache0.ContainsKey(key0));
Assert.IsFalse(cache0.ContainsKey(key1));
cache0.Put(key0, key0);
cache0.Put(key1, key1);
- cache.Get(key0);
+ cache.Get(key0);
cache.Get(key1);
- Assert.IsTrue(cache0.ContainsKey(key0));
- Assert.IsTrue(cache0.ContainsKey(key1));
- Thread.Sleep(200);
Assert.IsFalse(cache0.ContainsKey(key0));
Assert.IsFalse(cache0.ContainsKey(key1));
+
+ cache0.RemoveAll(new List<int> { key0, key1 });
}
[Test]
[09/12] ignite git commit: Fixed Visor tasks.
Posted by nt...@apache.org.
Fixed Visor tasks.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bccd4598
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bccd4598
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bccd4598
Branch: refs/heads/ignite-gg-10837
Commit: bccd459842f09572db1c0bf799508c732fa0bc30
Parents: c77fc84
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Thu Jan 21 12:31:01 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu Jan 21 12:31:01 2016 +0700
----------------------------------------------------------------------
.../ignite/internal/visor/cache/VisorCache.java | 45 ++++++++++----------
.../internal/visor/cache/VisorCacheV2.java | 23 +++++++---
.../resources/META-INF/classnames.properties | 15 ++++---
3 files changed, 48 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/bccd4598/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
index 5c1382b..0e830e2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
@@ -257,35 +257,36 @@ public class VisorCache implements Serializable {
* Fill values that should be stored in history;
*
* @param c Source cache.
+ * @return Cache.
*/
- protected void initHistory(VisorCache c) {
- c.name = name;
- c.mode = mode;
- c.memorySize = memorySize;
- c.indexesSize = indexesSize;
- c.size = size;
- c.nearSize = nearSize;
- c.dhtSize = dhtSize;
- c.primarySize = primarySize;
- c.offHeapAllocatedSize = offHeapAllocatedSize;
- c.offHeapEntriesCnt = offHeapEntriesCnt;
- c.swapSize = swapSize;
- c.swapKeys = swapKeys;
- c.partitions = partitions;
- c.primaryPartitions = Collections.emptyList();
- c.backupPartitions = Collections.emptyList();
- c.metrics = metrics;
+ protected VisorCache initHistory(VisorCache c) {
+ if (c != null) {
+ c.name = name;
+ c.mode = mode;
+ c.memorySize = memorySize;
+ c.indexesSize = indexesSize;
+ c.size = size;
+ c.nearSize = nearSize;
+ c.dhtSize = dhtSize;
+ c.primarySize = primarySize;
+ c.offHeapAllocatedSize = offHeapAllocatedSize;
+ c.offHeapEntriesCnt = offHeapEntriesCnt;
+ c.swapSize = swapSize;
+ c.swapKeys = swapKeys;
+ c.partitions = partitions;
+ c.primaryPartitions = Collections.emptyList();
+ c.backupPartitions = Collections.emptyList();
+ c.metrics = metrics;
+ }
+
+ return c;
}
/**
* @return New instance suitable to store in history.
*/
public VisorCache history() {
- VisorCache c = new VisorCache();
-
- initHistory(c);
-
- return c;
+ return initHistory(new VisorCache());
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/bccd4598/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
index a4b0409..6b6aba2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
@@ -36,23 +36,32 @@ public class VisorCacheV2 extends VisorCache {
/** {@inheritDoc} */
@Override public VisorCache from(IgniteEx ignite, String cacheName, int sample) throws IgniteCheckedException {
- super.from(ignite, cacheName, sample);
+ VisorCache c = super.from(ignite, cacheName, sample);
- GridCacheAdapter ca = ignite.context().cache().internalCache(cacheName);
+ if (c != null && c instanceof VisorCacheV2) {
+ GridCacheAdapter ca = ignite.context().cache().internalCache(cacheName);
- // Cache was not started.
- if (ca != null && ca.context().started())
- near = ca.context().isNear();
+ // Cache was not started.
+ if (ca != null && ca.context().started())
+ ((VisorCacheV2)c).near = ca.context().isNear();
+ }
- return this;
+ return c;
}
/** {@inheritDoc} */
- @Override public void initHistory(VisorCache c) {
+ @Override protected VisorCache initHistory(VisorCache c) {
super.initHistory(c);
if (c instanceof VisorCacheV2)
((VisorCacheV2) c).near = near;
+
+ return c;
+ }
+
+ /** {@inheritDoc} */
+ @Override public VisorCache history() {
+ return initHistory(new VisorCacheV2());
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/bccd4598/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index d9a5514..8c3ad88 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -226,7 +226,6 @@ org.apache.ignite.internal.IgniteSchedulerImpl
org.apache.ignite.internal.IgniteServicesImpl
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance$1
org.apache.ignite.internal.NodeStoppingException
-org.apache.ignite.internal.binary.BinaryContext
org.apache.ignite.internal.binary.BinaryEnumObjectImpl
org.apache.ignite.internal.binary.BinaryMetadata
org.apache.ignite.internal.binary.BinaryObjectEx
@@ -452,12 +451,12 @@ org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$6
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$7
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeFutureSet
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$MessageHandler
-org.apache.ignite.internal.processors.cache.GridCacheProcessor$2
+org.apache.ignite.internal.processors.cache.GridCacheProcessor$1
+org.apache.ignite.internal.processors.cache.GridCacheProcessor$3
org.apache.ignite.internal.processors.cache.GridCacheProcessor$4
org.apache.ignite.internal.processors.cache.GridCacheProcessor$5
org.apache.ignite.internal.processors.cache.GridCacheProcessor$6
-org.apache.ignite.internal.processors.cache.GridCacheProcessor$7
-org.apache.ignite.internal.processors.cache.GridCacheProcessor$9
+org.apache.ignite.internal.processors.cache.GridCacheProcessor$8
org.apache.ignite.internal.processors.cache.GridCacheProcessor$LocalAffinityFunction
org.apache.ignite.internal.processors.cache.GridCacheProxyImpl
org.apache.ignite.internal.processors.cache.GridCacheReturn
@@ -496,7 +495,6 @@ org.apache.ignite.internal.processors.cache.GridCacheUtils$2
org.apache.ignite.internal.processors.cache.GridCacheUtils$20
org.apache.ignite.internal.processors.cache.GridCacheUtils$21
org.apache.ignite.internal.processors.cache.GridCacheUtils$23
-org.apache.ignite.internal.processors.cache.GridCacheUtils$24
org.apache.ignite.internal.processors.cache.GridCacheUtils$3
org.apache.ignite.internal.processors.cache.GridCacheUtils$4
org.apache.ignite.internal.processors.cache.GridCacheUtils$5
@@ -722,6 +720,7 @@ org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetResponse
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$1
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$2
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$3
+org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$4
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockFuture$MiniFuture$1
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockResponse
@@ -1113,7 +1112,7 @@ org.apache.ignite.internal.processors.platform.compute.PlatformBroadcastingMulti
org.apache.ignite.internal.processors.platform.compute.PlatformBroadcastingSingleClosureTask
org.apache.ignite.internal.processors.platform.compute.PlatformClosureJob
org.apache.ignite.internal.processors.platform.compute.PlatformCompute$1
-org.apache.ignite.internal.processors.platform.compute.PlatformCompute$2
+org.apache.ignite.internal.processors.platform.compute.PlatformCompute$ComputeConvertingFuture$1
org.apache.ignite.internal.processors.platform.compute.PlatformFullJob
org.apache.ignite.internal.processors.platform.compute.PlatformFullTask
org.apache.ignite.internal.processors.platform.compute.PlatformJob
@@ -1165,6 +1164,7 @@ org.apache.ignite.internal.processors.rest.GridRestProcessor$3
org.apache.ignite.internal.processors.rest.GridRestResponse
org.apache.ignite.internal.processors.rest.client.message.GridClientAbstractMessage
org.apache.ignite.internal.processors.rest.client.message.GridClientAuthenticationRequest
+org.apache.ignite.internal.processors.rest.client.message.GridClientCacheBean
org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest
org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest$GridCacheOperation
org.apache.ignite.internal.processors.rest.client.message.GridClientHandshakeRequest
@@ -1548,6 +1548,7 @@ org.apache.ignite.internal.visor.cache.VisorCacheNearConfiguration
org.apache.ignite.internal.visor.cache.VisorCacheNodesTask
org.apache.ignite.internal.visor.cache.VisorCacheNodesTask$VisorCacheNodesJob
org.apache.ignite.internal.visor.cache.VisorCacheQueryConfiguration
+org.apache.ignite.internal.visor.cache.VisorCacheQueryConfigurationV2
org.apache.ignite.internal.visor.cache.VisorCacheQueryMetrics
org.apache.ignite.internal.visor.cache.VisorCacheRebalanceConfiguration
org.apache.ignite.internal.visor.cache.VisorCacheRebalanceTask
@@ -1560,10 +1561,12 @@ org.apache.ignite.internal.visor.cache.VisorCacheStartTask$VisorCacheStartJob
org.apache.ignite.internal.visor.cache.VisorCacheStopTask
org.apache.ignite.internal.visor.cache.VisorCacheStopTask$VisorCacheStopJob
org.apache.ignite.internal.visor.cache.VisorCacheStoreConfiguration
+org.apache.ignite.internal.visor.cache.VisorCacheStoreConfigurationV2
org.apache.ignite.internal.visor.cache.VisorCacheSwapBackupsTask
org.apache.ignite.internal.visor.cache.VisorCacheSwapBackupsTask$VisorCachesSwapBackupsJob
org.apache.ignite.internal.visor.cache.VisorCacheTypeFieldMetadata
org.apache.ignite.internal.visor.cache.VisorCacheTypeMetadata
+org.apache.ignite.internal.visor.cache.VisorCacheV2
org.apache.ignite.internal.visor.compute.VisorComputeCancelSessionsTask
org.apache.ignite.internal.visor.compute.VisorComputeCancelSessionsTask$VisorComputeCancelSessionsJob
org.apache.ignite.internal.visor.compute.VisorComputeResetMetricsTask
[06/12] ignite git commit: Merge remote-tracking branch
'origin/master'
Posted by nt...@apache.org.
Merge remote-tracking branch 'origin/master'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/27c90640
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/27c90640
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/27c90640
Branch: refs/heads/ignite-gg-10837
Commit: 27c906401d27e1a368449c1cbd0b19dcb33792b9
Parents: 4079a65 5c78572
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Jan 20 15:00:12 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Jan 20 15:00:12 2016 +0300
----------------------------------------------------------------------
.../processors/cluster/ClusterProcessor.java | 37 ++++++++++++++------
1 file changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
[11/12] ignite git commit: Added initialization of 'storeKeepBinary'
flag for cache configurations received on discovery.
Posted by nt...@apache.org.
Added initialization of 'storeKeepBinary' flag for cache configurations received on discovery.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2f84d13
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2f84d13
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2f84d13
Branch: refs/heads/ignite-gg-10837
Commit: d2f84d1312e8bc22ad43b2e9076b881f0644d509
Parents: ba93717
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jan 21 11:45:27 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jan 21 11:45:27 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/cache/GridCacheProcessor.java | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d2f84d13/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 16dfa7f..7e165e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1899,6 +1899,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
else {
for (DynamicCacheChangeRequest req : batch.requests()) {
+ if (req.startCacheConfiguration() != null) {
+ CacheConfiguration ccfg = req.startCacheConfiguration();
+
+ if (ccfg.isStoreKeepBinary() == null)
+ ccfg.setStoreKeepBinary(CacheConfiguration.DFLT_STORE_KEEP_BINARY);
+ }
+
if (req.template()) {
CacheConfiguration ccfg = req.startCacheConfiguration();
[07/12] ignite git commit: IGNITE-2236: Optimized GridCompoundFuture:
- Listener is "inlined" into the class; - Removed "ignoreChildFailures" field.
Posted by nt...@apache.org.
IGNITE-2236: Optimized GridCompoundFuture:
- Listener is "inlined" into the class;
- Removed "ignoreChildFailures" field.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1c302e40
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1c302e40
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1c302e40
Branch: refs/heads/ignite-gg-10837
Commit: 1c302e401b90928d48370757518e505383eb46bf
Parents: 27c9064
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Jan 20 17:17:01 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Jan 20 17:17:01 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheMvccManager.java | 43 ++-
.../distributed/GridCacheTxRecoveryFuture.java | 2 +-
.../dht/CacheDistributedGetFutureAdapter.java | 2 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 2 +-
.../distributed/dht/GridDhtLockFuture.java | 2 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 2 +-
.../colocated/GridDhtColocatedLockFuture.java | 2 +-
.../distributed/near/GridNearLockFuture.java | 2 +-
...arOptimisticSerializableTxPrepareFuture.java | 47 ++-
.../GridNearPessimisticTxPrepareFuture.java | 6 +-
.../near/GridNearTxFinishFuture.java | 29 +-
.../service/GridServiceProcessor.java | 17 +-
.../util/future/GridCompoundFuture.java | 314 +++++--------------
.../util/future/GridCompoundIdentityFuture.java | 6 +-
.../internal/util/future/GridFutureAdapter.java | 2 +
.../ignite/testframework/GridTestUtils.java | 7 +-
16 files changed, 195 insertions(+), 290 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index dbc6992..c7d1f62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -17,17 +17,6 @@
package org.apache.ignite.internal.processors.cache;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ConcurrentMap;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.events.DiscoveryEvent;
@@ -63,6 +52,18 @@ import org.jetbrains.annotations.Nullable;
import org.jsr166.ConcurrentHashMap8;
import org.jsr166.ConcurrentLinkedDeque8;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ConcurrentMap;
+
import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap;
@@ -982,9 +983,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
*/
@SuppressWarnings("unchecked")
public IgniteInternalFuture<?> finishAtomicUpdates(AffinityTopologyVersion topVer) {
- GridCompoundFuture<Object, Object> res = new GridCompoundFuture<>();
-
- res.ignoreChildFailures(ClusterTopologyCheckedException.class, CachePartialUpdateCheckedException.class);
+ GridCompoundFuture<Object, Object> res = new FinishAtomicUpdateFuture();
for (GridCacheAtomicFuture<?> fut : atomicFuts.values()) {
IgniteInternalFuture<Void> complete = fut.completeFuture(topVer);
@@ -1221,4 +1220,20 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
return S.toString(FinishLockFuture.class, this, super.toString());
}
}
+
+ /**
+ * Finish atomic update future.
+ */
+ private static class FinishAtomicUpdateFuture extends GridCompoundFuture<Object, Object> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** {@inheritDoc} */
+ @Override protected boolean ignoreFailure(Throwable err) {
+ Class cls = err.getClass();
+
+ return ClusterTopologyCheckedException.class.isAssignableFrom(cls) ||
+ CachePartialUpdateCheckedException.class.isAssignableFrom(cls);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
index 1648de0..5a4a1ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
@@ -90,7 +90,7 @@ public class GridCacheTxRecoveryFuture extends GridCompoundIdentityFuture<Boolea
UUID failedNodeId,
Map<UUID, Collection<UUID>> txNodes)
{
- super(cctx.kernalContext(), CU.boolReducer());
+ super(CU.boolReducer());
this.cctx = cctx;
this.tx = tx;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
index 40eec63..7efaf49 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
@@ -132,7 +132,7 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
boolean needVer,
boolean keepCacheObjects
) {
- super(cctx.kernalContext(), CU.<K, V>mapsReducer(keys.size()));
+ super(CU.<K, V>mapsReducer(keys.size()));
assert !F.isEmpty(keys);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
index e410228..cb8c842 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
@@ -137,7 +137,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals
) {
- super(cctx.kernalContext(), CU.<GridCacheEntryInfo>collectionsReducer());
+ super(CU.<GridCacheEntryInfo>collectionsReducer());
assert reader != null;
assert !F.isEmpty(keys);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 1c3e052..07755e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -194,7 +194,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
CacheEntryPredicate[] filter,
boolean skipStore,
boolean keepBinary) {
- super(cctx.kernalContext(), CU.boolReducer());
+ super(CU.boolReducer());
assert nearNodeId != null;
assert nearLockVer != null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 0e5db05..8c295ce 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -99,7 +99,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
* @param commit Commit flag.
*/
public GridDhtTxFinishFuture(GridCacheSharedContext<K, V> cctx, GridDhtTxLocalAdapter tx, boolean commit) {
- super(cctx.kernalContext(), F.<IgniteInternalTx>identityReducer(tx));
+ super(F.<IgniteInternalTx>identityReducer(tx));
this.cctx = cctx;
this.tx = tx;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/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 cfeee4b..e4c6b71 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
@@ -169,7 +169,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
CacheEntryPredicate[] filter,
boolean skipStore,
boolean keepBinary) {
- super(cctx.kernalContext(), CU.boolReducer());
+ super(CU.boolReducer());
assert keys != null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 55c5ab6..5d4fc01 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -177,7 +177,7 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
CacheEntryPredicate[] filter,
boolean skipStore,
boolean keepBinary) {
- super(cctx.kernalContext(), CU.boolReducer());
+ super(CU.boolReducer());
assert keys != null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
index 2090e04..4f9f227 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
@@ -90,9 +90,11 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
super(cctx, tx);
assert tx.optimistic() && tx.serializable() : tx;
+ }
- // Should wait for all mini futures completion before finishing tx.
- ignoreChildFailures(IgniteCheckedException.class);
+ /** {@inheritDoc} */
+ @Override protected boolean ignoreFailure(Throwable err) {
+ return IgniteCheckedException.class.isAssignableFrom(err.getClass());
}
/** {@inheritDoc} */
@@ -629,32 +631,43 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
}
/**
- *
+ * Client remap future.
*/
private static class ClientRemapFuture extends GridCompoundFuture<GridNearTxPrepareResponse, Boolean> {
/** */
- private boolean remap = true;
+ private static final long serialVersionUID = 0L;
/**
- *
+ * Constructor.
*/
public ClientRemapFuture() {
- super();
+ super(new ClientRemapFutureReducer());
+ }
+ }
- reducer(new IgniteReducer<GridNearTxPrepareResponse, Boolean>() {
- @Override public boolean collect(GridNearTxPrepareResponse res) {
- assert res != null;
+ /**
+ * Client remap future reducer.
+ */
+ private static class ClientRemapFutureReducer implements IgniteReducer<GridNearTxPrepareResponse, Boolean> {
+ /** */
+ private static final long serialVersionUID = 0L;
- if (res.clientRemapVersion() == null)
- remap = false;
+ /** Remap flag. */
+ private boolean remap = true;
- return true;
- }
+ /** {@inheritDoc} */
+ @Override public boolean collect(@Nullable GridNearTxPrepareResponse res) {
+ assert res != null;
- @Override public Boolean reduce() {
- return remap;
- }
- });
+ if (res.clientRemapVersion() == null)
+ remap = false;
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean reduce() {
+ return remap;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index 9ee9aea..8170008 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -63,9 +63,11 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
super(cctx, tx);
assert tx.pessimistic() : tx;
+ }
- // Should wait for all mini futures completion before finishing tx.
- ignoreChildFailures(IgniteCheckedException.class);
+ /** {@inheritDoc} */
+ @Override protected boolean ignoreFailure(Throwable err) {
+ return IgniteCheckedException.class.isAssignableFrom(err.getClass());
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 26e189b..3c33bc4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -28,7 +28,6 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.NodeStoppingException;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
@@ -107,7 +106,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
* @param commit Commit flag.
*/
public GridNearTxFinishFuture(GridCacheSharedContext<K, V> cctx, GridNearTxLocal tx, boolean commit) {
- super(cctx.kernalContext(), F.<IgniteInternalTx>identityReducer(tx));
+ super(F.<IgniteInternalTx>identityReducer(tx));
this.cctx = cctx;
this.tx = tx;
@@ -644,16 +643,30 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
if (f.getClass() == FinishMiniFuture.class) {
FinishMiniFuture fut = (FinishMiniFuture)f;
- return "FinishFuture[node=" + fut.node().id() +
- ", loc=" + fut.node().isLocal() +
- ", done=" + fut.isDone() + "]";
+ ClusterNode node = fut.node();
+
+ if (node != null) {
+ return "FinishFuture[node=" + node.id() +
+ ", loc=" + node.isLocal() +
+ ", done=" + fut.isDone() + ']';
+ }
+ else {
+ return "FinishFuture[node=null, done=" + fut.isDone() + ']';
+ }
}
else if (f.getClass() == CheckBackupMiniFuture.class) {
CheckBackupMiniFuture fut = (CheckBackupMiniFuture)f;
- return "CheckBackupFuture[node=" + fut.node().id() +
- ", loc=" + fut.node().isLocal() +
- ", done=" + f.isDone() + "]";
+ ClusterNode node = fut.node();
+
+ if (node != null) {
+ return "CheckBackupFuture[node=" + node.id() +
+ ", loc=" + node.isLocal() +
+ ", done=" + f.isDone() + "]";
+ }
+ else {
+ return "CheckBackupFuture[node=null, done=" + f.isDone() + "]";
+ }
}
else if (f.getClass() == CheckRemoteTxMiniFuture.class) {
CheckRemoteTxMiniFuture fut = (CheckRemoteTxMiniFuture)f;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index 6b05edd..2841083 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -515,10 +515,10 @@ public class GridServiceProcessor extends GridProcessorAdapter {
*/
@SuppressWarnings("unchecked")
public IgniteInternalFuture<?> cancelAll() {
- Collection<IgniteInternalFuture<?>> futs = new ArrayList<>();
-
Iterator<Cache.Entry<Object, Object>> it = serviceEntries(ServiceDeploymentPredicate.INSTANCE);
+ GridCompoundFuture res = null;
+
while (it.hasNext()) {
Cache.Entry<Object, Object> e = it.next();
@@ -527,11 +527,20 @@ public class GridServiceProcessor extends GridProcessorAdapter {
GridServiceDeployment dep = (GridServiceDeployment)e.getValue();
+ if (res == null)
+ res = new GridCompoundFuture<>();
+
// Cancel each service separately.
- futs.add(cancel(dep.configuration().getName()));
+ res.add(cancel(dep.configuration().getName()));
}
- return futs.isEmpty() ? new GridFinishedFuture<>() : new GridCompoundFuture(null, futs);
+ if (res != null) {
+ res.markInitialized();
+
+ return res;
+ }
+ else
+ return new GridFinishedFuture<>();
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
index 4b2461e..c382497 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
@@ -17,15 +17,11 @@
package org.apache.ignite.internal.util.future;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.IgniteFutureCancelledCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException;
-import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.C1;
import org.apache.ignite.internal.util.typedef.F;
@@ -35,55 +31,48 @@ import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.lang.IgniteReducer;
import org.jetbrains.annotations.Nullable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+
/**
* Future composed of multiple inner futures.
*/
-public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
+public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements IgniteInClosure<IgniteInternalFuture<T>> {
/** */
private static final long serialVersionUID = 0L;
- /** */
- private static final int INITED = 0b1;
+ /** Initialization flag. */
+ private static final int INIT_FLAG = 0x1;
- /** */
- private static final AtomicIntegerFieldUpdater<GridCompoundFuture> flagsUpd =
- AtomicIntegerFieldUpdater.newUpdater(GridCompoundFuture.class, "flags");
+ /** Flags updater. */
+ private static final AtomicIntegerFieldUpdater<GridCompoundFuture> FLAGS_UPD =
+ AtomicIntegerFieldUpdater.newUpdater(GridCompoundFuture.class, "initFlag");
- /** */
- private static final AtomicIntegerFieldUpdater<GridCompoundFuture> lsnrCallsUpd =
+ /** Listener calls updater. */
+ private static final AtomicIntegerFieldUpdater<GridCompoundFuture> LSNR_CALLS_UPD =
AtomicIntegerFieldUpdater.newUpdater(GridCompoundFuture.class, "lsnrCalls");
/** Futures. */
protected final ArrayList<IgniteInternalFuture<T>> futs = new ArrayList<>();
- /** */
- @GridToStringExclude
- private final Listener lsnr = new Listener();
-
/** Reducer. */
@GridToStringInclude
- private IgniteReducer<T, R> rdc;
-
- /** Exceptions to ignore. */
- private Class<? extends Throwable>[] ignoreChildFailures;
+ private final IgniteReducer<T, R> rdc;
- /**
- * Updated via {@link #flagsUpd}.
- *
- * @see #INITED
- */
+ /** Initialization flag. Updated via {@link #FLAGS_UPD}. */
@SuppressWarnings("unused")
- private volatile int flags;
+ private volatile int initFlag;
- /** Updated via {@link #lsnrCallsUpd}. */
+ /** Listener calls. Updated via {@link #LSNR_CALLS_UPD}. */
@SuppressWarnings("unused")
private volatile int lsnrCalls;
/**
- *
+ * Default constructor.
*/
public GridCompoundFuture() {
- // No-op.
+ this(null);
}
/**
@@ -93,19 +82,59 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
this.rdc = rdc;
}
- /**
- * @param rdc Reducer to add.
- * @param futs Futures to add.
- */
- public GridCompoundFuture(
- @Nullable IgniteReducer<T, R> rdc,
- @Nullable Iterable<IgniteInternalFuture<T>> futs
- ) {
- this.rdc = rdc;
+ /** {@inheritDoc} */
+ @Override public void apply(IgniteInternalFuture<T> fut) {
+ try {
+ T t = fut.get();
+
+ try {
+ if (rdc != null && !rdc.collect(t))
+ onDone(rdc.reduce());
+ }
+ catch (RuntimeException e) {
+ U.error(null, "Failed to execute compound future reducer: " + this, e);
- addAll(futs);
+ // Exception in reducer is a bug, so we bypass checkComplete here.
+ onDone(e);
+ }
+ catch (AssertionError e) {
+ U.error(null, "Failed to execute compound future reducer: " + this, e);
- markInitialized();
+ // Bypass checkComplete because need to rethrow.
+ onDone(e);
+
+ throw e;
+ }
+ }
+ catch (IgniteTxOptimisticCheckedException | IgniteFutureCancelledCheckedException |
+ ClusterTopologyCheckedException e) {
+ if (!ignoreFailure(e))
+ onDone(e);
+ }
+ catch (IgniteCheckedException e) {
+ if (!ignoreFailure(e)) {
+ U.error(null, "Failed to execute compound future reducer: " + this, e);
+
+ onDone(e);
+ }
+ }
+ catch (RuntimeException e) {
+ U.error(null, "Failed to execute compound future reducer: " + this, e);
+
+ onDone(e);
+ }
+ catch (AssertionError e) {
+ U.error(null, "Failed to execute compound future reducer: " + this, e);
+
+ // Bypass checkComplete because need to rethrow.
+ onDone(e);
+
+ throw e;
+ }
+
+ LSNR_CALLS_UPD.incrementAndGet(GridCompoundFuture.this);
+
+ checkComplete();
}
/** {@inheritDoc} */
@@ -125,43 +154,20 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
*
* @return Collection of futures.
*/
- private Collection<IgniteInternalFuture<T>> futures(boolean pending) {
+ public Collection<IgniteInternalFuture<T>> futures() {
synchronized (futs) {
- Collection<IgniteInternalFuture<T>> res = new ArrayList<>(futs.size());
-
- for (IgniteInternalFuture<T> fut : futs) {
- if (!pending || !fut.isDone())
- res.add(fut);
- }
-
- return res;
+ return new ArrayList<>(futs);
}
}
/**
- * Gets collection of futures.
- *
- * @return Collection of futures.
- */
- public Collection<IgniteInternalFuture<T>> futures() {
- return futures(false);
- }
-
- /**
- * Gets pending (unfinished) futures.
+ * Checks if this compound future should ignore this particular exception.
*
- * @return Pending futures.
- */
- public Collection<IgniteInternalFuture<T>> pending() {
- return futures(true);
- }
-
- /**
- * @param ignoreChildFailures Flag indicating whether compound future should ignore child futures failures.
+ * @param err Exception to check.
+ * @return {@code True} if this error should be ignored.
*/
- @SafeVarargs
- public final void ignoreChildFailures(Class<? extends Throwable>... ignoreChildFailures) {
- this.ignoreChildFailures = ignoreChildFailures;
+ protected boolean ignoreFailure(Throwable err) {
+ return false;
}
/**
@@ -187,14 +193,6 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
}
/**
- * @return {@code True} if this future was initialized. Initialization happens when
- * {@link #markInitialized()} method is called on future.
- */
- public boolean initialized() {
- return flagSet(INITED);
- }
-
- /**
* Adds a future to this compound future.
*
* @param fut Future to add.
@@ -206,7 +204,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
futs.add(fut);
}
- fut.listen(lsnr);
+ fut.listen(this);
if (isCancelled()) {
try {
@@ -219,76 +217,18 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
}
/**
- * Adds futures to this compound future.
- *
- * @param futs Futures to add.
- */
- @SafeVarargs
- public final void addAll(@Nullable IgniteInternalFuture<T>... futs) {
- addAll(F.asList(futs));
- }
-
- /**
- * Adds futures to this compound future.
- *
- * @param futs Futures to add.
- */
- public void addAll(@Nullable Iterable<IgniteInternalFuture<T>> futs) {
- if (futs != null) {
- for (IgniteInternalFuture<T> fut : futs)
- add(fut);
- }
- }
-
- /**
- * Gets optional reducer.
- *
- * @return Optional reducer.
- */
- @Nullable public IgniteReducer<T, R> reducer() {
- return rdc;
- }
-
- /**
- * Sets optional reducer.
- *
- * @param rdc Optional reducer.
- */
- public void reducer(@Nullable IgniteReducer<T, R> rdc) {
- this.rdc = rdc;
- }
-
- /**
- * @param flag Flag to CAS.
- * @return {@code True} if CAS succeeds.
- */
- private boolean casFlag(int flag) {
- for (;;) {
- int flags0 = flags;
-
- if ((flags0 & flag) != 0)
- return false;
-
- if (flagsUpd.compareAndSet(this, flags0, flags0 | flag))
- return true;
- }
- }
-
- /**
- * @param flag Flag to check.
- * @return {@code True} if set.
+ * @return {@code True} if this future was initialized. Initialization happens when
+ * {@link #markInitialized()} method is called on future.
*/
- private boolean flagSet(int flag) {
- return (flags & flag) != 0;
+ public boolean initialized() {
+ return initFlag == INIT_FLAG;
}
/**
* Mark this future as initialized.
*/
public void markInitialized() {
- if (casFlag(INITED))
- // Check complete to make sure that we take care
- // of all the ignored callbacks.
+ if (FLAGS_UPD.compareAndSet(this, 0, INIT_FLAG))
checkComplete();
}
@@ -296,7 +236,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
* Check completeness of the future.
*/
private void checkComplete() {
- if (flagSet(INITED) && !isDone() && lsnrCalls == futuresSize()) {
+ if (initialized() && !isDone() && lsnrCalls == futuresSize()) {
try {
onDone(rdc != null ? rdc.reduce() : null);
}
@@ -324,26 +264,6 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
}
}
- /**
- * Checks if this compound future should ignore this particular exception.
- *
- * @param err Exception to check.
- * @return {@code True} if this error should be ignored.
- */
- private boolean ignoreFailure(@Nullable Throwable err) {
- if (err == null)
- return true;
-
- if (ignoreChildFailures != null) {
- for (Class<? extends Throwable> ignoreCls : ignoreChildFailures) {
- if (ignoreCls.isAssignableFrom(err.getClass()))
- return true;
- }
- }
-
- return false;
- }
-
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridCompoundFuture.class, this,
@@ -358,72 +278,4 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
})
);
}
-
- /**
- * Listener for futures.
- */
- private class Listener implements IgniteInClosure<IgniteInternalFuture<T>> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override public void apply(IgniteInternalFuture<T> fut) {
- try {
- T t = fut.get();
-
- try {
- if (rdc != null && !rdc.collect(t))
- onDone(rdc.reduce());
- }
- catch (RuntimeException e) {
- U.error(null, "Failed to execute compound future reducer: " + this, e);
-
- // Exception in reducer is a bug, so we bypass checkComplete here.
- onDone(e);
- }
- catch (AssertionError e) {
- U.error(null, "Failed to execute compound future reducer: " + this, e);
-
- // Bypass checkComplete because need to rethrow.
- onDone(e);
-
- throw e;
- }
- }
- catch (IgniteTxOptimisticCheckedException | IgniteFutureCancelledCheckedException |
- ClusterTopologyCheckedException e) {
- if (!ignoreFailure(e))
- onDone(e);
- }
- catch (IgniteCheckedException e) {
- if (!ignoreFailure(e)) {
- U.error(null, "Failed to execute compound future reducer: " + this, e);
-
- onDone(e);
- }
- }
- catch (RuntimeException e) {
- U.error(null, "Failed to execute compound future reducer: " + this, e);
-
- onDone(e);
- }
- catch (AssertionError e) {
- U.error(null, "Failed to execute compound future reducer: " + this, e);
-
- // Bypass checkComplete because need to rethrow.
- onDone(e);
-
- throw e;
- }
-
- lsnrCallsUpd.incrementAndGet(GridCompoundFuture.this);
-
- checkComplete();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return "Compound future listener []";
- }
- }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundIdentityFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundIdentityFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundIdentityFuture.java
index bb5abf2..4010ccd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundIdentityFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundIdentityFuture.java
@@ -17,13 +17,12 @@
package org.apache.ignite.internal.util.future;
-import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.lang.IgniteReducer;
import org.jetbrains.annotations.Nullable;
/**
- * Future composed of multiple inner futures.
+ * Compound future with reducer which accepts and produces results of the same type.
*/
public class GridCompoundIdentityFuture<T> extends GridCompoundFuture<T, T> {
/** */
@@ -37,10 +36,9 @@ public class GridCompoundIdentityFuture<T> extends GridCompoundFuture<T, T> {
}
/**
- * @param ctx Context.
* @param rdc Reducer.
*/
- public GridCompoundIdentityFuture(GridKernalContext ctx, @Nullable IgniteReducer<T, T> rdc) {
+ public GridCompoundIdentityFuture(@Nullable IgniteReducer<T, T> rdc) {
super(rdc);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
index a1720d5..c6a6a44 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.IgniteFutureCancelledCheckedException;
import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;
@@ -72,6 +73,7 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
private boolean ignoreInterrupts;
/** */
+ @GridToStringExclude
private IgniteInClosure<? super IgniteInternalFuture<R>> lsnr;
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/1c302e40/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
index 26a8994..c7940c6 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
@@ -648,10 +648,11 @@ public final class GridTestUtils {
});
// Compound future, that adds cancel() support to execution future.
- GridCompoundFuture<Long, Long> compFut = new GridCompoundFuture<>();
+ GridCompoundFuture<Long, Long> compFut = new GridCompoundFuture<>(F.sumLongReducer());
+
+ compFut.add(cancelFut);
+ compFut.add(runFut);
- compFut.addAll(cancelFut, runFut);
- compFut.reducer(F.sumLongReducer());
compFut.markInitialized();
cancelFut.onDone();
[12/12] ignite git commit: Merge branch 'master' into ignite-gg-10837
Posted by nt...@apache.org.
Merge branch 'master' into ignite-gg-10837
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5af72825
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5af72825
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5af72825
Branch: refs/heads/ignite-gg-10837
Commit: 5af72825ac98248b3849cd24893d70fc93c8e8c6
Parents: afc4c15 d2f84d1
Author: Tikhonov Nikolay <ti...@gmail.com>
Authored: Thu Jan 21 11:58:03 2016 +0300
Committer: Tikhonov Nikolay <ti...@gmail.com>
Committed: Thu Jan 21 11:58:03 2016 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 2 +-
.../processors/cache/GridCacheMvccManager.java | 43 ++-
.../processors/cache/GridCacheProcessor.java | 7 +
.../distributed/GridCacheTxRecoveryFuture.java | 2 +-
.../dht/CacheDistributedGetFutureAdapter.java | 2 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 2 +-
.../distributed/dht/GridDhtLockFuture.java | 2 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 2 +-
.../colocated/GridDhtColocatedLockFuture.java | 2 +-
.../distributed/near/GridNearLockFuture.java | 2 +-
...arOptimisticSerializableTxPrepareFuture.java | 47 ++-
.../GridNearPessimisticTxPrepareFuture.java | 6 +-
.../near/GridNearTxFinishFuture.java | 29 +-
.../processors/cluster/ClusterProcessor.java | 37 ++-
.../service/GridServiceProcessor.java | 17 +-
.../util/future/GridCompoundFuture.java | 314 +++++--------------
.../util/future/GridCompoundIdentityFuture.java | 6 +-
.../internal/util/future/GridFutureAdapter.java | 2 +
.../ignite/internal/visor/cache/VisorCache.java | 63 ++--
.../visor/cache/VisorCacheConfiguration.java | 4 +-
.../cache/VisorCacheQueryConfiguration.java | 31 +-
.../cache/VisorCacheQueryConfigurationV2.java | 47 +++
.../cache/VisorCacheStoreConfiguration.java | 39 +--
.../cache/VisorCacheStoreConfigurationV2.java | 48 +++
.../internal/visor/cache/VisorCacheV2.java | 73 +++++
.../visor/node/VisorIgfsConfiguration.java | 32 +-
.../visor/node/VisorNodeDataCollectorJob.java | 5 +-
.../visor/node/VisorNodeDataCollectorTask.java | 2 +-
.../resources/META-INF/classnames.properties | 15 +-
.../ignite/testframework/GridTestUtils.java | 7 +-
.../Cache/CacheAbstractTest.cs | 72 +++--
.../Impl/Unmanaged/IgniteJniNativeMethods.cs | 2 +-
.../Impl/Unmanaged/UnmanagedUtils.cs | 6 +-
.../commands/cache/VisorCacheCommand.scala | 10 +-
34 files changed, 557 insertions(+), 423 deletions(-)
----------------------------------------------------------------------
[03/12] ignite git commit: Merge remote-tracking branch
'origin/master'
Posted by nt...@apache.org.
Merge remote-tracking branch 'origin/master'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4d29b2d4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4d29b2d4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4d29b2d4
Branch: refs/heads/ignite-gg-10837
Commit: 4d29b2d427ba23144e14848dcef94ab1c6d8de02
Parents: 5cea233 0abe0df
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Jan 20 13:49:38 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Jan 20 13:49:38 2016 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/configuration/CacheConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[10/12] ignite git commit: Fixed Visor tasks.
Posted by nt...@apache.org.
Fixed Visor tasks.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ba93717f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ba93717f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ba93717f
Branch: refs/heads/ignite-gg-10837
Commit: ba93717f9653769b43332b866c22aa69a58cfd0e
Parents: bccd459
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Thu Jan 21 12:40:15 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu Jan 21 12:40:15 2016 +0700
----------------------------------------------------------------------
.../cache/VisorCacheQueryConfiguration.java | 14 +++++------
.../cache/VisorCacheStoreConfiguration.java | 26 +++++++++-----------
2 files changed, 18 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ba93717f/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
index c00d211..73088bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
@@ -65,15 +65,13 @@ public class VisorCacheQueryConfiguration implements Serializable {
* @return Fill data transfer object with cache query configuration data.
*/
public VisorCacheQueryConfiguration from(CacheConfiguration ccfg) {
- VisorCacheQueryConfiguration cfg = new VisorCacheQueryConfiguration();
+ sqlFuncClss = compactClasses(ccfg.getSqlFunctionClasses());
+ longQryWarnTimeout = ccfg.getLongQueryWarningTimeout();
+ sqlEscapeAll = ccfg.isSqlEscapeAll();
+ indexedTypes = compactClasses(ccfg.getIndexedTypes());
+ sqlOnheapRowCacheSize = ccfg.getSqlOnheapRowCacheSize();
- cfg.sqlFuncClss = compactClasses(ccfg.getSqlFunctionClasses());
- cfg.longQryWarnTimeout = ccfg.getLongQueryWarningTimeout();
- cfg.sqlEscapeAll = ccfg.isSqlEscapeAll();
- cfg.indexedTypes = compactClasses(ccfg.getIndexedTypes());
- cfg.sqlOnheapRowCacheSize = ccfg.getSqlOnheapRowCacheSize();
-
- return cfg;
+ return this;
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/ba93717f/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
index c152d76..2ba1b57 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
@@ -71,27 +71,25 @@ public class VisorCacheStoreConfiguration implements Serializable {
* @return Data transfer object for cache store configuration properties.
*/
public VisorCacheStoreConfiguration from(IgniteEx ignite, CacheConfiguration ccfg) {
- VisorCacheStoreConfiguration cfg = new VisorCacheStoreConfiguration();
-
IgniteCacheProxy<Object, Object> c = ignite.context().cache().jcache(ccfg.getName());
- CacheStore store = c != null && c.context().started() ? c.context().store().configuredStore() : null;
+ CacheStore cstore = c != null && c.context().started() ? c.context().store().configuredStore() : null;
- cfg.jdbcStore = store instanceof CacheAbstractJdbcStore;
+ jdbcStore = cstore instanceof CacheAbstractJdbcStore;
- cfg.store = compactClass(store);
- cfg.storeFactory = compactClass(ccfg.getCacheStoreFactory());
+ store = compactClass(cstore);
+ storeFactory = compactClass(ccfg.getCacheStoreFactory());
- cfg.readThrough = ccfg.isReadThrough();
- cfg.writeThrough = ccfg.isWriteThrough();
+ readThrough = ccfg.isReadThrough();
+ writeThrough = ccfg.isWriteThrough();
- cfg.writeBehindEnabled = ccfg.isWriteBehindEnabled();
- cfg.batchSz = ccfg.getWriteBehindBatchSize();
- cfg.flushFreq = ccfg.getWriteBehindFlushFrequency();
- cfg.flushSz = ccfg.getWriteBehindFlushSize();
- cfg.flushThreadCnt = ccfg.getWriteBehindFlushThreadCount();
+ writeBehindEnabled = ccfg.isWriteBehindEnabled();
+ batchSz = ccfg.getWriteBehindBatchSize();
+ flushFreq = ccfg.getWriteBehindFlushFrequency();
+ flushSz = ccfg.getWriteBehindFlushSize();
+ flushThreadCnt = ccfg.getWriteBehindFlushThreadCount();
- return cfg;
+ return this;
}
/**
[02/12] ignite git commit: Fixed queryEntities initialization from a
default config
Posted by nt...@apache.org.
Fixed queryEntities initialization from a default config
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0abe0df6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0abe0df6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0abe0df6
Branch: refs/heads/ignite-gg-10837
Commit: 0abe0df650c922f4166a4eb8295091a877ed22a0
Parents: c1c2081
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jan 20 13:48:47 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jan 20 13:48:47 2016 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/configuration/CacheConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0abe0df6/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index d52662e..07542de 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -458,7 +458,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
nearCfg = cc.getNearConfiguration();
nodeFilter = cc.getNodeFilter();
pluginCfgs = cc.getPluginConfigurations();
- qryEntities = cc.getQueryEntities();
+ qryEntities = cc.getQueryEntities() == Collections.<QueryEntity>emptyList() ? null : cc.getQueryEntities();
readFromBackup = cc.isReadFromBackup();
rebalanceBatchSize = cc.getRebalanceBatchSize();
rebalanceBatchesPrefetchCount = cc.getRebalanceBatchesPrefetchCount();
[04/12] ignite git commit: G-10964
Posted by nt...@apache.org.
G-10964
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5c785729
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5c785729
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5c785729
Branch: refs/heads/ignite-gg-10837
Commit: 5c7857292e76eda73c6dcaafcd725a5d913b6c3b
Parents: 4d29b2d
Author: Anton Vinogradov <av...@apache.org>
Authored: Wed Jan 20 14:46:46 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Wed Jan 20 14:46:46 2016 +0300
----------------------------------------------------------------------
.../processors/cluster/ClusterProcessor.java | 37 ++++++++++++++------
1 file changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5c785729/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
index 5e8e98d..5ccd680 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
@@ -23,6 +23,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.IgniteSystemProperties;
@@ -57,7 +58,7 @@ public class ClusterProcessor extends GridProcessorAdapter {
private IgniteClusterImpl cluster;
/** */
- private boolean notifyEnabled;
+ private final AtomicBoolean notifyEnabled = new AtomicBoolean();
/** */
@GridToStringExclude
@@ -73,8 +74,8 @@ public class ClusterProcessor extends GridProcessorAdapter {
public ClusterProcessor(GridKernalContext ctx) {
super(ctx);
- notifyEnabled = IgniteSystemProperties.getBoolean(IGNITE_UPDATE_NOTIFIER,
- Boolean.parseBoolean(IgniteProperties.get("ignite.update.notifier.enabled.by.default")));
+ notifyEnabled.set(IgniteSystemProperties.getBoolean(IGNITE_UPDATE_NOTIFIER,
+ Boolean.parseBoolean(IgniteProperties.get("ignite.update.notifier.enabled.by.default"))));
cluster = new IgniteClusterImpl(ctx);
}
@@ -104,7 +105,7 @@ public class ClusterProcessor extends GridProcessorAdapter {
@Nullable @Override public Serializable collectDiscoveryData(UUID nodeId) {
HashMap<String, Object> map = new HashMap<>();
- map.put(ATTR_UPDATE_NOTIFIER_STATUS, notifyEnabled);
+ map.put(ATTR_UPDATE_NOTIFIER_STATUS, notifyEnabled.get());
return map;
}
@@ -116,13 +117,13 @@ public class ClusterProcessor extends GridProcessorAdapter {
Map<String, Object> map = (Map<String, Object>)data;
if (map != null && map.containsKey(ATTR_UPDATE_NOTIFIER_STATUS))
- notifyEnabled = (Boolean)map.get(ATTR_UPDATE_NOTIFIER_STATUS);
+ notifyEnabled.set((Boolean)map.get(ATTR_UPDATE_NOTIFIER_STATUS));
}
}
/** {@inheritDoc} */
@Override public void onKernalStart() throws IgniteCheckedException {
- if (notifyEnabled) {
+ if (notifyEnabled.get()) {
try {
verChecker = new GridUpdateNotifier(ctx.gridName(),
VER_STR,
@@ -133,7 +134,8 @@ public class ClusterProcessor extends GridProcessorAdapter {
updateNtfTimer = new Timer("ignite-update-notifier-timer", true);
// Setup periodic version check.
- updateNtfTimer.scheduleAtFixedRate(new UpdateNotifierTimerTask((IgniteKernal)ctx.grid(), verChecker),
+ updateNtfTimer.scheduleAtFixedRate(
+ new UpdateNotifierTimerTask((IgniteKernal)ctx.grid(), verChecker, notifyEnabled),
0, PERIODIC_VER_CHECK_DELAY);
}
catch (IgniteCheckedException e) {
@@ -155,10 +157,17 @@ public class ClusterProcessor extends GridProcessorAdapter {
}
/**
+ * Disables update notifier.
+ */
+ public void disableUpdateNotifier() {
+ notifyEnabled.set(false);
+ }
+
+ /**
* @return Update notifier status.
*/
public boolean updateNotifierEnabled() {
- return notifyEnabled;
+ return notifyEnabled.get();
}
/**
@@ -184,22 +193,30 @@ public class ClusterProcessor extends GridProcessorAdapter {
/** Whether this is the first run. */
private boolean first = true;
+ /** */
+ private final AtomicBoolean notifyEnabled;
+
/**
* Constructor.
*
* @param kernal Kernal.
* @param verChecker Version checker.
*/
- private UpdateNotifierTimerTask(IgniteKernal kernal, GridUpdateNotifier verChecker) {
+ private UpdateNotifierTimerTask(IgniteKernal kernal, GridUpdateNotifier verChecker,
+ AtomicBoolean notifyEnabled) {
kernalRef = new WeakReference<>(kernal);
log = kernal.context().log(UpdateNotifierTimerTask.class);
this.verChecker = verChecker;
+ this.notifyEnabled = notifyEnabled;
}
/** {@inheritDoc} */
@Override public void safeRun() throws InterruptedException {
+ if (!notifyEnabled.get())
+ return;
+
if (!first) {
IgniteKernal kernal = kernalRef.get();
@@ -228,4 +245,4 @@ public class ClusterProcessor extends GridProcessorAdapter {
}
}
}
-}
\ No newline at end of file
+}
[08/12] ignite git commit: Fixed Visor tasks.
Posted by nt...@apache.org.
Fixed Visor tasks.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c77fc84b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c77fc84b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c77fc84b
Branch: refs/heads/ignite-gg-10837
Commit: c77fc84bdd6a232adabc9a8023c5746649941908
Parents: 1c302e4
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Wed Jan 20 21:42:04 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Jan 20 21:42:04 2016 +0700
----------------------------------------------------------------------
.../ignite/internal/visor/cache/VisorCache.java | 30 ++++-----
.../visor/cache/VisorCacheConfiguration.java | 4 +-
.../cache/VisorCacheQueryConfiguration.java | 15 +----
.../cache/VisorCacheQueryConfigurationV2.java | 47 ++++++++++++++
.../cache/VisorCacheStoreConfiguration.java | 13 +---
.../cache/VisorCacheStoreConfigurationV2.java | 48 +++++++++++++++
.../internal/visor/cache/VisorCacheV2.java | 64 ++++++++++++++++++++
.../visor/node/VisorIgfsConfiguration.java | 32 +++++++++-
.../visor/node/VisorNodeDataCollectorJob.java | 5 +-
.../visor/node/VisorNodeDataCollectorTask.java | 2 +-
.../commands/cache/VisorCacheCommand.scala | 10 ++-
11 files changed, 220 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
index 6def8c3..5c1382b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
@@ -108,9 +108,6 @@ public class VisorCache implements Serializable {
/** Cache partitions states. */
private GridDhtPartitionMap2 partitionsMap;
- /** Flag indicating that cache has near cache. */
- private boolean near;
-
/**
* @param ignite Grid.
* @param cacheName Cache name.
@@ -143,8 +140,6 @@ public class VisorCache implements Serializable {
CacheConfiguration cfg = ca.configuration();
- near = ca.context().isNear();
-
mode = cfg.getCacheMode();
boolean partitioned = (mode == CacheMode.PARTITIONED || mode == CacheMode.REPLICATED)
@@ -259,11 +254,11 @@ public class VisorCache implements Serializable {
}
/**
- * @return New instance suitable to store in history.
+ * Fill values that should be stored in history;
+ *
+ * @param c Source cache.
*/
- public VisorCache history() {
- VisorCache c = new VisorCache();
-
+ protected void initHistory(VisorCache c) {
c.name = name;
c.mode = mode;
c.memorySize = memorySize;
@@ -280,7 +275,15 @@ public class VisorCache implements Serializable {
c.primaryPartitions = Collections.emptyList();
c.backupPartitions = Collections.emptyList();
c.metrics = metrics;
- c.near = near;
+ }
+
+ /**
+ * @return New instance suitable to store in history.
+ */
+ public VisorCache history() {
+ VisorCache c = new VisorCache();
+
+ initHistory(c);
return c;
}
@@ -411,13 +414,6 @@ public class VisorCache implements Serializable {
return partitionsMap;
}
- /**
- * @return {@code true} if cache has near cache.
- */
- public boolean near() {
- return near;
- }
-
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(VisorCache.class, this);
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java
index 69eb311..b29f6d5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java
@@ -151,8 +151,8 @@ public class VisorCacheConfiguration implements Serializable {
evictCfg = VisorCacheEvictionConfiguration.from(ccfg);
nearCfg = VisorCacheNearConfiguration.from(ccfg);
dfltCfg = VisorCacheDefaultConfiguration.from(ccfg);
- storeCfg = VisorCacheStoreConfiguration.from(ignite, ccfg);
- qryCfg = VisorCacheQueryConfiguration.from(ccfg);
+ storeCfg = new VisorCacheStoreConfiguration().from(ignite, ccfg);
+ qryCfg = new VisorCacheQueryConfiguration().from(ccfg);
return this;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
index a779db4..c00d211 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfiguration.java
@@ -35,9 +35,6 @@ public class VisorCacheQueryConfiguration implements Serializable {
private long longQryWarnTimeout;
/** */
- private String sqlSchema;
-
- /** */
private boolean sqlEscapeAll;
/** */
@@ -67,12 +64,11 @@ public class VisorCacheQueryConfiguration implements Serializable {
* @param ccfg Cache configuration.
* @return Fill data transfer object with cache query configuration data.
*/
- public static VisorCacheQueryConfiguration from(CacheConfiguration ccfg) {
+ public VisorCacheQueryConfiguration from(CacheConfiguration ccfg) {
VisorCacheQueryConfiguration cfg = new VisorCacheQueryConfiguration();
cfg.sqlFuncClss = compactClasses(ccfg.getSqlFunctionClasses());
cfg.longQryWarnTimeout = ccfg.getLongQueryWarningTimeout();
- cfg.sqlSchema = ccfg.getSqlSchema();
cfg.sqlEscapeAll = ccfg.isSqlEscapeAll();
cfg.indexedTypes = compactClasses(ccfg.getIndexedTypes());
cfg.sqlOnheapRowCacheSize = ccfg.getSqlOnheapRowCacheSize();
@@ -95,13 +91,6 @@ public class VisorCacheQueryConfiguration implements Serializable {
}
/**
- * @return Schema name, which is used by SQL engine for SQL statements generation.
- */
- public String sqlSchema() {
- return sqlSchema;
- }
-
- /**
* @return {@code true} if SQL engine generate SQL statements with escaped names.
*/
public boolean sqlEscapeAll() {
@@ -121,4 +110,4 @@ public class VisorCacheQueryConfiguration implements Serializable {
public int sqlOnheapRowCacheSize() {
return sqlOnheapRowCacheSize;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfigurationV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfigurationV2.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfigurationV2.java
new file mode 100644
index 0000000..e914b73
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheQueryConfigurationV2.java
@@ -0,0 +1,47 @@
+/*
+ * 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.visor.cache;
+
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ * Data transfer object for cache query configuration data.
+ */
+public class VisorCacheQueryConfigurationV2 extends VisorCacheQueryConfiguration {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private String sqlSchema;
+
+ /**
+ * @return Schema name, which is used by SQL engine for SQL statements generation.
+ */
+ public String sqlSchema() {
+ return sqlSchema;
+ }
+
+ /** {@inheritDoc} */
+ @Override public VisorCacheQueryConfiguration from(CacheConfiguration ccfg) {
+ super.from(ccfg);
+
+ sqlSchema = ccfg.getSqlSchema();
+
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
index 38a419a..c152d76 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfiguration.java
@@ -65,15 +65,12 @@ public class VisorCacheStoreConfiguration implements Serializable {
/** Number of threads that will perform cache flushing. */
private int flushThreadCnt;
- /** Keep binary in store flag. */
- private boolean storeKeepBinary;
-
/**
* @param ignite Ignite instance.
* @param ccfg Cache configuration.
* @return Data transfer object for cache store configuration properties.
*/
- public static VisorCacheStoreConfiguration from(IgniteEx ignite, CacheConfiguration ccfg) {
+ public VisorCacheStoreConfiguration from(IgniteEx ignite, CacheConfiguration ccfg) {
VisorCacheStoreConfiguration cfg = new VisorCacheStoreConfiguration();
IgniteCacheProxy<Object, Object> c = ignite.context().cache().jcache(ccfg.getName());
@@ -84,7 +81,6 @@ public class VisorCacheStoreConfiguration implements Serializable {
cfg.store = compactClass(store);
cfg.storeFactory = compactClass(ccfg.getCacheStoreFactory());
- cfg.storeKeepBinary = ccfg.isStoreKeepBinary();
cfg.readThrough = ccfg.isReadThrough();
cfg.writeThrough = ccfg.isWriteThrough();
@@ -127,13 +123,6 @@ public class VisorCacheStoreConfiguration implements Serializable {
}
/**
- * @return Keep binary in store flag.
- */
- public boolean storeKeepBinary() {
- return storeKeepBinary;
- }
-
- /**
* @return Whether cache should operate in read-through mode.
*/
public boolean readThrough() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfigurationV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfigurationV2.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfigurationV2.java
new file mode 100644
index 0000000..8595177
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStoreConfigurationV2.java
@@ -0,0 +1,48 @@
+/*
+ * 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.visor.cache;
+
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+
+/**
+ * Data transfer object for cache store configuration properties.
+ */
+public class VisorCacheStoreConfigurationV2 extends VisorCacheStoreConfiguration {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Keep binary in store flag. */
+ private boolean storeKeepBinary;
+
+ /** {@inheritDoc} */
+ @Override public VisorCacheStoreConfiguration from(IgniteEx ignite, CacheConfiguration ccfg) {
+ super.from(ignite, ccfg);
+
+ storeKeepBinary = ccfg.isStoreKeepBinary();
+
+ return this;
+ }
+
+ /**
+ * @return Keep binary in store flag.
+ */
+ public boolean storeKeepBinary() {
+ return storeKeepBinary;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
new file mode 100644
index 0000000..a4b0409
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
@@ -0,0 +1,64 @@
+/*
+ * 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.visor.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+
+/**
+ * Data transfer object for {@link IgniteCache}.
+ */
+public class VisorCacheV2 extends VisorCache {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Flag indicating that cache has near cache.
+ */
+ private boolean near;
+
+ /** {@inheritDoc} */
+ @Override public VisorCache from(IgniteEx ignite, String cacheName, int sample) throws IgniteCheckedException {
+ super.from(ignite, cacheName, sample);
+
+ GridCacheAdapter ca = ignite.context().cache().internalCache(cacheName);
+
+ // Cache was not started.
+ if (ca != null && ca.context().started())
+ near = ca.context().isNear();
+
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void initHistory(VisorCache c) {
+ super.initHistory(c);
+
+ if (c instanceof VisorCacheV2)
+ ((VisorCacheV2) c).near = near;
+ }
+
+ /**
+ * @return {@code true} if cache has near cache.
+ */
+ public boolean near() {
+ return near;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
index ea0e721..50917eb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
@@ -62,6 +62,15 @@ public class VisorIgfsConfiguration implements Serializable {
/** Number of batches that can be concurrently sent to remote node. */
private int perNodeParallelBatchCnt;
+ /** @deprecated Needed only for backward compatibility. */
+ private String secondaryHadoopFileSysUri;
+
+ /** @deprecated Needed only for backward compatibility. */
+ private String secondaryHadoopFileSysCfgPath;
+
+ /** @deprecated Needed only for backward compatibility. */
+ private String secondaryHadoopFileSysUserName;
+
/** IGFS instance mode. */
private IgfsMode dfltMode;
@@ -229,6 +238,27 @@ public class VisorIgfsConfiguration implements Serializable {
}
/**
+ * @deprecated Needed only for backward compatibility.
+ */
+ @Nullable public String secondaryHadoopFileSystemUri() {
+ return secondaryHadoopFileSysUri;
+ }
+
+ /**
+ * @deprecated Needed only for backward compatibility.
+ */
+ @Nullable public String secondaryHadoopFileSystemUserName() {
+ return secondaryHadoopFileSysUserName;
+ }
+
+ /**
+ * @deprecated Needed only for backward compatibility.
+ */
+ @Nullable public String secondaryHadoopFileSystemConfigPath() {
+ return secondaryHadoopFileSysCfgPath;
+ }
+
+ /**
* @return IGFS instance mode.
*/
public IgfsMode defaultMode() {
@@ -351,4 +381,4 @@ public class VisorIgfsConfiguration implements Serializable {
@Override public String toString() {
return S.toString(VisorIgfsConfiguration.class, this);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
index 1deabe5..a135b7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
@@ -28,6 +28,7 @@ import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.visor.VisorJob;
import org.apache.ignite.internal.visor.cache.VisorCache;
+import org.apache.ignite.internal.visor.cache.VisorCacheV2;
import org.apache.ignite.internal.visor.compute.VisorComputeMonitoringHolder;
import org.apache.ignite.internal.visor.igfs.VisorIgfs;
import org.apache.ignite.internal.visor.igfs.VisorIgfsEndpoint;
@@ -130,7 +131,7 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
long start0 = U.currentTimeMillis();
try {
- VisorCache cache = new VisorCache().from(ignite, cacheName, arg.sample());
+ VisorCache cache = new VisorCacheV2().from(ignite, cacheName, arg.sample());
if (cache != null)
res.caches().add(cache);
@@ -230,4 +231,4 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
@Override public String toString() {
return S.toString(VisorNodeDataCollectorJob.class, this);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTask.java
index 395cddb..494f902 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTask.java
@@ -138,4 +138,4 @@ public class VisorNodeDataCollectorTask extends VisorMultiNodeTask<VisorNodeData
if (jobRes.igfssEx() != null)
taskRes.igfssEx().put(nid, new VisorExceptionWrapper(jobRes.igfssEx()));
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c77fc84b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index 57f7066..13b4e32 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -866,7 +866,10 @@ object VisorCacheCommand {
cacheT += ("Store Enabled", bool2Str(storeCfg.enabled()))
cacheT += ("Store Class", safe(storeCfg.store()))
cacheT += ("Store Factory Class", storeCfg.storeFactory())
- cacheT += ("Store Keep Binary", storeCfg.storeKeepBinary())
+ cacheT += ("Store Keep Binary", storeCfg match {
+ case cfg: VisorCacheStoreConfigurationV2 => cfg.storeKeepBinary()
+ case _ => false
+ })
cacheT += ("Store Read Through", bool2Str(storeCfg.readThrough()))
cacheT += ("Store Write Through", bool2Str(storeCfg.writeThrough()))
@@ -889,7 +892,10 @@ object VisorCacheCommand {
cacheT += ("Expiry Policy Factory Class Name", safe(cfg.expiryPolicyFactory()))
cacheT +=("Query Execution Time Threshold", queryCfg.longQueryWarningTimeout())
- cacheT +=("Query Schema Name", queryCfg.sqlSchema())
+ cacheT +=("Query Schema Name", queryCfg match {
+ case cfg: VisorCacheQueryConfigurationV2 => cfg.sqlSchema()
+ case _ => null
+ })
cacheT +=("Query Escaped Names", bool2Str(queryCfg.sqlEscapeAll()))
cacheT +=("Query Onheap Cache Size", queryCfg.sqlOnheapRowCacheSize())
[05/12] ignite git commit: IGNITE-2410: .NET: Fixed JVM crash in
DestroyCache() method. This closes #413.
Posted by nt...@apache.org.
IGNITE-2410: .NET: Fixed JVM crash in DestroyCache() method. This closes #413.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4079a65d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4079a65d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4079a65d
Branch: refs/heads/ignite-gg-10837
Commit: 4079a65dc277b0187aa7727a0a0ce2ad1d325a74
Parents: 4d29b2d
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Wed Jan 20 14:59:32 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Jan 20 14:59:32 2016 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs | 2 ++
.../Impl/Unmanaged/IgniteJniNativeMethods.cs | 2 +-
.../dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs | 6 ++----
3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4079a65d/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
index 0237a41..e57df6f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
@@ -3117,6 +3117,8 @@ namespace Apache.Ignite.Core.Tests.Cache
var ex = Assert.Throws<ArgumentException>(() => ignite.GetCache<int, int>(cacheName));
Assert.IsTrue(ex.Message.StartsWith("Cache doesn't exist"));
+
+ Assert.Throws<InvalidOperationException>(() => cache.Get(1));
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4079a65d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
index 70ad733..7a73bee 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
@@ -56,7 +56,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
public static extern void* ProcessorGetOrCreateCache(void* ctx, void* obj, sbyte* name);
[DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteProcessorDestroyCache")]
- public static extern void* ProcessorDestroyCache(void* ctx, void* obj, sbyte* name);
+ public static extern void ProcessorDestroyCache(void* ctx, void* obj, sbyte* name);
[DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteProcessorAffinity")]
public static extern void* ProcessorAffinity(void* ctx, void* obj, sbyte* name);
http://git-wip-us.apache.org/repos/asf/ignite/blob/4079a65d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
index 7b12010..f460c9f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
@@ -163,15 +163,13 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
}
}
- internal static IUnmanagedTarget ProcessorDestroyCache(IUnmanagedTarget target, string name)
+ internal static void ProcessorDestroyCache(IUnmanagedTarget target, string name)
{
sbyte* name0 = IgniteUtils.StringToUtf8Unmanaged(name);
try
{
- void* res = JNI.ProcessorDestroyCache(target.Context, target.Target, name0);
-
- return target.ChangeTarget(res);
+ JNI.ProcessorDestroyCache(target.Context, target.Target, name0);
}
finally
{