ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [4/9] incubator-ignite git commit: GG-9141 - Fixes for DR.
Date Fri, 19 Dec 2014 06:16:11 GMT
GG-9141 - Fixes for DR.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/72b82b21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/72b82b21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/72b82b21

Branch: refs/heads/ignite-41
Commit: 72b82b21ccf6fcdeb076af4b17bbba66b48ef9cb
Parents: 88a2d8d
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Thu Dec 18 12:33:23 2014 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Thu Dec 18 12:33:23 2014 -0800

----------------------------------------------------------------------
 .../kernal/processors/cache/GridCacheSharedContext.java   | 10 ++++++++++
 .../kernal/processors/cache/GridCacheTxLocalAdapter.java  |  6 ++----
 .../kernal/processors/cache/GridCacheVersionManager.java  |  2 +-
 .../grid/cache/spring/GridSpringCacheManager.java         |  5 ++---
 4 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/72b82b21/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java
index ab23680..10256b0 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java
@@ -174,6 +174,16 @@ public class GridCacheSharedContext<K, V> {
     }
 
     /**
+     * @return Data center ID.
+     */
+    public byte dataCenterId() {
+        // Data center ID is same for all caches, so grab the first one.
+        GridCacheContext<K, V> cacheCtx = F.first(cacheContexts());
+
+        return cacheCtx.dataCenterId();
+    }
+
+    /**
      * @return Compound preloaders start future.
      */
     public IgniteFuture<Object> preloadersStartFuture() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/72b82b21/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
index 384b243..16ed64f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
@@ -706,7 +706,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                                             txEntry.filters(),
                                             cached.detached() ? DR_NONE : drType,
                                             txEntry.drExpireTime(),
-                                            near() ? null : explicitVer,
+                                            cached.isNear() ? null : explicitVer,
                                             CU.subjectId(this, cctx),
                                             resolveTaskName());
 
@@ -742,7 +742,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                                             topVer,
                                             txEntry.filters(),
                                             cached.detached()  ? DR_NONE : drType,
-                                            near() ? null : explicitVer,
+                                            cached.isNear() ? null : explicitVer,
                                             CU.subjectId(this, cctx),
                                             resolveTaskName());
 
@@ -769,8 +769,6 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                                             nearCached.innerReload(CU.<K, V>empty());
                                     }
                                     else if (op == READ) {
-                                        assert near();
-
                                         if (log.isDebugEnabled())
                                             log.debug("Ignoring READ entry when committing:
" + txEntry);
                                     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/72b82b21/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheVersionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheVersionManager.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheVersionManager.java
index 3c2d8e7..000b99b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheVersionManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheVersionManager.java
@@ -79,7 +79,7 @@ public class GridCacheVersionManager<K, V> extends GridCacheSharedManagerAdapter
     @Override public void start0() throws IgniteCheckedException {
         txSerEnabled = cctx.gridConfig().getTransactionsConfiguration().isTxSerializableEnabled();
 
-        dataCenterId = 0; //cctx.dataCenterId(); TODO GG-9141 Grab data center ID from DR
manager.
+        dataCenterId = cctx.dataCenterId();
 
         last = new GridCacheVersion(0, 0, order.get(), 0, dataCenterId);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/72b82b21/modules/spring/src/main/java/org/gridgain/grid/cache/spring/GridSpringCacheManager.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/gridgain/grid/cache/spring/GridSpringCacheManager.java
b/modules/spring/src/main/java/org/gridgain/grid/cache/spring/GridSpringCacheManager.java
index daad4d3..4edd808 100644
--- a/modules/spring/src/main/java/org/gridgain/grid/cache/spring/GridSpringCacheManager.java
+++ b/modules/spring/src/main/java/org/gridgain/grid/cache/spring/GridSpringCacheManager.java
@@ -13,7 +13,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.resources.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.cache.*;
 import org.gridgain.grid.util.typedef.*;
 import org.gridgain.grid.util.typedef.internal.*;
@@ -67,7 +66,7 @@ import java.util.*;
  *     &lt;cache:annotation-driven/&gt;
  * &lt;/beans&gt;
  * </pre>
- * Or you can provide a {@link org.apache.ignite.configuration.IgniteConfiguration} bean,
like below:
+ * Or you can provide a {@link IgniteConfiguration} bean, like below:
  * <pre name="code" class="xml">
  * &lt;beans xmlns="http://www.springframework.org/schema/beans"
  *        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -115,7 +114,7 @@ import java.util.*;
  * for node startup.
  * <p>
  * If neither {@link #setConfigurationPath(String) configurationPath},
- * {@link #setConfiguration(org.apache.ignite.configuration.IgniteConfiguration) configuration},
nor
+ * {@link #setConfiguration(IgniteConfiguration) configuration}, nor
  * {@link #setGridName(String) gridName} are provided, cache manager
  * will try to use default Grid instance (the one with the {@code null}
  * name). If it doesn't exist, exception will be thrown.


Mime
View raw message