ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [1/5] incubator-ignite git commit: Ignite - Fixes for invalidate flag.
Date Tue, 09 Dec 2014 06:33:04 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/master 984373dc3 -> e2c4d2658


Ignite - Fixes for invalidate flag.


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

Branch: refs/heads/master
Commit: 9f90d7d6250cbaa83d0c8c09f0b44fde01eddb09
Parents: 984373d
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Mon Dec 8 14:50:19 2014 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Mon Dec 8 14:50:19 2014 -0800

----------------------------------------------------------------------
 .../kernal/processors/cache/GridCacheAdapter.java     |  7 +++++--
 .../kernal/processors/cache/GridCacheTxAdapter.java   | 14 ++------------
 .../kernal/processors/cache/GridCacheTxHandler.java   |  2 ++
 .../processors/cache/GridCacheTxLocalAdapter.java     |  5 +++--
 .../kernal/processors/cache/GridCacheTxManager.java   |  2 ++
 .../dht/GridDhtTransactionalCacheAdapter.java         |  1 +
 .../cache/distributed/dht/GridDhtTxLocal.java         |  2 ++
 .../cache/distributed/dht/GridDhtTxLocalAdapter.java  |  5 +++--
 .../cache/distributed/near/GridNearTxLocal.java       |  4 ++--
 .../kernal/processors/cache/local/GridLocalTx.java    |  4 ++--
 .../cache/transactions/IgniteTransactionsImpl.java    |  8 ++++++++
 .../testsuites/bamboo/GridDataGridTestSuite.java      |  4 ++--
 .../processors/cache/jta/GridCacheJtaManager.java     |  1 +
 13 files changed, 35 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
index 31cd964..f6207be 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
@@ -25,7 +25,6 @@ import org.gridgain.grid.cache.query.*;
 import org.gridgain.grid.kernal.*;
 import org.gridgain.grid.kernal.processors.cache.affinity.*;
 import org.gridgain.grid.kernal.processors.cache.datastructures.*;
-import org.gridgain.grid.kernal.processors.cache.distributed.*;
 import org.gridgain.grid.kernal.processors.cache.distributed.dht.*;
 import org.gridgain.grid.kernal.processors.cache.dr.*;
 import org.gridgain.grid.kernal.processors.cache.query.*;
@@ -52,7 +51,6 @@ import static org.gridgain.grid.cache.GridCacheFlag.*;
 import static org.gridgain.grid.cache.GridCachePeekMode.*;
 import static org.gridgain.grid.cache.GridCacheTxConcurrency.*;
 import static org.gridgain.grid.cache.GridCacheTxIsolation.*;
-import static org.gridgain.grid.cache.GridCacheTxState.*;
 import static org.apache.ignite.events.IgniteEventType.*;
 import static org.gridgain.grid.kernal.GridClosureCallMode.*;
 import static org.gridgain.grid.kernal.processors.dr.GridDrType.*;
@@ -61,6 +59,7 @@ import static org.gridgain.grid.kernal.processors.task.GridTaskThreadContextKey.
 /**
  * Adapter for different cache implementations.
  */
+@SuppressWarnings("unchecked")
 public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter implements
GridCache<K, V>,
     GridCacheProjectionEx<K, V>, Externalizable {
     /** */
@@ -3166,6 +3165,7 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
             concurrency,
             isolation,
             timeout,
+            false,
             txSize,
             /** group lock keys */null,
             /** partition lock */false
@@ -3221,6 +3221,7 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
             concurrency,
             isolation,
             timeout,
+            ctx.hasFlag(INVALIDATE),
             txSize,
             grpLockKey,
             partLock
@@ -3696,6 +3697,7 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
                 PESSIMISTIC,
                 READ_COMMITTED,
                 tCfg.getDefaultTxTimeout(),
+                ctx.hasFlag(INVALIDATE),
                 0,
                 /** group lock keys */null,
                 /** partition lock */false
@@ -3765,6 +3767,7 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
                 PESSIMISTIC,
                 READ_COMMITTED,
                 ctx.kernalContext().config().getTransactionsConfiguration().getDefaultTxTimeout(),
+                ctx.hasFlag(INVALIDATE),
                 0,
                 null,
                 false);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
index 2e67628..6ed4c5a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
@@ -25,7 +25,6 @@ import org.jetbrains.annotations.*;
 
 import java.io.*;
 import java.util.*;
-import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 import java.util.concurrent.locks.*;
 
@@ -219,6 +218,7 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter
         GridCacheTxConcurrency concurrency,
         GridCacheTxIsolation isolation,
         long timeout,
+        boolean invalidate,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         @Nullable UUID subjId,
@@ -235,6 +235,7 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter
         this.concurrency = concurrency;
         this.isolation = isolation;
         this.timeout = timeout;
+        this.invalidate = invalidate;
         this.txSize = txSize;
         this.grpLockKey = grpLockKey;
         this.subjId = subjId;
@@ -327,17 +328,6 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter
     }
 
     /**
-     * Waits for signal.
-     *
-     * @param ms Time to wait.
-     * @return {@code True} if signal occurred.
-     * @throws InterruptedException If interrupted.
-     */
-    protected final boolean awaitSignal(long ms) throws InterruptedException {
-        return cond.await(ms, TimeUnit.MILLISECONDS);
-    }
-
-    /**
      * Checks whether near cache should be updated.
      *
      * @return Flag indicating whether near cache should be updated.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
index 1c39ddd..e01f5aa 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
@@ -252,6 +252,7 @@ public class GridCacheTxHandler<K, V> {
                 req.concurrency(),
                 req.isolation(),
                 req.timeout(),
+                req.isInvalidate(),
                 false,
                 req.txSize(),
                 req.groupLockKey(),
@@ -502,6 +503,7 @@ public class GridCacheTxHandler<K, V> {
                             PESSIMISTIC,
                             READ_COMMITTED,
                             /*timeout */0,
+                            req.isInvalidate(),
                             req.explicitLock(),
                             req.txSize(),
                             req.groupLockKey(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
index 93ed43f..eead11f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
@@ -109,14 +109,15 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
         GridCacheTxConcurrency concurrency,
         GridCacheTxIsolation isolation,
         long timeout,
+        boolean invalidate,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock,
         @Nullable UUID subjId,
         int taskNameHash
     ) {
-        super(cctx, xidVer, implicit, implicitSingle, /*local*/true, concurrency, isolation,
timeout, txSize,
-            grpLockKey, subjId, taskNameHash);
+        super(cctx, xidVer, implicit, implicitSingle, /*local*/true, concurrency, isolation,
timeout, invalidate,
+            txSize, grpLockKey, subjId, taskNameHash);
 
         assert !partLock || grpLockKey != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
index 2bc9a48..da0deed 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
@@ -364,6 +364,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V
         GridCacheTxConcurrency concurrency,
         GridCacheTxIsolation isolation,
         long timeout,
+        boolean invalidate,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock) {
@@ -378,6 +379,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V
             concurrency,
             isolation,
             timeout,
+            invalidate,
             txSize,
             grpLockKey,
             partLock,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 6b05200..7c76203 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -757,6 +757,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends
GridDhtCach
                                     PESSIMISTIC,
                                     req.isolation(),
                                     req.timeout(),
+                                    req.isInvalidate(),
                                     false,
                                     req.txSize(),
                                     req.groupLockKey(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocal.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocal.java
index e6e206f..f0ad4da 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocal.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocal.java
@@ -98,6 +98,7 @@ public class GridDhtTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> implements
         GridCacheTxConcurrency concurrency,
         GridCacheTxIsolation isolation,
         long timeout,
+        boolean invalidate,
         boolean explicitLock,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
@@ -114,6 +115,7 @@ public class GridDhtTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> implements
             concurrency,
             isolation,
             timeout,
+            invalidate,
             explicitLock,
             txSize,
             grpLockKey,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 7f7e6a9..6966644 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -88,6 +88,7 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends GridCacheTxLocalAdapte
         GridCacheTxConcurrency concurrency,
         GridCacheTxIsolation isolation,
         long timeout,
+        boolean invalidate,
         boolean explicitLock,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
@@ -95,8 +96,8 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends GridCacheTxLocalAdapte
         @Nullable UUID subjId,
         int taskNameHash
     ) {
-        super(cctx, xidVer, implicit, implicitSingle, concurrency, isolation, timeout, txSize,
grpLockKey, partLock,
-            subjId, taskNameHash);
+        super(cctx, xidVer, implicit, implicitSingle, concurrency, isolation, timeout, invalidate,
txSize, grpLockKey,
+            partLock, subjId, taskNameHash);
 
         assert cctx != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
index eb006fa..dc12420 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -95,6 +95,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> {
         GridCacheTxConcurrency concurrency,
         GridCacheTxIsolation isolation,
         long timeout,
+        boolean invalidate,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock,
@@ -109,14 +110,13 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> {
             concurrency,
             isolation,
             timeout,
+            invalidate,
             /*TODO explicit lock???*/false,
             txSize,
             grpLockKey,
             partLock,
             subjId,
             taskNameHash);
-
-        assert ctx != null;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
index 24cd2ba..caee6e7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
@@ -60,8 +60,8 @@ class GridLocalTx<K, V> extends GridCacheTxLocalAdapter<K, V>
{
         @Nullable UUID subjId,
         int taskNameHash
     ) {
-        super(ctx, ctx.versions().next(), implicit, implicitSingle, concurrency, isolation,
timeout, txSize, null,
-            false, subjId, taskNameHash);
+        super(ctx, ctx.versions().next(), implicit, implicitSingle, concurrency, isolation,
timeout, false, txSize,
+            null, false, subjId, taskNameHash);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
index 2a82631..621bc50 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
@@ -74,6 +74,13 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactions
{
         );
     }
 
+    /**
+     * @param concurrency Transaction concurrency.
+     * @param isolation Transaction isolation.
+     * @param timeout Transaction timeout.
+     * @param txSize Expected transaction size.
+     * @return Transaction.
+     */
     private GridCacheTx txStart0(GridCacheTxConcurrency concurrency, GridCacheTxIsolation
isolation,
         long timeout, int txSize) {
         GridTransactionsConfiguration cfg = cctx.gridConfig().getTransactionsConfiguration();
@@ -94,6 +101,7 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactions
{
             concurrency,
             isolation,
             timeout,
+            false,
             txSize,
             /** group lock keys */null,
             /** partition lock */false

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
b/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
index a2e9576..841f116 100644
--- a/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
+++ b/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
@@ -119,8 +119,8 @@ public class GridDataGridTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCachePartitionedBasicApiTest.class));
         suite.addTest(new TestSuite(GridCacheNearMultiGetSelfTest.class));
 //        suite.addTest(new TestSuite(GridCacheNearJobExecutionSelfTest.class));
-//        suite.addTest(new TestSuite(GridCachePartitionedProjectionSelfTest.class));
-//        suite.addTest(new TestSuite(GridCachePartitionedOnlyProjectionSelfTest.class));
+        suite.addTest(new TestSuite(GridCachePartitionedProjectionSelfTest.class));
+        suite.addTest(new TestSuite(GridCachePartitionedOnlyProjectionSelfTest.class));
         suite.addTest(new TestSuite(GridCacheNearOneNodeSelfTest.class));
         suite.addTest(new TestSuite(GridCacheNearMultiNodeSelfTest.class));
         suite.addTest(new TestSuite(GridCacheAtomicNearMultiNodeSelfTest.class));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9f90d7d6/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
b/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
index 536ae09..6d921bc 100644
--- a/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
+++ b/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
@@ -69,6 +69,7 @@ public class GridCacheJtaManager<K, V> extends GridCacheJtaManagerAdapter<K,
V>
                                 tCfg.getDefaultTxConcurrency(),
                                 tCfg.getDefaultTxIsolation(),
                                 tCfg.getDefaultTxTimeout(),
+                                false,
                                 0,
                                 /** group lock keys */null,
                                 /** partition lock */false


Mime
View raw message