ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #gg-410: remove GridNioBackPressureControl
Date Wed, 11 Mar 2015 09:03:03 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-410 baaff270c -> ba7253cba


#gg-410: remove GridNioBackPressureControl


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

Branch: refs/heads/ignite-410
Commit: ba7253cbac3d9e76d0fb7031c02144d4dfa4a32b
Parents: baaff27
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Mar 11 12:02:54 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Mar 11 12:02:54 2015 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 13 -----
 .../util/nio/GridNioBackPressureControl.java    | 56 --------------------
 .../util/nio/GridSelectorNioSessionImpl.java    |  2 +-
 3 files changed, 1 insertion(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba7253cb/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 2289c20..fede656 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
@@ -48,7 +48,6 @@ import java.util.concurrent.locks.*;
 import static org.apache.ignite.events.EventType.*;
 import static org.apache.ignite.internal.GridTopic.*;
 import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
-import static org.apache.ignite.internal.util.nio.GridNioBackPressureControl.*;
 import static org.jdk8.backport.ConcurrentLinkedHashMap.QueuePolicy.*;
 
 /**
@@ -551,8 +550,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         Runnable c = new Runnable() {
             @Override public void run() {
                 try {
-                    threadProcessingMessage(true);
-
                     GridMessageListener lsnr = lsnrMap.get(msg.topic());
 
                     if (lsnr == null)
@@ -565,8 +562,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                     lsnr.onMessage(nodeId, obj);
                 }
                 finally {
-                    threadProcessingMessage(false);
-
                     workersCnt.decrement();
 
                     msgC.run();
@@ -603,13 +598,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         Runnable c = new Runnable() {
             @Override public void run() {
                 try {
-                    threadProcessingMessage(true);
-
                     processRegularMessage0(msg, nodeId);
                 }
                 finally {
-                    threadProcessingMessage(false);
-
                     workersCnt.decrement();
 
                     msgC.run();
@@ -802,13 +793,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         Runnable c = new Runnable() {
             @Override public void run() {
                 try {
-                    threadProcessingMessage(true);
-
                     unwindMessageSet(msgSet0, lsnr);
                 }
                 finally {
-                    threadProcessingMessage(false);
-
                     workersCnt.decrement();
 
                     msgC.run();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba7253cb/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java
deleted file mode 100644
index 7f9f9c3..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java
+++ /dev/null
@@ -1,56 +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.util.nio;
-
-import org.apache.ignite.thread.*;
-
-/**
- * Utility class that allows to ignore back-pressure control for threads that are processing
messages.
- */
-public class GridNioBackPressureControl {
-    /** Thread local flag indicating that thread is processing message. */
-    private static ThreadLocal<Boolean> threadProcMsg = new ThreadLocal<Boolean>()
{
-        @Override protected Boolean initialValue() {
-            return Boolean.FALSE;
-        }
-    };
-
-    /**
-     * @return Flag indicating whether current thread is processing message.
-     */
-    public static boolean threadProcessingMessage() {
-        Thread th = Thread.currentThread();
-
-        if (th instanceof IgniteThread)
-            return ((IgniteThread)th).processingMessage();
-
-        return threadProcMsg.get();
-    }
-
-    /**
-     * @param processing Flag indicating whether current thread is processing message.
-     */
-    public static void threadProcessingMessage(boolean processing) {
-        Thread th = Thread.currentThread();
-
-        if (th instanceof IgniteThread)
-            ((IgniteThread)th).processingMessage(processing);
-        else
-            threadProcMsg.set(processing);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba7253cb/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
index 67e453c..14abf4e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
@@ -184,7 +184,7 @@ class GridSelectorNioSessionImpl extends GridNioSessionImpl {
      * @return Updated size of the queue.
      */
     int offerFuture(GridNioFuture<?> writeFut) {
-        boolean msgThread = false;//GridNioBackPressureControl.threadProcessingMessage();
+        boolean msgThread = false;
 
         if (sem != null && !msgThread)
             sem.acquireUninterruptibly();


Mime
View raw message