You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2014/12/16 03:48:13 UTC
[2/3] incubator-ignite git commit: GG-9141 - Fixed exchange future.
GG-9141 - Fixed exchange future.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cbd30af3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cbd30af3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cbd30af3
Branch: refs/heads/ignite-1
Commit: cbd30af3032f123b458437526ef4e5cef1512542
Parents: fa69fe8
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Mon Dec 15 16:27:32 2014 -0800
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Mon Dec 15 16:27:32 2014 -0800
----------------------------------------------------------------------
.../processors/cache/GridCacheStoreManager.java | 11 +++--------
.../preloader/GridDhtPartitionsExchangeFuture.java | 6 ++++--
.../GridCacheDhtPreloadMultiThreadedSelfTest.java | 17 +++++------------
3 files changed, 12 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbd30af3/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheStoreManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheStoreManager.java
index f8b7623..e80f8b7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheStoreManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheStoreManager.java
@@ -167,8 +167,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> {
* @return Whether DHT transaction can write to store from DHT.
*/
public boolean writeToStoreFromDht() {
- // TODO GG-9141
- return false;
+ return cctx.config().isWriteBehindEnabled() || locStore;
}
/**
@@ -193,9 +192,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> {
return true;
}
- Collection<? extends K> keys0;
-
- keys0 = convertPortable ?
+ Collection<? extends K> keys0 = convertPortable ?
F.viewReadOnly(keys, new C1<K, K>() {
@Override public K apply(K k) {
return (K)cctx.unwrapPortableIfNeeded(k, false);
@@ -443,9 +440,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> {
}
if (store != null) {
- Collection<? extends K> keys0;
-
- keys0 = convertPortable ?
+ Collection<? extends K> keys0 = convertPortable ?
F.viewReadOnly(keys, new C1<K, K>() {
@Override public K apply(K k) {
return (K)cctx.unwrapPortableIfNeeded(k, false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbd30af3/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 0a95411..65b4522 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -912,8 +912,10 @@ public class GridDhtPartitionsExchangeFuture<K, V> extends GridFutureAdapter<Lon
// If local node is just joining.
if (exchId.nodeId().equals(cctx.localNodeId())) {
try {
- for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts())
- cacheCtx.topology().beforeExchange(exchId);
+ for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts()) {
+ if (!cacheCtx.isLocal())
+ cacheCtx.topology().beforeExchange(exchId);
+ }
}
catch (IgniteCheckedException e) {
onDone(e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbd30af3/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
index 5342bc8..3277c68 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
@@ -32,9 +32,6 @@ public class GridCacheDhtPreloadMultiThreadedSelfTest extends GridCommonAbstract
/** IP finder. */
private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
- /** */
- private boolean cacheEnabled = true;
-
/**
* Creates new test.
*/
@@ -126,7 +123,7 @@ public class GridCacheDhtPreloadMultiThreadedSelfTest extends GridCommonAbstract
/**
* @throws Exception If failed.
*/
- public void _testConcurrentNodesStartStop() throws Exception { // TODO GG-9141
+ public void testConcurrentNodesStartStop() throws Exception {
try {
multithreadedAsync(
new Callable<Object>() {
@@ -156,16 +153,12 @@ public class GridCacheDhtPreloadMultiThreadedSelfTest extends GridCommonAbstract
cfg.setGridName(gridName);
- if (cacheEnabled) {
- for (GridCacheConfiguration cCfg : cfg.getCacheConfiguration()) {
- if (cCfg.getCacheMode() == GridCacheMode.PARTITIONED) {
- cCfg.setAffinity(new GridCacheConsistentHashAffinityFunction(2048, null));
- cCfg.setBackups(1);
- }
+ for (GridCacheConfiguration cCfg : cfg.getCacheConfiguration()) {
+ if (cCfg.getCacheMode() == GridCacheMode.PARTITIONED) {
+ cCfg.setAffinity(new GridCacheConsistentHashAffinityFunction(2048, null));
+ cCfg.setBackups(1);
}
}
- else
- cfg.setCacheConfiguration();
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);