ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: Fixes.
Date Mon, 21 Mar 2016 11:28:38 GMT
Repository: ignite
Updated Branches:
  refs/heads/vozerov-perf-experimental e8045382e -> 207a4c917


Fixes.


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

Branch: refs/heads/vozerov-perf-experimental
Commit: 207a4c917c298ca6660ba2400348e59163d8f6d5
Parents: e804538
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Mar 21 14:28:33 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Mar 21 14:28:33 2016 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   |  2 +-
 .../deployment/GridDeploymentLocalStore.java    | 41 ++++++++++----------
 .../ignite/internal/util/lang/GridFunc.java     | 26 ++++++++++++-
 3 files changed, 46 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/207a4c91/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index c4ca984..5b7ecb0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -2238,7 +2238,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
 
         /** */
         @GridToStringInclude
-        private final Queue<GridTuple3<GridIoMessage, Long, IgniteRunnable>>
msgs = new ConcurrentLinkedDeque<>();
+        private final Queue<GridTuple3<GridIoMessage, Long, IgniteRunnable>>
msgs = new LinkedBlockingDeque<>();
 
         /** */
         private final AtomicBoolean reserved = new AtomicBoolean();

http://git-wip-us.apache.org/repos/asf/ignite/blob/207a4c91/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
index 024ba00..efe8173 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
@@ -17,6 +17,15 @@
 
 package org.apache.ignite.internal.managers.deployment;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentMap;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.compute.ComputeTask;
 import org.apache.ignite.compute.ComputeTaskName;
@@ -37,17 +46,7 @@ import org.apache.ignite.spi.deployment.DeploymentResource;
 import org.apache.ignite.spi.deployment.DeploymentSpi;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.LinkedBlockingDeque;
+import org.jsr166.ConcurrentLinkedDeque8;
 
 import static org.apache.ignite.events.EventType.EVT_CLASS_DEPLOYED;
 import static org.apache.ignite.events.EventType.EVT_CLASS_DEPLOY_FAILED;
@@ -61,7 +60,7 @@ import static org.apache.ignite.events.EventType.EVT_TASK_UNDEPLOYED;
  */
 class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
     /** Deployment cache by class name. */
-    private final ConcurrentMap<String, LinkedBlockingDeque<GridDeployment>>
cache =
+    private final ConcurrentMap<String, ConcurrentLinkedDeque8<GridDeployment>>
cache =
         new ConcurrentHashMap8<>();
 
     /** Mutex. */
@@ -111,7 +110,7 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
         Collection<GridDeployment> deps = new ArrayList<>();
 
         synchronized (mux) {
-            for (LinkedBlockingDeque<GridDeployment> depList : cache.values())
+            for (ConcurrentLinkedDeque8<GridDeployment> depList : cache.values())
                 for (GridDeployment d : depList)
                     if (!deps.contains(d))
                         deps.add(d);
@@ -123,7 +122,7 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
     /** {@inheritDoc} */
     @Nullable @Override public GridDeployment getDeployment(IgniteUuid ldrId) {
         synchronized (mux) {
-            for (LinkedBlockingDeque<GridDeployment> deps : cache.values())
+            for (ConcurrentLinkedDeque8<GridDeployment> deps : cache.values())
                 for (GridDeployment dep : deps)
                     if (dep.classLoaderId().equals(ldrId))
                         return dep;
@@ -233,7 +232,7 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
      * @return Deployment.
      */
     @Nullable private GridDeployment deployment(String alias) {
-        LinkedBlockingDeque<GridDeployment> deps = cache.get(alias);
+        ConcurrentLinkedDeque8<GridDeployment> deps = cache.get(alias);
 
         if (deps != null) {
             GridDeployment dep = deps.peekFirst();
@@ -261,10 +260,10 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
             boolean fireEvt = false;
 
             try {
-                LinkedBlockingDeque<GridDeployment> cachedDeps = null;
+                ConcurrentLinkedDeque8<GridDeployment> cachedDeps = null;
 
                 // Find existing class loader info.
-                for (LinkedBlockingDeque<GridDeployment> deps : cache.values()) {
+                for (ConcurrentLinkedDeque8<GridDeployment> deps : cache.values())
{
                     for (GridDeployment d : deps) {
                         if (d.classLoader() == ldr) {
                             // Cache class and alias.
@@ -305,8 +304,8 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
                 assert fireEvt : "Class was not added to newly created deployment [cls="
+ cls +
                     ", depMode=" + depMode + ", dep=" + dep + ']';
 
-                LinkedBlockingDeque<GridDeployment> deps =
-                    F.addIfAbsent(cache, alias, F.<GridDeployment>newDeque());
+                ConcurrentLinkedDeque8<GridDeployment> deps =
+                    F.addIfAbsent(cache, alias, F.<GridDeployment>newDeque2());
 
                 if (!deps.isEmpty()) {
                     for (GridDeployment d : deps) {
@@ -513,8 +512,8 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
         Collection<GridDeployment> doomed = new HashSet<>();
 
         synchronized (mux) {
-            for (Iterator<LinkedBlockingDeque<GridDeployment>> i1 = cache.values().iterator();
i1.hasNext();) {
-                LinkedBlockingDeque<GridDeployment> deps = i1.next();
+            for (Iterator<ConcurrentLinkedDeque8<GridDeployment>> i1 = cache.values().iterator();
i1.hasNext();) {
+                ConcurrentLinkedDeque8<GridDeployment> deps = i1.next();
 
                 for (Iterator<GridDeployment> i2 = deps.iterator(); i2.hasNext();)
{
                     GridDeployment dep = i2.next();

http://git-wip-us.apache.org/repos/asf/ignite/blob/207a4c91/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index e10b4ed..2c02dc1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -143,7 +143,18 @@ public class GridFunc {
     };
 
     /** */
-    private static final IgniteCallable<?> DEQUE_FACTORY = new IgniteCallable<ConcurrentLinkedDeque8>()
{
+    private static final IgniteCallable<?> DEQUE_FACTORY = new IgniteCallable<LinkedBlockingDeque>()
{
+        @Override public LinkedBlockingDeque call() {
+            return new LinkedBlockingDeque<>();
+        }
+
+        @Override public String toString() {
+            return "Deque factory.";
+        }
+    };
+
+    /** */
+    private static final IgniteCallable<?> DEQUE_FACTORY2 = new IgniteCallable<ConcurrentLinkedDeque8>()
{
         @Override public ConcurrentLinkedDeque8 call() {
             return new ConcurrentLinkedDeque8();
         }
@@ -2339,6 +2350,19 @@ public class GridFunc {
     }
 
     /**
+     * Returns a factory closure that creates new {@link ConcurrentLinkedDeque8} instance.
+     * Note that this method does not create a new closure but returns a static one.
+     *
+     * @param <T> Type parameters for the created {@link List}.
+     * @return Factory closure that creates new {@link List} instance every
+     *      time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> IgniteCallable<ConcurrentLinkedDeque8<T>> newDeque2()
{
+        return (IgniteCallable<ConcurrentLinkedDeque8<T>>)DEQUE_FACTORY2;
+    }
+
+    /**
      * Returns a factory closure that creates new {@link List} instance. Note that this
      * method does not create a new closure but returns a static one.
      *


Mime
View raw message