ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1329 Removed outdated code from GridCacheIoManager
Date Wed, 30 Sep 2015 10:44:06 GMT
Repository: ignite
Updated Branches:
  refs/heads/master c6ec7e116 -> cd4396728


ignite-1329 Removed outdated code from GridCacheIoManager


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

Branch: refs/heads/master
Commit: cd439672847d764838075b7eafae504ce27d0563
Parents: c6ec7e1
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Sep 30 13:43:41 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Sep 30 13:43:41 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheIoManager.java    | 76 +-------------------
 .../processors/cache/GridCacheMessage.java      |  7 --
 .../cache/GridCacheSharedContext.java           | 32 ---------
 .../processors/cache/GridCacheUtils.java        |  8 ---
 .../dht/GridDhtAffinityAssignmentRequest.java   |  5 --
 .../dht/GridDhtAffinityAssignmentResponse.java  |  5 --
 .../distributed/dht/GridDhtLockRequest.java     |  5 --
 .../distributed/dht/GridDhtTxFinishRequest.java |  5 --
 .../dht/GridDhtTxPrepareRequest.java            |  7 +-
 .../dht/preloader/GridDhtForceKeysRequest.java  |  5 --
 .../dht/preloader/GridDhtForceKeysResponse.java |  5 --
 .../GridDhtPartitionDemandMessage.java          |  5 --
 .../GridDhtPartitionSupplyMessage.java          |  5 --
 .../GridDhtPartitionsAbstractMessage.java       |  5 --
 14 files changed, 4 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 421ec82..c81dae5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -270,62 +270,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
 
             if (cacheMsg.classError() != null)
                 processFailedMessage(nodeId, cacheMsg);
-            else {
-                if (cacheMsg.allowForStartup())
-                    processMessage(nodeId, cacheMsg, c);
-                else {
-                    IgniteInternalFuture<?> startFut = startFuture(cacheMsg);
-
-                    if (startFut.isDone())
-                        processMessage(nodeId, cacheMsg, c);
-                    else {
-                        if (log.isDebugEnabled())
-                            log.debug("Waiting for start future to complete for message [nodeId="
+ nodeId +
-                                ", locId=" + cctx.localNodeId() + ", msg=" + cacheMsg + ']');
-
-                        // Don't hold this thread waiting for preloading to complete.
-                        startFut.listen(new CI1<IgniteInternalFuture<?>>() {
-                            @Override public void apply(final IgniteInternalFuture<?>
f) {
-                                cctx.kernalContext().closure().runLocalSafe(
-                                    new GridPlainRunnable() {
-                                        @Override public void run() {
-                                            rw.readLock();
-
-                                            try {
-                                                if (stopping) {
-                                                    if (log.isDebugEnabled())
-                                                        log.debug("Received cache communication
message while stopping " +
-                                                            "(will ignore) [nodeId=" + nodeId
+ ", msg=" + cacheMsg + ']');
-
-                                                    return;
-                                                }
-
-                                                f.get();
-
-                                                if (log.isDebugEnabled())
-                                                    log.debug("Start future completed for
message [nodeId=" + nodeId +
-                                                        ", locId=" + cctx.localNodeId() +
", msg=" + cacheMsg + ']');
-
-                                                processMessage(nodeId, cacheMsg, c);
-                                            }
-                                            catch (IgniteCheckedException e) {
-                                                // Log once.
-                                                if (startErr.compareAndSet(false, true))
-                                                    U.error(log, "Failed to complete preload
start future " +
-                                                        "(will ignore message) " +
-                                                        "[fut=" + f + ", nodeId=" + nodeId
+ ", msg=" + cacheMsg + ']', e);
-                                            }
-                                            finally {
-                                                rw.readUnlock();
-                                            }
-                                        }
-                                    }
-                                );
-                            }
-                        });
-                    }
-                }
-            }
+            else
+                processMessage(nodeId, cacheMsg, c);
         }
         catch (Throwable e) {
             U.error(log, "Failed to process message [senderId=" + nodeId + ", messageType="
+ cacheMsg.getClass() + ']', e);
@@ -549,24 +495,6 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
     }
 
     /**
-     * @param cacheMsg Cache message to get start future.
-     * @return Preloader start future.
-     */
-    @SuppressWarnings("unchecked")
-    private IgniteInternalFuture<Object> startFuture(GridCacheMessage cacheMsg) {
-        int cacheId = cacheMsg.cacheId();
-
-        if (cacheId != 0)
-            return cctx.cacheContext(cacheId).preloader().startFuture();
-        else {
-            if (F.eq(cacheMsg.topologyVersion(), AffinityTopologyVersion.NONE))
-                return new GridFinishedFuture<>();
-
-            return cctx.preloadersStartFuture(cacheMsg.topologyVersion());
-        }
-    }
-
-    /**
      * @param nodeId Node ID.
      * @param msg Message.
      * @param c Closure.

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
index 55688e4..4b700e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
@@ -93,13 +93,6 @@ public abstract class GridCacheMessage implements Message {
     }
 
     /**
-     * @return {@code True} if this message is preloader message.
-     */
-    public boolean allowForStartup() {
-        return false;
-    }
-
-    /**
      * @return {@code True} if this message is partition exchange message.
      */
     public boolean partitionExchangeMessage() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index 13e390a..c5d4162 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -333,38 +333,6 @@ public class GridCacheSharedContext<K, V> {
     }
 
     /**
-     * @return Compound preloaders start future.
-     */
-    public IgniteInternalFuture<Object> preloadersStartFuture(AffinityTopologyVersion
topVer) {
-        if (preloadersStartFut == null) {
-            GridCompoundFuture<Object, Object> compound = null;
-
-            for (GridCacheContext<?, ?> cacheCtx : cacheContexts()) {
-                if (cacheCtx.startTopologyVersion() != null && cacheCtx.startTopologyVersion().compareTo(topVer)
<= 0) {
-                    IgniteInternalFuture<Object> startFut = cacheCtx.preloader().startFuture();
-
-                    if (!startFut.isDone()) {
-                        if (compound == null)
-                            compound = new GridCompoundFuture<>();
-
-                        compound.add(startFut);
-                    }
-                }
-            }
-
-            if (compound != null) {
-                compound.markInitialized();
-
-                return preloadersStartFut = compound;
-            }
-            else
-                return preloadersStartFut = new GridFinishedFuture<>();
-        }
-        else
-            return preloadersStartFut;
-    }
-
-    /**
      * @return Transactional metrics adapter.
      */
     public TransactionMetricsAdapter txMetrics() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 2d5698a..7854c93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -286,14 +286,6 @@ public class GridCacheUtils {
     }
 
     /**
-     * @param msg Message to check.
-     * @return {@code True} if preloader message.
-     */
-    public static boolean allowForStartup(Object msg) {
-        return ((GridCacheMessage)msg).allowForStartup();
-    }
-
-    /**
      * Writes {@link GridCacheVersion} to output stream. This method is meant to be used
by
      * implementations of {@link Externalizable} interface.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
index 6381073..e6a5c9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
@@ -52,11 +52,6 @@ public class GridDhtAffinityAssignmentRequest extends GridCacheMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean partitionExchangeMessage() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
index 139100f..2798d7c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
@@ -70,11 +70,6 @@ public class GridDhtAffinityAssignmentResponse extends GridCacheMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean partitionExchangeMessage() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
index cf4b581..87aa256 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -171,11 +171,6 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
         this.accessTtl = accessTtl;
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
     /**
      * @return Near node ID.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
index f859314..be59a95 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
@@ -159,11 +159,6 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest
{
         this.taskNameHash = taskNameHash;
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
     /**
      * @return Mini ID.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index 5f9443b..29d5a70 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -164,11 +164,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
{
         return nearXidVer;
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
     /**
      * @return Near node ID.
      */
@@ -215,6 +210,8 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
{
 
     /**
      * Marks last added key for preloading.
+     *
+     * @param idx Key index.
      */
     public void markKeyForPreload(int idx) {
         if (preloadKeys == null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
index 3268e26..fac8b9b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
@@ -90,11 +90,6 @@ public class GridDhtForceKeysRequest extends GridCacheMessage implements
GridCac
         // No-op.
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
     /**
      * @param keys Collection of keys.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index 93e39ce..9418887 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -103,11 +103,6 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements
GridCa
         return err;
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
     /**
      * @return Keys.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
index b588372..b211d27 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
@@ -99,11 +99,6 @@ public class GridDhtPartitionDemandMessage extends GridCacheMessage {
         // No-op.
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
     /**
      * @param p Partition.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index 3ccc5ae..67c08bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@ -96,11 +96,6 @@ public class GridDhtPartitionSupplyMessage extends GridCacheMessage implements
G
     }
 
     /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean ignoreClassErrors() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd439672/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
index cc7d439..041d5f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
@@ -56,11 +56,6 @@ abstract class GridDhtPartitionsAbstractMessage extends GridCacheMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public boolean allowForStartup() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean partitionExchangeMessage() {
         return true;
     }


Mime
View raw message