ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [09/50] [abbrv] ignite git commit: IGNITE-2513: ThreadLocal.remove() is replaced with ThreadLocal.set(null) where possible to minimize amount of generated garbage.
Date Thu, 04 Feb 2016 10:09:12 GMT
IGNITE-2513: ThreadLocal.remove() is replaced with ThreadLocal.set(null) where possible to
minimize amount of generated garbage.


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

Branch: refs/heads/sql-store
Commit: c3b83fe20275818b3bc57676c53e32be2eed9463
Parents: 8eab487
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Feb 1 16:13:29 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Feb 1 16:13:29 2016 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/binary/GridBinaryMarshaller.java | 5 +----
 .../internal/processors/cache/transactions/IgniteTxManager.java | 2 +-
 .../ignite/internal/processors/task/GridTaskProcessor.java      | 2 +-
 .../marshaller/optimized/OptimizedObjectStreamRegistry.java     | 4 ++--
 .../internal/processors/query/h2/opt/GridH2IndexBase.java       | 5 +----
 .../internal/processors/query/h2/opt/GridH2TreeIndex.java       | 2 +-
 6 files changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c3b83fe2/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
index b4f4291..da43558 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
@@ -316,10 +316,7 @@ public class GridBinaryMarshaller {
      * @param oldCtx Old binary context.
      */
     private static void popContext(@Nullable BinaryContext oldCtx) {
-        if (oldCtx == null)
-            BINARY_CTX.remove();
-        else
-            BINARY_CTX.set(oldCtx);
+        BINARY_CTX.set(oldCtx);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/c3b83fe2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 7a3b8ff..3e43726 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -644,7 +644,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
      */
     public boolean setTxTopologyHint(@Nullable AffinityTopologyVersion topVer) {
         if (topVer == null)
-            txTop.remove();
+            txTop.set(null);
         else {
             if (txTop.get() == null) {
                 txTop.set(topVer);

http://git-wip-us.apache.org/repos/asf/ignite/blob/c3b83fe2/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index b8d1d78..2a2e3fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -486,7 +486,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
             map = EMPTY_ENUM_MAP;
         else
             // Reset thread-local context.
-            thCtx.remove();
+            thCtx.set(null);
 
         Long timeout = (Long)map.get(TC_TIMEOUT);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c3b83fe2/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
index e0e4872..d7d0209 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
@@ -95,7 +95,7 @@ class OptimizedObjectStreamRegistry {
         holder.releaseOut();
 
         if (pool != null) {
-            holders.remove();
+            holders.set(null);
 
             boolean b = pool.offer(holder);
 
@@ -117,7 +117,7 @@ class OptimizedObjectStreamRegistry {
         holder.releaseIn();
 
         if (pool != null) {
-            holders.remove();
+            holders.set(null);
 
             boolean b = pool.offer(holder);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c3b83fe2/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
index 39664ff..fe90dec 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
@@ -59,10 +59,7 @@ public abstract class GridH2IndexBase extends BaseIndex {
      * @param fs Filters.
      */
     public static void setFiltersForThread(IndexingQueryFilter fs) {
-        if (fs == null)
-            filters.remove();
-        else
-            filters.set(fs);
+        filters.set(fs);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/c3b83fe2/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index 28adeee..2c95b66 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -187,7 +187,7 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
 
         ConcurrentNavigableMap<GridSearchRowPointer, GridH2Row> s = snapshot.get();
 
-        snapshot.remove();
+        snapshot.set(null);
 
         if (s instanceof Closeable)
             U.closeQuiet((Closeable)s);


Mime
View raw message