ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [30/30] incubator-ignite git commit: #IGNITE-443 Moved CacheVerstionConflictResolver
Date Tue, 31 Mar 2015 09:15:20 GMT
#IGNITE-443 Moved CacheVerstionConflictResolver


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

Branch: refs/heads/ignite-443
Commit: da1b89f18c8a32d0eed4ac923002f12e223dac71
Parents: 64750bc
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Tue Mar 31 12:14:18 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Tue Mar 31 12:14:18 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheContext.java      |  2 +-
 .../processors/cache/GridCacheProcessor.java    |  6 +-
 .../CacheVersionConflictResolverImpl.java       | 84 --------------------
 .../loadtests/hashmap/GridCacheTestContext.java |  5 +-
 4 files changed, 8 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da1b89f1/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 7187600..8f202a8 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,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         GridCacheTtlManager ttlMgr,
         GridCacheDrManager drMgr,
         CacheJtaManagerAdapter jtaMgr,
-        CacheConflictManager<K, V> rslvrMgr
+        CacheConflictResolverManager<K, V> rslvrMgr
     ) {
         assert ctx != null;
         assert sharedCtx != null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da1b89f1/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 41ff94e..4b0955f 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
@@ -1039,7 +1039,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             ttlMgr,
             drMgr,
             jta,
-            rslvrMgr);
+            rslvrMgr
+        );
 
         cacheCtx.cacheObjectContext(cacheObjCtx);
 
@@ -1164,7 +1165,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 ttlMgr,
                 drMgr,
                 jta,
-                rslvrMgr);
+                rslvrMgr
+            );
 
             cacheCtx.cacheObjectContext(cacheObjCtx);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da1b89f1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolverImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolverImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolverImpl.java
deleted file mode 100644
index 9f316a8..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionConflictResolverImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.version;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.processors.cache.*;
-
-/**
- * Cache version conflict resolver.
- */
-public class CacheVersionConflictResolverImpl implements CacheVersionConflictResolver {
-    /** {@inheritDoc} */
-    @Override 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);
-
-        return ctx;
-    }
-
-    /**
-     * Internal conflict resolution routine.
-     *
-     * @param ctx Context.
-     * @param oldEntry Old entry.
-     * @param newEntry New entry.
-     * @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 {
-        if (newEntry.dataCenterId() != oldEntry.dataCenterId())
-            ctx.useNew();
-        else {
-            if (oldEntry.isStartVersion())
-                ctx.useNew();
-            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)
-                        ctx.useOld();
-                    else
-                        ctx.useNew();
-                }
-                else {
-                    long topVerDiff = newEntry.topologyVersion() - oldEntry.topologyVersion();
-
-                    if (topVerDiff > 0)
-                        ctx.useNew();
-                    else if (topVerDiff < 0)
-                        ctx.useOld();
-                    else if (newEntry.order() > oldEntry.order())
-                        ctx.useNew();
-                    else
-                        ctx.useOld();
-                }
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/da1b89f1/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
index b34e6e6..187616e 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
@@ -21,7 +21,7 @@ import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.datastructures.*;
-import org.apache.ignite.internal.processors.cache.dr.GridOsCacheDrManager;
+import org.apache.ignite.internal.processors.cache.dr.*;
 import org.apache.ignite.internal.processors.cache.jta.*;
 import org.apache.ignite.internal.processors.cache.query.*;
 import org.apache.ignite.internal.processors.cache.query.continuous.*;
@@ -70,6 +70,7 @@ public class GridCacheTestContext<K, V> extends GridCacheContext<K,
V> {
             new GridCacheTtlManager(),
             new GridOsCacheDrManager(),
             new CacheNoopJtaManager(),
-            new CacheOsConflictResolverManager<K, V>());
+            new CacheOsConflictResolverManager<K, V>()
+        );
     }
 }


Mime
View raw message