ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [29/29] ignite git commit: topology map 'update' minor optimization
Date Thu, 13 Apr 2017 15:56:59 GMT
topology map 'update' minor optimization


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

Branch: refs/heads/ignite-4929
Commit: 9408ba665ea25746790254228e684c878bc23154
Parents: 3a988bd
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Apr 13 18:56:17 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Apr 13 18:56:17 2017 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtTxPrepareFuture.java      | 15 ---------------
 .../cache/transactions/IgniteTxAdapter.java          |  9 ++++++---
 .../meta/IgfsMetaDirectoryListingAddProcessor.java   |  5 +++--
 .../cache/IgniteOnePhaseCommitInvokeTest.java        |  6 +++---
 4 files changed, 12 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9408ba66/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 3029b09..68e51bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -1527,21 +1527,6 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
     ) {
         GridDistributedTxMapping global = globalMap.get(n.id());
 
-        if (!F.isEmpty(entry.entryProcessors())) {
-            GridDhtPartitionState state = entry.context().topology().partitionState(n.id(),
-                entry.cached().partition());
-
-            if (state != GridDhtPartitionState.OWNING && state != GridDhtPartitionState.EVICTED)
{
-                T2<GridCacheOperation, CacheObject> procVal = entry.entryProcessorCalculatedValue();
-
-                assert procVal != null : entry;
-
-                entry.op(procVal.get1());
-                entry.value(procVal.get2(), true, false);
-                entry.entryProcessors(null);
-            }
-        }
-
         if (global == null)
             globalMap.put(n.id(), global = new GridDistributedTxMapping(n));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9408ba66/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 0bdcafe..b95d3a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -83,6 +83,7 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.CRE
 import static org.apache.ignite.internal.processors.cache.GridCacheOperation.DELETE;
 import static org.apache.ignite.internal.processors.cache.GridCacheOperation.NOOP;
 import static org.apache.ignite.internal.processors.cache.GridCacheOperation.RELOAD;
+import static org.apache.ignite.internal.processors.cache.GridCacheOperation.TRANSFORM;
 import static org.apache.ignite.internal.processors.cache.GridCacheOperation.UPDATE;
 import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
 import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
@@ -1379,6 +1380,8 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
implement
         IgniteTxEntry txEntry,
         boolean metrics,
         @Nullable GridCacheReturn ret) throws GridCacheEntryRemovedException, IgniteCheckedException
{
+        assert txEntry.op() != TRANSFORM || !F.isEmpty(txEntry.entryProcessors()) : txEntry;
+
         GridCacheContext cacheCtx = txEntry.context();
 
         assert cacheCtx != null;
@@ -1404,10 +1407,10 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
implement
 
             CacheObject cacheVal;
 
-            if (txEntry.hasOldValue())
-                cacheVal = txEntry.oldValue();
-            else if (txEntry.hasValue())
+            if (txEntry.hasValue())
                 cacheVal = txEntry.value();
+            else if (txEntry.hasOldValue())
+                cacheVal = txEntry.oldValue();
             else {
                 cacheVal = txEntry.cached().innerGet(
                     null,

http://git-wip-us.apache.org/repos/asf/ignite/blob/9408ba66/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
index 380d997..2e7ecae 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
@@ -80,17 +80,18 @@ public final class IgfsMetaDirectoryListingAddProcessor implements EntryProcesso
     @Override public Void process(MutableEntry<IgniteUuid, IgfsEntryInfo> e, Object...
args) {
         IgfsEntryInfo fileInfo = e.getValue();
 
-        assert fileInfo.isDirectory();
+        assert fileInfo != null && fileInfo.isDirectory() : fileInfo;
 
         Map<String, IgfsListingEntry> listing = new HashMap<>(fileInfo.listing());
 
         // Modify listing in-place.
         IgfsListingEntry oldEntry = listing.put(fileName, entry);
 
-        if (oldEntry != null && !oldEntry.fileId().equals(entry.fileId()))
+        if (oldEntry != null && !oldEntry.fileId().equals(entry.fileId())) {
             throw new IgniteException("Directory listing contains unexpected file" +
                 " [listing=" + listing + ", fileName=" + fileName + ", entry=" + entry +
                 ", oldEntry=" + oldEntry + ']');
+        }
 
         e.setValue(fileInfo.listing(listing));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9408ba66/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteOnePhaseCommitInvokeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteOnePhaseCommitInvokeTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteOnePhaseCommitInvokeTest.java
index adf90e9..29077d2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteOnePhaseCommitInvokeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteOnePhaseCommitInvokeTest.java
@@ -27,7 +27,7 @@ import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.TestRecordingCommunicationSpi;
 import org.apache.ignite.internal.managers.communication.GridIoMessage;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareResponse;
-import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessageV2;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -127,8 +127,8 @@ public class IgniteOnePhaseCommitInvokeTest extends GridCommonAbstractTest
{
             @Override public boolean apply(GridIoMessage msg0) {
                 Message msg = msg0.message();
 
-                return msg instanceof GridDhtPartitionSupplyMessageV2 &&
-                    ((GridDhtPartitionSupplyMessageV2) msg).cacheId() == CU.cacheId(null);
+                return msg instanceof GridDhtPartitionSupplyMessage &&
+                    ((GridDhtPartitionSupplyMessage) msg).cacheId() == CU.cacheId(null);
             }
         });
 


Mime
View raw message