ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [11/50] [abbrv] incubator-ignite git commit: # sprint-2 added store session initialization for write behind store
Date Tue, 17 Mar 2015 12:40:48 GMT
# sprint-2 added store session initialization for write behind store


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

Branch: refs/heads/ignite-432
Commit: 4bb2b3f21b16e6f27b291b5eddfe0b453bc7fae9
Parents: f3c866f
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Mar 16 11:53:13 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Mar 16 11:53:13 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheStoreManager.java |  30 ++-
 .../cache/GridCacheWriteBehindStore.java        |  69 +++--
 .../continuous/CacheContinuousQueryManager.java |   5 +-
 ...idCacheWriteBehindStoreAbstractSelfTest.java |   2 +-
 ...eCacheAtomicStoreSessionWriteBehindTest.java |  38 +++
 ...acheStoreSessionWriteBehindAbstractTest.java | 269 +++++++++++++++++++
 ...gniteCacheTxStoreSessionWriteBehindTest.java |  32 +++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +
 8 files changed, 414 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
index ddc909e..c926d32 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
@@ -152,7 +152,8 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
         if (cfgStore == null || !cfg.isWriteBehindEnabled())
             return cfgStore;
 
-        GridCacheWriteBehindStore store = new GridCacheWriteBehindStore(ctx.gridName(),
+        GridCacheWriteBehindStore store = new GridCacheWriteBehindStore(this,
+            ctx.gridName(),
             cfg.getName(),
             ctx.log(GridCacheWriteBehindStore.class),
             cfgStore);
@@ -286,7 +287,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
             }
             finally {
                 if (ses)
-                    sesHolder.set(null);
+                    endSession();
             }
 
             if (log.isDebugEnabled())
@@ -462,7 +463,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
             }
             finally {
                 if (ses)
-                    sesHolder.set(null);
+                    endSession();
             }
 
             if (log.isDebugEnabled())
@@ -516,7 +517,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
             }
             finally {
                 if (ses)
-                    sesHolder.set(null);
+                    endSession();
             }
 
             if (log.isDebugEnabled())
@@ -573,7 +574,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
             }
             finally {
                 if (ses)
-                    sesHolder.set(null);
+                    endSession();
             }
 
             if (log.isDebugEnabled())
@@ -637,7 +638,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
                 }
                 finally {
                     if (ses)
-                        sesHolder.set(null);
+                        endSession();
                 }
 
                 if (log.isDebugEnabled())
@@ -685,7 +686,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
             }
             finally {
                 if (ses)
-                    sesHolder.set(null);
+                    endSession();
             }
 
             if (log.isDebugEnabled())
@@ -740,7 +741,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
             }
             finally {
                 if (ses)
-                    sesHolder.set(null);
+                    endSession();
             }
 
             if (log.isDebugEnabled())
@@ -782,7 +783,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
         }
         finally {
             if (ses) {
-                sesHolder.set(null);
+                endSession();
 
                 tx.removeMeta(SES_ATTR);
             }
@@ -805,10 +806,19 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
     }
 
     /**
+     * Clears session holder.
+     */
+    void endSession() {
+        assert sesEnabled;
+
+        sesHolder.set(null);
+    }
+
+    /**
      * @param tx Current transaction.
      * @return {@code True} if session was initialized.
      */
-    private boolean initSession(@Nullable IgniteInternalTx tx) {
+    boolean initSession(@Nullable IgniteInternalTx tx) {
         if (!sesEnabled)
             return false;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
index e621ec0..079940e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
@@ -122,6 +122,31 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
     /** Log. */
     private IgniteLogger log;
 
+    /** Store manager. */
+    private GridCacheStoreManager storeMgr;
+
+    /**
+     * Creates a write-behind cache store for the given store.
+     *
+     * @param storeMgr Store manager.
+     * @param gridName Grid name.
+     * @param cacheName Cache name.
+     * @param log Grid logger.
+     * @param store {@code GridCacheStore} that need to be wrapped.
+     */
+    public GridCacheWriteBehindStore(
+        GridCacheStoreManager storeMgr,
+        String gridName,
+        String cacheName,
+        IgniteLogger log,
+        CacheStore<K, V> store) {
+        this.storeMgr = storeMgr;
+        this.gridName = gridName;
+        this.cacheName = cacheName;
+        this.log = log;
+        this.store = store;
+    }
+
     /**
      * Sets initial capacity for the write cache.
      *
@@ -234,21 +259,6 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
     }
 
     /**
-     * Creates a write-behind cache store for the given store and cache name.
-     *
-     * @param gridName Grid name.
-     * @param cacheName Cache name.
-     * @param log Grid logger.
-     * @param store {@code GridCacheStore} that need to be wrapped.
-     */
-    public GridCacheWriteBehindStore(String gridName, String cacheName, IgniteLogger log,
CacheStore<K, V> store) {
-        this.gridName = gridName;
-        this.cacheName = cacheName;
-        this.log = log;
-        this.store = store;
-    }
-
-    /**
      * @return Underlying store.
      */
     public CacheStore<K, V> store() {
@@ -556,7 +566,7 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
                 }
 
                 if (!batch.isEmpty()) {
-                    applyBatch(batch);
+                    applyBatch(batch, false);
 
                     cacheTotalOverflowCntr.incrementAndGet();
 
@@ -573,8 +583,9 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
      * Performs batch operation on underlying store.
      *
      * @param valMap Batch map.
+     * @param initSes {@code True} if need to initialize session.
      */
-    private void applyBatch(Map<K, StatefulValue<K, V>> valMap) {
+    private void applyBatch(Map<K, StatefulValue<K, V>> valMap, boolean initSes)
{
         assert valMap.size() <= batchSize;
 
         StoreOperation operation = null;
@@ -593,7 +604,7 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
             batch.put(e.getKey(), e.getValue().entry());
         }
 
-        if (updateStore(operation, batch)) {
+        if (updateStore(operation, batch, initSes)) {
             for (Map.Entry<K, StatefulValue<K, V>> e : valMap.entrySet()) {
                 StatefulValue<K, V> val = e.getValue();
 
@@ -643,10 +654,15 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
      *
      * @param operation Status indicating operation that should be performed.
      * @param vals Key-Value map.
+     * @param initSes {@code True} if need to initialize session.
      * @return {@code true} if value may be deleted from the write cache,
      *         {@code false} otherwise
      */
-    private boolean updateStore(StoreOperation operation, Map<K, Entry<? extends K,
? extends  V>> vals) {
+    private boolean updateStore(StoreOperation operation,
+        Map<K, Entry<? extends K, ? extends  V>> vals,
+        boolean initSes) {
+        boolean ses = initSes && initSession();
+
         try {
             switch (operation) {
                 case PUT:
@@ -682,6 +698,10 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
 
             return false;
         }
+        finally {
+            if (ses)
+                storeMgr.endSession();
+        }
     }
 
     /**
@@ -699,6 +719,13 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
     }
 
     /**
+     * @return {@code True} if session was initialized.
+     */
+    private boolean initSession() {
+        return storeMgr != null && storeMgr.initSession(null);
+    }
+
+    /**
      * Thread that performs time-based flushing of written values to the underlying storage.
      */
     private class Flusher extends GridWorker {
@@ -801,14 +828,14 @@ public class GridCacheWriteBehindStore<K, V> implements CacheStore<K,
V>, Lifecy
                 }
 
                 if (batch != null && !batch.isEmpty()) {
-                    applyBatch(batch);
+                    applyBatch(batch, true);
                     batch = null;
                 }
             }
 
             // Process the remainder.
             if (!pending.isEmpty())
-                applyBatch(pending);
+                applyBatch(pending, true);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index 8ee44ef..acc17cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -295,6 +295,9 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter
{
             loc ? cctx.grid().cluster().forLocal() : null);
     }
 
+    /**
+     * @param routineId Consume ID.
+     */
     public void cancelInternalQuery(UUID routineId) {
         try {
             cctx.kernalContext().continuous().stopRoutine(routineId).get();
@@ -308,7 +311,7 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter
{
     /**
      * @param cfg Listener configuration.
      * @param onStart Whether listener is created on node start.
-     * @throws IgniteCheckedException
+     * @throws IgniteCheckedException If failed.
      */
     public void executeJCacheQuery(CacheEntryListenerConfiguration cfg, boolean onStart)
         throws IgniteCheckedException {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
index e751b8f..883a216 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
@@ -56,7 +56,7 @@ public abstract class GridCacheWriteBehindStoreAbstractSelfTest extends
GridComm
      * @throws Exception If failed.
      */
     protected void initStore(int flushThreadCnt) throws Exception {
-        store = new GridCacheWriteBehindStore<>("", "", log, delegate);
+        store = new GridCacheWriteBehindStore<>(null, "", "", log, delegate);
 
         store.setFlushFrequency(FLUSH_FREQUENCY);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheAtomicStoreSessionWriteBehindTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheAtomicStoreSessionWriteBehindTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheAtomicStoreSessionWriteBehindTest.java
new file mode 100644
index 0000000..9cd0f96
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheAtomicStoreSessionWriteBehindTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.processors.cache.integration;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheAtomicStoreSessionWriteBehindTest extends IgniteCacheStoreSessionWriteBehindAbstractTest
{
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicWriteOrderMode atomicWriteOrderMode() {
+        return PRIMARY;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionWriteBehindAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionWriteBehindAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionWriteBehindAbstractTest.java
new file mode 100644
index 0000000..4eb5a4d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionWriteBehindAbstractTest.java
@@ -0,0 +1,269 @@
+/*
+ * 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.processors.cache.integration;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.jetbrains.annotations.*;
+
+import javax.cache.*;
+import javax.cache.configuration.*;
+import javax.cache.integration.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+
+/**
+ *
+ */
+public abstract class IgniteCacheStoreSessionWriteBehindAbstractTest extends IgniteCacheAbstractTest
{
+    /** */
+    private static final String CACHE_NAME1 = "cache1";
+
+    /** */
+    private static volatile CountDownLatch latch;
+
+    /** */
+    private static volatile ExpectedData expData;
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode distributionMode() {
+        return PARTITIONED_ONLY;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        TestStore store = new TestStore(); // Use the same store instance for both caches.
+
+        assert cfg.getCacheConfiguration().length == 1;
+
+        CacheConfiguration ccfg0 = cfg.getCacheConfiguration()[0];
+
+        ccfg0.setReadThrough(true);
+        ccfg0.setWriteThrough(true);
+        ccfg0.setWriteBehindBatchSize(10);
+        ccfg0.setWriteBehindFlushFrequency(1000);
+        ccfg0.setWriteBehindEnabled(true);
+
+        ccfg0.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+
+        CacheConfiguration ccfg1 = cacheConfiguration(gridName);
+
+        ccfg1.setReadThrough(true);
+        ccfg1.setWriteThrough(true);
+        ccfg1.setWriteBehindBatchSize(10);
+        ccfg1.setWriteBehindFlushFrequency(1000);
+        ccfg1.setWriteBehindEnabled(true);
+
+        ccfg1.setName(CACHE_NAME1);
+
+        ccfg1.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+
+        cfg.setCacheConfiguration(ccfg0, ccfg1);
+
+        return cfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSession() throws Exception {
+        testCache(null);
+
+        testCache(CACHE_NAME1);
+    }
+
+    /**
+     * @param cacheName Cache name.
+     * @throws Exception If failed.
+     */
+    private void testCache(String cacheName) throws Exception {
+        IgniteCache<Integer, Integer> cache = ignite(0).jcache(cacheName);
+
+        try {
+            latch = new CountDownLatch(1);
+
+            expData = new ExpectedData("writeAll", cacheName);
+
+            for (int i = 0; i < 10; i++)
+                cache.put(i, i);
+
+            assertTrue(latch.await(5000, TimeUnit.MILLISECONDS));
+        }
+        finally {
+            latch = null;
+        }
+
+        try {
+            latch = new CountDownLatch(1);
+
+            expData = new ExpectedData("deleteAll", cacheName);
+
+            for (int i = 0; i < 10; i++)
+                cache.remove(i);
+
+            assertTrue(latch.await(5000, TimeUnit.MILLISECONDS));
+        }
+        finally {
+            latch = null;
+        }
+    }
+
+    /**
+     *
+     */
+    private class TestStore implements CacheStore<Object, Object> {
+        /** Auto-injected store session. */
+        @CacheStoreSessionResource
+        private CacheStoreSession ses;
+
+        /** */
+        @IgniteInstanceResource
+        protected Ignite ignite;
+
+        /** {@inheritDoc} */
+        @Override public void loadCache(IgniteBiInClosure<Object, Object> clo, @Nullable
Object... args) {
+            fail();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void txEnd(boolean commit) throws CacheWriterException {
+            fail();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object load(Object key) throws CacheLoaderException {
+            fail();
+
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map<Object, Object> loadAll(Iterable<?> keys) throws
CacheLoaderException {
+            fail();
+
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void write(Cache.Entry<?, ?> entry) throws CacheWriterException
{
+            fail();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeAll(Collection<Cache.Entry<?, ?>> entries)
throws CacheWriterException {
+            log.info("writeAll: " + entries);
+
+            assertEquals(10, entries.size());
+
+            checkSession("writeAll");
+        }
+
+        /** {@inheritDoc} */
+        @Override public void delete(Object key) throws CacheWriterException {
+            fail();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void deleteAll(Collection<?> keys) throws CacheWriterException
{
+            log.info("deleteAll: " + keys);
+
+            assertEquals(10, keys.size());
+
+            checkSession("deleteAll");
+        }
+
+        /**
+         * @return Store session.
+         */
+        private CacheStoreSession session() {
+            return ses;
+        }
+
+        /**
+         * @param mtd Called stored method.
+         */
+        private void checkSession(String mtd) {
+            assertNotNull(ignite);
+
+            CacheStoreSession ses = session();
+
+            assertNotNull(ses);
+
+            log.info("Cache: " + ses.cacheName());
+
+            assertFalse(ses.isWithinTransaction());
+
+            assertNull(ses.transaction());
+
+            assertNotNull(expData);
+
+            assertEquals(mtd, expData.expMtd);
+
+            assertEquals(expData.expCacheName, ses.cacheName());
+
+            assertNotNull(ses.properties());
+
+            ses.properties().put(1, "test");
+
+            assertEquals("test", ses.properties().get(1));
+
+            latch.countDown();
+        }
+    }
+
+    /**
+     *
+     */
+    static class ExpectedData {
+        /** */
+        private final String expMtd;
+
+        /** */
+        private final String expCacheName;
+
+        /**
+         * @param expMtd Expected method.
+         * @param expCacheName Expected cache name.
+         */
+        public ExpectedData(String expMtd, String expCacheName) {
+            this.expMtd = expMtd;
+            this.expCacheName = expCacheName;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheTxStoreSessionWriteBehindTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheTxStoreSessionWriteBehindTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheTxStoreSessionWriteBehindTest.java
new file mode 100644
index 0000000..aef4f64
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheTxStoreSessionWriteBehindTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.processors.cache.integration;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheTxStoreSessionWriteBehindTest extends IgniteCacheStoreSessionWriteBehindAbstractTest
{
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4bb2b3f2/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 8e8ecbe..2793550 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -362,6 +362,8 @@ public class IgniteCacheTestSuite extends TestSuite {
 
         suite.addTestSuite(IgniteCacheAtomicStoreSessionTest.class);
         suite.addTestSuite(IgniteCacheTxStoreSessionTest.class);
+        suite.addTestSuite(IgniteCacheAtomicStoreSessionWriteBehindTest.class);
+        suite.addTestSuite(IgniteCacheTxStoreSessionWriteBehindTest.class);
 
         suite.addTestSuite(IgniteCacheAtomicNoReadThroughTest.class);
         suite.addTestSuite(IgniteCacheAtomicNearEnabledNoReadThroughTest.class);


Mime
View raw message