ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [01/33] incubator-ignite git commit: # ignite-409: logger in GridWorker non-static now
Date Fri, 20 Mar 2015 20:12:28 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-gg-9933 f16eadee1 -> eb335a9d8


# ignite-409: logger in GridWorker non-static now


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

Branch: refs/heads/ignite-gg-9933
Commit: ac3987b78ddc016fb54015c5989be9f581895d8e
Parents: 4b234cf
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Tue Mar 10 15:27:56 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Tue Mar 10 15:27:56 2015 +0300

----------------------------------------------------------------------
 .../managers/discovery/GridDiscoveryManager.java      |  6 +++---
 .../processors/cache/GridCacheEvictionManager.java    |  2 +-
 .../cache/GridCachePartitionExchangeManager.java      |  2 +-
 .../internal/processors/clock/GridClockServer.java    |  2 +-
 .../processors/clock/GridClockSyncProcessor.java      |  4 ++--
 .../ignite/internal/processors/igfs/IgfsServer.java   |  5 ++---
 .../internal/processors/igfs/IgfsServerManager.java   |  4 ++--
 .../processors/streamer/IgniteStreamerImpl.java       |  2 +-
 .../processors/timeout/GridTimeoutProcessor.java      |  2 +-
 .../ignite/internal/util/worker/GridWorker.java       | 14 +++-----------
 .../spi/communication/tcp/TcpCommunicationSpi.java    |  4 ++--
 .../communication/HadoopExternalCommunication.java    |  4 ++--
 12 files changed, 21 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 775de77..31c1632 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -1206,7 +1206,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
          *
          */
         private SegmentCheckWorker() {
-            super(ctx.gridName(), "disco-net-seg-chk-worker", log);
+            super(ctx.gridName(), "disco-net-seg-chk-worker", GridDiscoveryManager.this.log);
 
             assert hasRslvrs;
             assert segChkFreq > 0;
@@ -1283,7 +1283,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
          *
          */
         private DiscoveryWorker() {
-            super(ctx.gridName(), "disco-event-worker", log);
+            super(ctx.gridName(), "disco-event-worker", GridDiscoveryManager.this.log);
         }
 
         /**
@@ -1570,7 +1570,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
          *
          */
         private MetricsUpdater() {
-            super(ctx.gridName(), "metrics-updater", log);
+            super(ctx.gridName(), "metrics-updater", GridDiscoveryManager.this.log);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 382eb61..50dc2a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -1386,7 +1386,7 @@ public class GridCacheEvictionManager<K, V> extends GridCacheManagerAdapter<K,
V
          *
          */
         private BackupWorker() {
-            super(cctx.gridName(), "cache-eviction-backup-worker", log);
+            super(cctx.gridName(), "cache-eviction-backup-worker", GridCacheEvictionManager.this.log);
 
             assert plcEnabled;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index d7b1914..5e863c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -733,7 +733,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
          *
          */
         private ExchangeWorker() {
-            super(cctx.gridName(), "partition-exchanger", log);
+            super(cctx.gridName(), "partition-exchanger", GridCachePartitionExchangeManager.this.log);
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
index 3208375..e47d1fa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
@@ -170,7 +170,7 @@ public class GridClockServer {
          * Creates read worker.
          */
         protected ReadWorker() {
-            super(ctx.gridName(), "grid-time-server-reader", log);
+            super(ctx.gridName(), "grid-time-server-reader", GridClockServer.this.log);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
index 19b4f5f..2920176 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
@@ -34,8 +34,8 @@ import java.net.*;
 import java.util.*;
 
 import static org.apache.ignite.events.EventType.*;
-import static org.apache.ignite.internal.IgniteNodeAttributes.*;
 import static org.apache.ignite.internal.GridTopic.*;
+import static org.apache.ignite.internal.IgniteNodeAttributes.*;
 import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
 
 /**
@@ -328,7 +328,7 @@ public class GridClockSyncProcessor extends GridProcessorAdapter {
          * @param evt Discovery event on which this node became a coordinator.
          */
         protected TimeCoordinator(DiscoveryEvent evt) {
-            super(ctx.gridName(), "grid-time-coordinator", log);
+            super(ctx.gridName(), "grid-time-coordinator", GridClockSyncProcessor.this.log);
 
             lastSnapshot = new GridDiscoveryTopologySnapshot(evt.topologyVersion(), evt.topologyNodes());
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServer.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServer.java
index 870ced0..0006e5a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServer.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.igfs;
 import org.apache.ignite.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.igfs.common.*;
-import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.ipc.*;
 import org.apache.ignite.internal.util.ipc.loopback.*;
 import org.apache.ignite.internal.util.ipc.shmem.*;
@@ -218,7 +217,7 @@ public class IgfsServer {
          * @throws IgniteCheckedException If endpoint output stream cannot be obtained.
          */
         protected ClientWorker(IpcEndpoint endpoint, int idx) throws IgniteCheckedException
{
-            super(igfsCtx.kernalContext().gridName(), "igfs-client-worker-" + idx, log);
+            super(igfsCtx.kernalContext().gridName(), "igfs-client-worker-" + idx, IgfsServer.this.log);
 
             this.endpoint = endpoint;
 
@@ -385,7 +384,7 @@ public class IgfsServer {
          * Creates accept worker.
          */
         protected AcceptWorker() {
-            super(igfsCtx.kernalContext().gridName(), "igfs-accept-worker", log);
+            super(igfsCtx.kernalContext().gridName(), "igfs-accept-worker", IgfsServer.this.log);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServerManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServerManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServerManager.java
index 643eeff..3c8c75e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServerManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsServerManager.java
@@ -198,8 +198,8 @@ public class IgfsServerManager extends IgfsManager {
                         it.remove();
                     }
                     catch (IgniteCheckedException e) {
-                        if (GridWorker.log.isDebugEnabled())
-                            GridWorker.log.debug("Failed to bind IGFS endpoint [cfg=" + cfg
+ ", err=" + e.getMessage() + ']');
+                        if (log.isDebugEnabled())
+                            log.debug("Failed to bind IGFS endpoint [cfg=" + cfg + ", err="
+ e.getMessage() + ']');
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/IgniteStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/IgniteStreamerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/IgniteStreamerImpl.java
index 10fd3d8..4ce3cc7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/IgniteStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/IgniteStreamerImpl.java
@@ -1235,7 +1235,7 @@ public class IgniteStreamerImpl implements IgniteStreamerEx, Externalizable
{
             StreamerStageWrapper stageWrapper,
             StreamerMetricsHolder streamerHolder
         ) {
-            super(ctx.gridName(), "streamer-batch-worker-" + batch.stageName(), log);
+            super(ctx.gridName(), "streamer-batch-worker-" + batch.stageName(), IgniteStreamerImpl.this.log);
 
             assert stageWrapper != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
index 5fe8e63..c72a895 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
@@ -112,7 +112,7 @@ public class GridTimeoutProcessor extends GridProcessorAdapter {
          *
          */
         TimeoutWorker() {
-            super(ctx.config().getGridName(), "grid-timeout-worker", log);
+            super(ctx.config().getGridName(), "grid-timeout-worker", GridTimeoutProcessor.this.log);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
index 12c5234..47b902d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
@@ -31,8 +31,8 @@ import java.util.concurrent.*;
  * with {@link Executor} implementations. Only for internal use.
  */
 public abstract class GridWorker implements Runnable {
-    /** Grid logger. */
-    protected static volatile IgniteLogger log;
+    /** Ignite logger. */
+    protected final IgniteLogger log;
 
     /** Thread name. */
     private final String name;
@@ -80,13 +80,7 @@ public abstract class GridWorker implements Runnable {
         this.gridName = gridName;
         this.name = name;
         this.lsnr = lsnr;
-
-        if (GridWorker.log == null) {
-            synchronized (GridWorker.class) {
-                if (GridWorker.log == null)
-                    GridWorker.log = log.getLogger(GridWorker.class);
-            }
-        }
+        this.log = log.getLogger(GridWorker.class);
 
         inherited = GridThreadLocalEx.inherit();
     }
@@ -128,8 +122,6 @@ public abstract class GridWorker implements Runnable {
 
         enterThreadLocals();
 
-        IgniteLogger log = GridWorker.log;
-
         if (log.isDebugEnabled())
             log.debug("Grid runnable started: " + name);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index cadd75c..4a279d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -2434,7 +2434,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
          * @param srv Server.
          */
         ShmemAcceptWorker(IpcSharedMemoryServerEndpoint srv) {
-            super(gridName, "shmem-communication-acceptor", log);
+            super(gridName, "shmem-communication-acceptor", TcpCommunicationSpi.this.log);
 
             this.srv = srv;
         }
@@ -2478,7 +2478,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
          * @param endpoint Endpoint.
          */
         private ShmemWorker(IpcEndpoint endpoint) {
-            super(gridName, "shmem-worker", log);
+            super(gridName, "shmem-worker", TcpCommunicationSpi.this.log);
 
             this.endpoint = endpoint;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac3987b7/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunication.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunication.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunication.java
index 499f2fa..f800105 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunication.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunication.java
@@ -1094,7 +1094,7 @@ public class HadoopExternalCommunication {
          * @param srv Server.
          */
         ShmemAcceptWorker(IpcSharedMemoryServerEndpoint srv) {
-            super(gridName, "shmem-communication-acceptor", log);
+            super(gridName, "shmem-communication-acceptor", HadoopExternalCommunication.this.log);
 
             this.srv = srv;
         }
@@ -1141,7 +1141,7 @@ public class HadoopExternalCommunication {
          * @param endpoint Endpoint.
          */
         private ShmemWorker(IpcEndpoint endpoint, boolean accepted) {
-            super(gridName, "shmem-worker", log);
+            super(gridName, "shmem-worker", HadoopExternalCommunication.this.log);
 
             this.endpoint = endpoint;
 


Mime
View raw message