ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [3/9] ignite git commit: ignite-2333 : Padding.
Date Tue, 01 Mar 2016 09:39:08 GMT
ignite-2333 : Padding.


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

Branch: refs/heads/ignite-2333
Commit: 571579f91c3cd94fff4f67ba78dfbf0221dd127f
Parents: b96539d
Author: Ilya Lantukh <ilantukh@gridgain.com>
Authored: Mon Feb 8 16:28:05 2016 +0300
Committer: Ilya Lantukh <ilantukh@gridgain.com>
Committed: Mon Feb 8 16:28:05 2016 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtPartitionTopologyImpl.java     |  7 -------
 .../internal/util/StripedCompositeReadWriteLock.java      | 10 +++++++---
 2 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/571579f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index 2772276..73a68ba 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -1093,8 +1093,6 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
      * @return Checks if any of the local partitions need to be evicted.
      */
     private boolean checkEvictions(long updateSeq) {
-//        assert lock.isWriteLockedByCurrentThread();
-
         boolean changed = false;
 
         UUID locId = cctx.nodeId();
@@ -1169,7 +1167,6 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
      */
     @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"})
     private void updateLocal(int p, UUID nodeId, GridDhtPartitionState state, long updateSeq)
{
-//        assert lock.isWriteLockedByCurrentThread();
         assert nodeId.equals(cctx.nodeId());
 
         // In case if node joins, get topology at the time of joining node.
@@ -1223,7 +1220,6 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
      */
     private void removeNode(UUID nodeId) {
         assert nodeId != null;
-//        assert lock.writeLock().isHeldByCurrentThread();
 
         ClusterNode oldest = CU.oldestAliveCacheServerNode(cctx.shared(), topVer);
 
@@ -1288,8 +1284,6 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
     /** {@inheritDoc} */
     @Override public void onEvicted(GridDhtLocalPartition part, boolean updateSeq) {
-//        assert updateSeq || lock.isWriteLockedByCurrentThread();
-
         lock.writeLock().lock();
 
         try {
@@ -1422,7 +1416,6 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
      */
     private void consistencyCheck() {
         if (CONSISTENCY_CHECK) {
-//            assert lock.writeLock().isHeldByCurrentThread();
 
             if (node2part == null)
                 return;

http://git-wip-us.apache.org/repos/asf/ignite/blob/571579f9/modules/core/src/main/java/org/apache/ignite/internal/util/StripedCompositeReadWriteLock.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/StripedCompositeReadWriteLock.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/StripedCompositeReadWriteLock.java
index cf5e762..1880f0f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/StripedCompositeReadWriteLock.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/StripedCompositeReadWriteLock.java
@@ -13,15 +13,15 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
  */
 public class StripedCompositeReadWriteLock implements ReadWriteLock {
 
-    private final ReadWriteLock[] locks;
+    private final PaddedReentrantReadWriteLock[] locks;
 
     private final CompositeWriteLock compositeWriteLock;
 
     public StripedCompositeReadWriteLock(int concurrencyLevel) {
-        locks = new ReadWriteLock[concurrencyLevel];
+        locks = new PaddedReentrantReadWriteLock[concurrencyLevel];
 
         for (int i = 0; i < concurrencyLevel; i++)
-            locks[i] = new ReentrantReadWriteLock();
+            locks[i] = new PaddedReentrantReadWriteLock();
 
         compositeWriteLock = new CompositeWriteLock();
     }
@@ -35,6 +35,10 @@ public class StripedCompositeReadWriteLock implements ReadWriteLock {
         return compositeWriteLock;
     }
 
+    private static class PaddedReentrantReadWriteLock extends ReentrantReadWriteLock {
+        long p0, p1, p2, p3, p4, p5, p6, p7;
+    }
+
     private class CompositeWriteLock implements Lock {
 
         @Override public void lock() {


Mime
View raw message