ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [10/20] incubator-ignite git commit: ignite-443 review
Date Tue, 31 Mar 2015 10:39:18 GMT
ignite-443 review


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

Branch: refs/heads/ignite-sprint-3
Commit: aa99733c64a06409be6a96ae95644a95440336ea
Parents: 2fd8c33
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Fri Mar 27 17:18:40 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Fri Mar 27 17:18:40 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheContext.java      |  3 +-
 .../version/CacheVersionConflictResolver.java   | 32 +++++++++++++++-----
 2 files changed, 26 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa99733c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 9dfb356..e32bbe8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -247,7 +247,8 @@ public class GridCacheContext<K, V> implements Externalizable {
         GridCacheTtlManager ttlMgr,
         GridCacheDrManager drMgr,
         CacheJtaManagerAdapter jtaMgr,
-        CacheConflictManager<K, V> rslvrMgr) {
+        CacheConflictManager<K, V> rslvrMgr
+    ) {
         assert ctx != null;
         assert sharedCtx != null;
         assert cacheCfg != null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa99733c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolver.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolver.java
index a18eedd..128f270 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolver.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolver.java
@@ -33,11 +33,20 @@ public class CacheVersionConflictResolver {
      * @return Conflict resolution context.
      * @throws IgniteCheckedException If failed.
      */
-    public <K, V> GridCacheVersionConflictContext<K, V> resolve(GridCacheVersionedEntryEx<K,
V> oldEntry,
-        GridCacheVersionedEntryEx<K, V> newEntry, boolean atomicVerComparator) throws
IgniteCheckedException {
-        GridCacheVersionConflictContext<K, V> ctx = new GridCacheVersionConflictContext<>(oldEntry,
newEntry);
+    public <K, V> GridCacheVersionConflictContext<K, V> resolve(
+        GridCacheVersionedEntryEx<K, V> oldEntry,
+        GridCacheVersionedEntryEx<K, V> newEntry,
+        boolean atomicVerComparator
+    ) throws IgniteCheckedException {
+        GridCacheVersionConflictContext<K, V> ctx = new GridCacheVersionConflictContext<>(
+            oldEntry,
+            newEntry);
 
-        resolve0(ctx, oldEntry, newEntry, atomicVerComparator);
+        resolve0(
+            ctx,
+            oldEntry,
+            newEntry,
+            atomicVerComparator);
 
         return ctx;
     }
@@ -51,9 +60,12 @@ public class CacheVersionConflictResolver {
      * @param atomicVerComparator Whether to use atomic version comparator.
      * @throws IgniteCheckedException If failed.
      */
-    protected <K, V> void resolve0(GridCacheVersionConflictContext<K, V> ctx,
-        GridCacheVersionedEntryEx<K, V> oldEntry, GridCacheVersionedEntryEx<K, V>
newEntry,
-        boolean atomicVerComparator) throws IgniteCheckedException {
+    protected <K, V> void resolve0(
+        GridCacheVersionConflictContext<K, V> ctx,
+        GridCacheVersionedEntryEx<K, V> oldEntry,
+        GridCacheVersionedEntryEx<K, V> newEntry,
+        boolean atomicVerComparator
+    ) throws IgniteCheckedException {
         if (newEntry.dataCenterId() != oldEntry.dataCenterId())
             ctx.useNew();
         else {
@@ -62,7 +74,11 @@ public class CacheVersionConflictResolver {
             else {
                 if (atomicVerComparator) {
                     // Handle special case when version check using ATOMIC cache comparator
is required.
-                    if (GridCacheMapEntry.ATOMIC_VER_COMPARATOR.compare(oldEntry.version(),
newEntry.version(), false) >= 0)
+                    if (GridCacheMapEntry.ATOMIC_VER_COMPARATOR
+                        .compare(
+                            oldEntry.version(),
+                            newEntry.version(),
+                            false) >= 0)
                         ctx.useOld();
                     else
                         ctx.useNew();


Mime
View raw message