ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [50/53] [abbrv] incubator-ignite git commit: # ignite-63
Date Fri, 23 Jan 2015 05:02:15 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
deleted file mode 100644
index f19a1b1..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * 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.gridgain.grid.kernal.processors.cache;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.marshaller.*;
-import org.apache.ignite.marshaller.optimized.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.internal.processors.cache.distributed.dht.*;
-import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheDistributionMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-
-/**
- * Tests from {@link GridCacheEntry#memorySize()} method.
- */
-public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Null reference size (optimized marshaller writes one byte for null reference). */
-    private static final int NULL_REF_SIZE = 1;
-
-    /** Entry overhead. */
-    private static final int ENTRY_OVERHEAD;
-
-    /** Replicated entry overhead. */
-    private static final int REPLICATED_ENTRY_OVERHEAD;
-
-    /** DHT entry overhead. */
-    private static final int DHT_ENTRY_OVERHEAD;
-
-    /** Near entry overhead. */
-    private static final int NEAR_ENTRY_OVERHEAD;
-
-    /** Reader size. */
-    private static final int READER_SIZE = 24;
-
-    /** Key size in bytes. */
-    private static final int KEY_SIZE;
-
-    /** 1KB value size in bytes. */
-    private static final int ONE_KB_VAL_SIZE;
-
-    /** 2KB value size in bytes. */
-    private static final int TWO_KB_VAL_SIZE;
-
-    /**
-     *
-     */
-    static {
-        try {
-            ENTRY_OVERHEAD = U.<Integer>staticField(GridCacheMapEntry.class, "SIZE_OVERHEAD");
-            DHT_ENTRY_OVERHEAD = U.<Integer>staticField(GridDhtCacheEntry.class, "DHT_SIZE_OVERHEAD");
-            NEAR_ENTRY_OVERHEAD = U.<Integer>staticField(GridNearCacheEntry.class, "NEAR_SIZE_OVERHEAD");
-            REPLICATED_ENTRY_OVERHEAD = DHT_ENTRY_OVERHEAD;
-
-            IgniteMarshaller marsh = new IgniteOptimizedMarshaller();
-
-            KEY_SIZE = marsh.marshal(1).length;
-            ONE_KB_VAL_SIZE = marsh.marshal(new Value(new byte[1024])).length;
-            TWO_KB_VAL_SIZE = marsh.marshal(new Value(new byte[2048])).length;
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** Cache mode. */
-    private GridCacheMode mode;
-
-    /** Near cache enabled flag. */
-    private boolean nearEnabled;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setCacheMode(mode);
-        cacheCfg.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : PARTITIONED_ONLY);
-        cacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        if (mode == PARTITIONED)
-            cacheCfg.setBackups(0);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        return cfg;
-    }
-
-    /** @throws Exception If failed. */
-    public void testLocal() throws Exception {
-        mode = LOCAL;
-
-        try {
-            GridCache<Integer, Value> cache = startGrid().cache(null);
-
-            assertTrue(cache.putx(1, new Value(new byte[1024])));
-            assertTrue(cache.putx(2, new Value(new byte[2048])));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + extrasSize(cache.entry(0)),
-                cache.entry(0).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + extrasSize(cache.entry(1)),
-                cache.entry(1).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + extrasSize(cache.entry(2)),
-                cache.entry(2).memorySize());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testReplicated() throws Exception {
-        mode = REPLICATED;
-
-        try {
-            GridCache<Integer, Value> cache = startGrid().cache(null);
-
-            assertTrue(cache.putx(1, new Value(new byte[1024])));
-            assertTrue(cache.putx(2, new Value(new byte[2048])));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + REPLICATED_ENTRY_OVERHEAD +
-                extrasSize(cache.entry(0)), cache.entry(0).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + REPLICATED_ENTRY_OVERHEAD +
-                extrasSize(cache.entry(1)), cache.entry(1).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + REPLICATED_ENTRY_OVERHEAD +
-                extrasSize(cache.entry(2)), cache.entry(2).memorySize());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearEnabled() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = true;
-
-        try {
-            startGridsMultiThreaded(2);
-
-            int[] keys = new int[3];
-
-            int key = 0;
-
-            for (int i = 0; i < keys.length; i++) {
-                while (true) {
-                    key++;
-
-                    if (grid(0).mapKeyToNode(null, key).equals(grid(0).localNode())) {
-                        if (i > 0)
-                            assertTrue(cache(0).putx(key, new Value(new byte[i * 1024])));
-
-                        keys[i] = key;
-
-                        break;
-                    }
-                }
-            }
-
-            // Create near entries.
-            assertNotNull(cache(1).get(keys[1]));
-            assertNotNull(cache(1).get(keys[2]));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[0])), cache(0).entry(keys[0]).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE +
-                extrasSize(cache(0).entry(keys[1])), cache(0).entry(keys[1]).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE +
-                extrasSize(cache(0).entry(keys[2])), cache(0).entry(keys[2]).memorySize());
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD +
-                extrasSize(cache(1).entry(keys[0])), cache(1).entry(keys[0]).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD +
-                extrasSize(cache(1).entry(keys[1])), cache(1).entry(keys[1]).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD +
-                extrasSize(cache(1).entry(keys[2])), cache(1).entry(keys[2]).memorySize());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearDisabled() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = false;
-
-        try {
-            startGridsMultiThreaded(2);
-
-            int[] keys = new int[3];
-
-            int key = 0;
-
-            for (int i = 0; i < keys.length; i++) {
-                while (true) {
-                    key++;
-
-                    if (grid(0).mapKeyToNode(null, key).equals(grid(0).localNode())) {
-                        if (i > 0)
-                            assertTrue(cache(0).putx(key, new Value(new byte[i * 1024])));
-
-                        keys[i] = key;
-
-                        break;
-                    }
-                }
-            }
-
-            // Create near entries.
-            assertNotNull(cache(1).get(keys[1]));
-            assertNotNull(cache(1).get(keys[2]));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[0])), cache(0).entry(keys[0]).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[1])), cache(0).entry(keys[1]).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[2])), cache(0).entry(keys[2]).memorySize());
-
-            // Do not test other node since there are no backups.
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * Get entry extras size.
-     *
-     * @param entry Entry.
-     * @return Extras size.
-     * @throws Exception If failed.
-     */
-    private int extrasSize(GridCacheEntry entry) throws Exception {
-        Method mthd = GridCacheMapEntry.class.getDeclaredMethod("extrasSize");
-
-        mthd.setAccessible(true);
-
-        GridCacheContext ctx = U.field(entry, "ctx");
-
-        GridCacheEntryEx entry0 = ((GridCacheEntryImpl) entry).entryEx(false, ctx.discovery().topologyVersion());
-
-        return (Integer)mthd.invoke(entry0);
-    }
-
-    /** Value. */
-    @SuppressWarnings("UnusedDeclaration")
-    private static class Value implements Serializable {
-        /** Byte array. */
-        private byte[] arr;
-
-        /** @param arr Byte array. */
-        private Value(byte[] arr) {
-            this.arr = arr;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            Value val = (Value)o;
-
-            return Arrays.equals(arr, val.arr);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return arr != null ? Arrays.hashCode(arr) : 0;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheMvccFlagsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheMvccFlagsTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheMvccFlagsTest.java
deleted file mode 100644
index ee11681..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheMvccFlagsTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.gridgain.grid.kernal.processors.cache;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.*;
-
-import static org.apache.ignite.cache.GridCacheMode.*;
-
-/**
- * Tests flags correctness.
- */
-public class GridCacheMvccFlagsTest extends GridCommonAbstractTest {
-    /** Grid. */
-    private GridKernal grid;
-
-    /**
-     *
-     */
-    public GridCacheMvccFlagsTest() {
-        super(true /*start grid. */);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        grid = (GridKernal)grid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        grid = null;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration() throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration();
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setCacheMode(REPLICATED);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        return cfg;
-    }
-
-    /**
-     *
-     */
-    public void testAllTrueFlags() {
-        GridCacheAdapter<String, String> cache = grid.internalCache();
-
-        GridCacheTestEntryEx<String, String> entry = new GridCacheTestEntryEx<>(cache.context(), "1");
-
-        UUID id = UUID.randomUUID();
-
-        GridCacheVersion ver = new GridCacheVersion(1, 0, 0, 0, 0);
-
-        GridCacheMvccCandidate<String> c = new GridCacheMvccCandidate<>(
-            entry,
-            id,
-            id,
-            ver,
-            1,
-            ver,
-            0,
-            true,
-            true,
-            true,
-            true,
-            true,
-            true
-        );
-
-        c.setOwner();
-        c.setReady();
-        c.setUsed();
-
-        short flags = c.flags();
-
-        info("Candidate: " + c);
-
-        for (GridCacheMvccCandidate.Mask mask : GridCacheMvccCandidate.Mask.values())
-            assertTrue("Candidate: " + c, mask.get(flags));
-    }
-
-    /**
-     *
-     */
-    public void testAllFalseFlags() {
-        GridCacheAdapter<String, String> cache = grid.internalCache();
-
-        GridCacheTestEntryEx<String, String> entry = new GridCacheTestEntryEx<>(cache.context(), "1");
-
-        UUID id = UUID.randomUUID();
-
-        GridCacheVersion ver = new GridCacheVersion(1, 0, 0, 0, 0);
-
-        GridCacheMvccCandidate<String> c = new GridCacheMvccCandidate<>(
-            entry,
-            id,
-            id,
-            ver,
-            1,
-            ver,
-            0,
-            false,
-            false,
-            false,
-            false,
-            false,
-            false
-        );
-
-        short flags = c.flags();
-
-        info("Candidate: " + c);
-
-        for (GridCacheMvccCandidate.Mask mask : GridCacheMvccCandidate.Mask.values())
-            assertFalse("Mask check failed [mask=" + mask + ", c=" + c + ']', mask.get(flags));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloadingEvictionsSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
index 5b92bea..3bf381f 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
@@ -23,6 +23,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
index 9d4f590..3aac6f4 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.internal.managers.communication.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
deleted file mode 100644
index e21512d..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
+++ /dev/null
@@ -1,821 +0,0 @@
-/*
- * 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.gridgain.grid.kernal.processors.cache;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.internal.processors.cache.transactions.*;
-import org.apache.ignite.internal.processors.dr.*;
-import org.apache.ignite.internal.util.lang.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.jetbrains.annotations.*;
-
-import javax.cache.expiry.*;
-import javax.cache.processor.*;
-import java.util.*;
-
-/**
- * Test entry.
- */
-public class GridCacheTestEntryEx<K, V> extends GridMetadataAwareAdapter implements GridCacheEntryEx<K, V> {
-    /** Key. */
-    private K key;
-
-    /** Val. */
-    private V val;
-
-    /** TTL. */
-    private long ttl;
-
-    /** Version. */
-    private GridCacheVersion ver = new GridCacheVersion(0, 0, 0, 1, 0);
-
-    /** Obsolete version. */
-    private GridCacheVersion obsoleteVer = ver;
-
-    /** MVCC. */
-    private GridCacheMvcc<K> mvcc;
-
-    /**
-     * @param ctx Context.
-     * @param key Key.
-     */
-    public GridCacheTestEntryEx(GridCacheContext<K, V> ctx, K key) {
-        mvcc = new GridCacheMvcc<>(ctx);
-
-        this.key = key;
-    }
-
-    /**
-     * @param ctx Context.
-     * @param key Key.
-     * @param val Value.
-     */
-    public GridCacheTestEntryEx(GridCacheContext<K, V> ctx, K key, V val) {
-        mvcc = new GridCacheMvcc<>(ctx);
-
-        this.key = key;
-        this.val = val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int memorySize() throws IgniteCheckedException {
-        return 1024;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isInternal() {
-        return key instanceof GridCacheInternal;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isDht() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isNear() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isReplicated() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isLocal() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean detached() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public GridCacheContext<K, V> context() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public GridCacheEntry<K, V> evictWrap() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int partition() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean partitionValid() {
-        return true;
-    }
-
-    /**
-     * @param threadId Thread ID.
-     * @param ver Lock version.
-     * @param timeout Lock acquisition timeout.
-     * @param reenter Reentry flag ({@code true} if reentry is allowed).
-     * @param tx Transaction flag.
-     * @return New lock candidate if lock was added, or current owner if lock was reentered,
-     *      or <tt>null</tt> if lock was owned by another thread and timeout is negative.
-     */
-    @Nullable public GridCacheMvccCandidate<K> addLocal(
-        long threadId,
-        GridCacheVersion ver,
-        long timeout,
-        boolean reenter,
-        boolean tx) {
-        return mvcc.addLocal(
-            this,
-            threadId,
-            ver,
-            timeout,
-            reenter,
-            tx,
-            false
-        );
-    }
-
-    /**
-     * Adds new lock candidate.
-     *
-     * @param nodeId Node ID.
-     * @param threadId Thread ID.
-     * @param ver Lock version.
-     * @param timeout Lock acquire timeout.
-     * @param ec Not used.
-     * @param tx Transaction flag.
-     * @return Remote candidate.
-     */
-    public GridCacheMvccCandidate<K> addRemote(UUID nodeId, long threadId, GridCacheVersion ver, long timeout,
-        boolean ec, boolean tx) {
-        return mvcc.addRemote(this, nodeId, null, threadId, ver, timeout, tx, true, false);
-    }
-
-    /**
-     * Adds new lock candidate.
-     *
-     * @param nodeId Node ID.
-     * @param threadId Thread ID.
-     * @param ver Lock version.
-     * @param timeout Lock acquire timeout.
-     * @param tx Transaction flag.
-     * @return Remote candidate.
-     */
-    public GridCacheMvccCandidate<K> addNearLocal(UUID nodeId, long threadId, GridCacheVersion ver, long timeout,
-        boolean tx) {
-        return mvcc.addNearLocal(this, nodeId, null, threadId, ver, timeout, tx, true);
-    }
-
-    /**
-     *
-     * @param baseVer Base version.
-     */
-    public void salvageRemote(GridCacheVersion baseVer) {
-        mvcc.salvageRemote(baseVer);
-    }
-
-    /**
-     * Moves completed candidates right before the base one. Note that
-     * if base is not found, then nothing happens and {@code false} is
-     * returned.
-     *
-     * @param baseVer Base version.
-     * @param committedVers Committed versions relative to base.
-     * @param rolledbackVers Rolled back versions relative to base.
-     * @return Lock owner.
-     */
-    @Nullable public GridCacheMvccCandidate<K> orderCompleted(GridCacheVersion baseVer,
-        Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers) {
-        return mvcc.orderCompleted(baseVer, committedVers, rolledbackVers);
-    }
-
-    /**
-     * @param ver Version.
-     */
-    public void doneRemote(GridCacheVersion ver) {
-        mvcc.doneRemote(ver, Collections.<GridCacheVersion>emptyList(),
-            Collections.<GridCacheVersion>emptyList(), Collections.<GridCacheVersion>emptyList());
-    }
-
-    /**
-     * @param baseVer Base version.
-     * @param owned Owned.
-     */
-    public void orderOwned(GridCacheVersion baseVer, GridCacheVersion owned) {
-        mvcc.markOwned(baseVer, owned);
-    }
-
-    /**
-     * @param ver Lock version to acquire or set to ready.
-     * @return Current owner.
-     */
-    @Nullable public GridCacheMvccCandidate<K> readyLocal(GridCacheVersion ver) {
-        return mvcc.readyLocal(ver);
-    }
-
-    /**
-     * @param ver Ready near lock version.
-     * @param mapped Mapped version.
-     * @param committedVers Committed versions.
-     * @param rolledbackVers Rolled back versions.
-     * @param pending Pending versions.
-     * @return Lock owner.
-     */
-    @Nullable public GridCacheMvccCandidate<K> readyNearLocal(GridCacheVersion ver, GridCacheVersion mapped,
-        Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers,
-        Collection<GridCacheVersion> pending) {
-        return mvcc.readyNearLocal(ver, mapped, committedVers, rolledbackVers, pending);
-    }
-
-    /**
-     * @param cand Candidate to set to ready.
-     * @return Current owner.
-     */
-    @Nullable public GridCacheMvccCandidate<K> readyLocal(GridCacheMvccCandidate<K> cand) {
-        return mvcc.readyLocal(cand);
-    }
-
-    /**
-     * Local local release.
-     * @return Removed lock candidate or <tt>null</tt> if candidate was not removed.
-     */
-    @Nullable public GridCacheMvccCandidate<K> releaseLocal() {
-        return releaseLocal(Thread.currentThread().getId());
-    }
-
-    /**
-     * Local release.
-     *
-     * @param threadId ID of the thread.
-     * @return Current owner.
-     */
-    @Nullable public GridCacheMvccCandidate<K> releaseLocal(long threadId) {
-        return mvcc.releaseLocal(threadId);
-    }
-
-    /**
-     *
-     */
-    public void recheckLock() {
-        mvcc.recheck();
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheEntryInfo<K, V> info() {
-        GridCacheEntryInfo<K, V> info = new GridCacheEntryInfo<>();
-
-        info.key(key());
-        info.value(val);
-        info.ttl(ttl());
-        info.expireTime(expireTime());
-        info.keyBytes(keyBytes());
-        info.valueBytes(valueBytes().getIfMarshaled());
-        info.version(version());
-
-        return info;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean valid(long topVer) {
-        return true;
-    }
-
-    /** @inheritDoc */
-    @Override public K key() {
-        return key;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteTxKey<K> txKey() {
-        return new IgniteTxKey<>(key, 0);
-    }
-
-    /** @inheritDoc */
-    @Override public V rawGet() {
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public V rawGetOrUnmarshal(boolean tmp) throws IgniteCheckedException {
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasValue() {
-        return val != null;
-    }
-
-    /** @inheritDoc */
-    @Override public V rawPut(V val, long ttl) {
-        V old = this.val;
-
-        this.ttl = ttl;
-        this.val = val;
-
-        return old;
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheEntry<K, V> wrap(boolean prjAware) {
-        assert false; return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheEntry<K, V> wrapFilterLocked() throws IgniteCheckedException {
-        assert false; return null;
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheVersion obsoleteVersion() {
-        return obsoleteVer;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean obsolete() {
-        return obsoleteVer != null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean obsolete(GridCacheVersion exclude) {
-        return obsoleteVer != null && !obsoleteVer.equals(exclude);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean invalidate(@Nullable GridCacheVersion curVer, GridCacheVersion newVer)
-        throws IgniteCheckedException {
-        assert false; return false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean invalidate(@Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter)
-        throws GridCacheEntryRemovedException, IgniteCheckedException {
-        assert false; return false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean compact(@Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter)
-        throws GridCacheEntryRemovedException, IgniteCheckedException {
-        assert false;  return false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) {
-        assert false; return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheBatchSwapEntry<K, V> evictInBatchInternal(GridCacheVersion obsoleteVer)
-        throws IgniteCheckedException {
-        assert false; return null;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean isNew() {
-        assert false; return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isNewLocked() throws GridCacheEntryRemovedException {
-        assert false; return false;
-    }
-
-    /** @inheritDoc */
-    @Override public V innerGet(@Nullable IgniteTxEx<K, V> tx,
-        boolean readSwap,
-        boolean readThrough,
-        boolean failFast,
-        boolean unmarshal,
-        boolean updateMetrics,
-        boolean evt,
-        boolean tmp,
-        UUID subjId,
-        Object transformClo,
-        String taskName,
-        IgnitePredicate<GridCacheEntry<K, V>>[] filter,
-        @Nullable IgniteCacheExpiryPolicy expiryPlc) {
-        return val;
-    }
-
-    /** @inheritDoc */
-    @Override public V innerReload(IgnitePredicate<GridCacheEntry<K, V>>[] filter) {
-        return val;
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheUpdateTxResult<V> innerSet(@Nullable IgniteTxEx<K, V> tx, UUID evtNodeId, UUID affNodeId,
-        @Nullable V val, @Nullable byte[] valBytes, boolean writeThrough, boolean retval, long ttl,
-        boolean evt, boolean metrics, long topVer, IgnitePredicate<GridCacheEntry<K, V>>[] filter, GridDrType drType,
-        long drExpireTime, @Nullable GridCacheVersion drVer, UUID subjId, String taskName) throws IgniteCheckedException,
-        GridCacheEntryRemovedException {
-        return new GridCacheUpdateTxResult<>(true, rawPut(val, ttl));
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridTuple3<Boolean, V, EntryProcessorResult<Object>> innerUpdateLocal(GridCacheVersion ver,
-        GridCacheOperation op,
-        @Nullable Object writeObj,
-        @Nullable Object[] invokeArgs,
-        boolean writeThrough,
-        boolean retval,
-        @Nullable ExpiryPolicy expiryPlc,
-        boolean evt,
-        boolean metrics,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter,
-        boolean intercept,
-        UUID subjId,
-        String taskName)
-        throws IgniteCheckedException, GridCacheEntryRemovedException {
-        return new GridTuple3<>(false, null, null);
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheUpdateAtomicResult<K, V> innerUpdate(
-        GridCacheVersion ver,
-        UUID evtNodeId,
-        UUID affNodeId,
-        GridCacheOperation op,
-        @Nullable Object val,
-        @Nullable byte[] valBytes,
-        @Nullable Object[] invokeArgs,
-        boolean writeThrough,
-        boolean retval,
-        @Nullable IgniteCacheExpiryPolicy expiryPlc,
-        boolean evt,
-        boolean metrics,
-        boolean primary,
-        boolean checkVer,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter,
-        GridDrType drType,
-        long drTtl,
-        long drExpireTime,
-        @Nullable GridCacheVersion drVer,
-        boolean drResolve,
-        boolean intercept,
-        UUID subjId,
-        String taskName) throws IgniteCheckedException,
-        GridCacheEntryRemovedException {
-        return new GridCacheUpdateAtomicResult<>(true,
-            rawPut((V)val, 0),
-            (V)val,
-            null,
-            0L,
-            0L,
-            null,
-            null,
-            true);
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheUpdateTxResult<V> innerRemove(@Nullable IgniteTxEx<K, V> tx, UUID evtNodeId,
-        UUID affNodeId, boolean writeThrough, boolean retval, boolean evt, boolean metrics, long topVer,
-        IgnitePredicate<GridCacheEntry<K, V>>[] filter, GridDrType drType, @Nullable GridCacheVersion drVer, UUID subjId,
-        String taskName)
-        throws IgniteCheckedException, GridCacheEntryRemovedException {
-        obsoleteVer = ver;
-
-        V old = val;
-
-        val = null;
-
-        return new GridCacheUpdateTxResult<>(true, old);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean clear(GridCacheVersion ver, boolean readers,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) throws IgniteCheckedException {
-        if (ver == null || ver.equals(this.ver)) {
-            val = null;
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean tmLock(IgniteTxEx<K, V> tx, long timeout) {
-        assert false; return false;
-    }
-
-    /** @inheritDoc */
-    @Override public void txUnlock(IgniteTxEx<K, V> tx) {
-        assert false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean removeLock(GridCacheVersion ver) {
-        GridCacheMvccCandidate<K> doomed = mvcc.candidate(ver);
-
-        mvcc.remove(ver);
-
-        return doomed != null;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean markObsolete(GridCacheVersion ver) {
-        if (ver == null || ver.equals(obsoleteVer)) {
-            obsoleteVer = ver;
-
-            val = null;
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void onMarkedObsolete() {
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean markObsoleteIfEmpty(GridCacheVersion ver) {
-        if (val == null)
-            obsoleteVer = ver;
-
-        return obsoleteVer != null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean markObsoleteVersion(GridCacheVersion ver) {
-        if (this.ver.equals(ver)) {
-            obsoleteVer = ver;
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /** @inheritDoc */
-    @Override public byte[] keyBytes() {
-        assert false; return null;
-    }
-
-    /** @inheritDoc */
-    @Override public byte[] getOrMarshalKeyBytes() {
-        assert false; return null;
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheVersion version() {
-        return ver;
-    }
-
-    /** @inheritDoc */
-    @Override public V peek(GridCachePeekMode mode, IgnitePredicate<GridCacheEntry<K, V>>[] filter) {
-        return val;
-    }
-
-    /** @inheritDoc */
-    @Override public GridTuple<V> peek0(boolean failFast, GridCachePeekMode mode,
-        IgnitePredicate<GridCacheEntry<K, V>>[] filter, IgniteTxEx<K, V> tx)
-        throws GridCacheEntryRemovedException, GridCacheFilterFailedException, IgniteCheckedException {
-        return F.t(val);
-    }
-
-    /** @inheritDoc */
-    @Override public V peek(Collection<GridCachePeekMode> modes, IgnitePredicate<GridCacheEntry<K, V>>[] filter)
-        throws GridCacheEntryRemovedException {
-        return val;
-    }
-
-    /** @inheritDoc */
-    @Override public V peekFailFast(GridCachePeekMode mode,
-        IgnitePredicate<GridCacheEntry<K, V>>[] filter) {
-        assert false; return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public V poke(V val) throws GridCacheEntryRemovedException, IgniteCheckedException {
-        V old = this.val;
-
-        this.val = val;
-
-        return old;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean initialValue(V val, @Nullable byte[] valBytes, GridCacheVersion ver, long ttl,
-        long expireTime, boolean preload, long topVer, GridDrType drType) throws IgniteCheckedException,
-        GridCacheEntryRemovedException {
-        assert false; return false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean initialValue(K key, GridCacheSwapEntry<V> unswapped) {
-        assert false; return false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean versionedValue(V val, GridCacheVersion curVer, GridCacheVersion newVer) {
-        assert false; return false;
-    }
-
-    /** @inheritDoc */
-    @Override public boolean hasLockCandidate(GridCacheVersion ver) {
-        return mvcc.hasCandidate(ver);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedByAny(GridCacheVersion... exclude) {
-        return !mvcc.isEmpty(exclude);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedByThread()  {
-        return lockedByThread(Thread.currentThread().getId());
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedLocally(GridCacheVersion lockVer) {
-        return mvcc.isLocallyOwned(lockVer);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean lockedLocallyByIdOrThread(GridCacheVersion lockVer, long threadId)
-        throws GridCacheEntryRemovedException {
-        return lockedLocally(lockVer) || lockedByThread(threadId);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedByThread(long threadId, GridCacheVersion exclude) {
-        return mvcc.isLocallyOwnedByThread(threadId, false, exclude);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedByThread(long threadId) {
-        return mvcc.isLocallyOwnedByThread(threadId, true);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedBy(GridCacheVersion ver) {
-        return mvcc.isOwnedBy(ver);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedByThreadUnsafe(long threadId) {
-        return mvcc.isLocallyOwnedByThread(threadId, true);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedByUnsafe(GridCacheVersion ver) {
-        return mvcc.isOwnedBy(ver);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean lockedLocallyUnsafe(GridCacheVersion lockVer) {
-        return mvcc.isLocallyOwned(lockVer);
-    }
-
-    /** @inheritDoc */
-    @Override public boolean hasLockCandidateUnsafe(GridCacheVersion ver) {
-        return mvcc.hasCandidate(ver);
-    }
-
-    /** @inheritDoc */
-    @Override public Collection<GridCacheMvccCandidate<K>> localCandidates(GridCacheVersion... exclude) {
-        return mvcc.localCandidates(exclude);
-    }
-
-    /** @inheritDoc */
-    public Collection<GridCacheMvccCandidate<K>> localCandidates(boolean reentries, GridCacheVersion... exclude) {
-        return mvcc.localCandidates(reentries, exclude);
-    }
-
-    /** @inheritDoc */
-    @Override public Collection<GridCacheMvccCandidate<K>> remoteMvccSnapshot(GridCacheVersion... exclude) {
-        return mvcc.remoteCandidates(exclude);
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheMvccCandidate<K> localCandidate(long threadId) throws GridCacheEntryRemovedException {
-        return mvcc.localCandidate(threadId);
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheMvccCandidate<K> candidate(GridCacheVersion ver) {
-        return mvcc.candidate(ver);
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheMvccCandidate<K> candidate(UUID nodeId, long threadId)
-        throws GridCacheEntryRemovedException {
-        return mvcc.remoteCandidate(nodeId, threadId);
-    }
-
-    /**
-     * @return Any MVCC owner.
-     */
-    public GridCacheMvccCandidate<K> anyOwner() {
-        return mvcc.anyOwner();
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheMvccCandidate<K> localOwner() {
-        return mvcc.localOwner();
-    }
-
-    /** @inheritDoc */
-    @Override public void keyBytes(byte[] keyBytes) {
-        assert false;
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheValueBytes valueBytes() {
-        assert false; return GridCacheValueBytes.nil();
-    }
-
-    /** @inheritDoc */
-    @Override public GridCacheValueBytes valueBytes(GridCacheVersion ver) {
-        assert false; return GridCacheValueBytes.nil();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long rawExpireTime() {
-        return 0;
-    }
-
-    /** @inheritDoc */
-    @Override public long expireTime() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long expireTimeUnlocked() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean onTtlExpired(GridCacheVersion obsoleteVer) {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long rawTtl() {
-        return ttl;
-    }
-
-    /** @inheritDoc */
-    @Override public long ttl() {
-        return ttl;
-    }
-
-    /** @inheritDoc */
-    @Override public void updateTtl(GridCacheVersion ver, long ttl) {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public V unswap() throws IgniteCheckedException {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public V unswap(boolean ignoreFlags, boolean needVal) throws IgniteCheckedException {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasLockCandidate(long threadId) throws GridCacheEntryRemovedException {
-        return localCandidate(threadId) != null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean deleted() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean obsoleteOrDeleted() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long startVersion() {
-        return 0;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
deleted file mode 100644
index 97135aa..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * 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.gridgain.grid.kernal.processors.cache;
-
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Harness for {@link GridCacheWriteBehindStore} tests.
- */
-public abstract class GridCacheWriteBehindStoreAbstractSelfTest extends GridCommonAbstractTest {
-    /** Write cache size. */
-    public static final int CACHE_SIZE = 1024;
-
-    /** Value dump interval. */
-    public static final int FLUSH_FREQUENCY = 1000;
-
-    /** Underlying store. */
-    protected GridCacheTestStore delegate = new GridCacheTestStore();
-
-    /** Tested store. */
-    protected GridCacheWriteBehindStore<Integer, String> store;
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        delegate = null;
-        store = null;
-
-        super.afterTestsStopped();
-    }
-
-    /**
-     * Initializes store.
-     *
-     * @param flushThreadCnt Count of flush threads
-     * @throws Exception If failed.
-     */
-    protected void initStore(int flushThreadCnt) throws Exception {
-        store = new GridCacheWriteBehindStore<>("", "", log, delegate);
-
-        store.setFlushFrequency(FLUSH_FREQUENCY);
-
-        store.setFlushSize(CACHE_SIZE);
-
-        store.setFlushThreadCount(flushThreadCnt);
-
-        delegate.reset();
-
-        store.start();
-    }
-
-    /**
-     * Shutdowns store.
-     *
-     * @throws Exception If failed.
-     */
-    protected void shutdownStore() throws Exception {
-        store.stop();
-
-        assertTrue("Store cache must be empty after shutdown", store.writeCache().isEmpty());
-    }
-
-    /**
-     * Performs multiple put, get and remove operations in several threads on a store. After
-     * all threads finished their operations, returns the total set of keys that should be
-     * in underlying store.
-     *
-     * @param threadCnt Count of threads that should update keys.
-     * @param keysPerThread Count of unique keys assigned to a thread.
-     * @return Set of keys that was totally put in store.
-     * @throws Exception If failed.
-     */
-    protected Set<Integer> runPutGetRemoveMultithreaded(int threadCnt, final int keysPerThread) throws Exception {
-        final ConcurrentMap<String, Set<Integer>> perThread = new ConcurrentHashMap<>();
-
-        final AtomicBoolean running = new AtomicBoolean(true);
-
-        final AtomicInteger cntr = new AtomicInteger();
-
-        final AtomicInteger operations = new AtomicInteger();
-
-        IgniteFuture<?> fut = multithreadedAsync(new Runnable() {
-            @SuppressWarnings({"NullableProblems"})
-            @Override public void run() {
-                // Initialize key set for this thread.
-                Set<Integer> set = new HashSet<>();
-
-                Set<Integer> old = perThread.putIfAbsent(Thread.currentThread().getName(), set);
-
-                if (old != null)
-                    set = old;
-
-                List<Integer> original = new ArrayList<>();
-
-                Random rnd = new Random();
-
-                for (int i = 0; i < keysPerThread; i++)
-                    original.add(cntr.getAndIncrement());
-
-                try {
-                    while (running.get()) {
-                        int op = rnd.nextInt(3);
-                        int idx = rnd.nextInt(keysPerThread);
-
-                        int key = original.get(idx);
-
-                        switch (op) {
-                            case 0:
-                                store.write(new CacheEntryImpl<>(key, "val" + key));
-                                set.add(key);
-
-                                operations.incrementAndGet();
-
-                                break;
-
-                            case 1:
-                                store.delete(key);
-                                set.remove(key);
-
-                                operations.incrementAndGet();
-
-                                break;
-
-                            case 2:
-                            default:
-                                store.write(new CacheEntryImpl<>(key, "broken"));
-
-                                String val = store.load(key);
-
-                                assertEquals("Invalid intermediate value: " + val, "broken", val);
-
-                                store.write(new CacheEntryImpl<>(key, "val" + key));
-
-                                set.add(key);
-
-                                // 2 put operations performed here.
-                                operations.incrementAndGet();
-                                operations.incrementAndGet();
-                                operations.incrementAndGet();
-
-                                break;
-                        }
-                    }
-                }
-                catch (Exception e) {
-                    error("Unexpected exception in put thread", e);
-
-                    assert false;
-                }
-            }
-        }, threadCnt, "put");
-
-        U.sleep(10000);
-
-        running.set(false);
-
-        fut.get();
-
-        log().info(">>> " + operations + " operations performed totally");
-
-        Set<Integer> total = new HashSet<>();
-
-        for (Set<Integer> threadVals : perThread.values()) {
-            total.addAll(threadVals);
-        }
-
-        return total;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxReentryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxReentryAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxReentryAbstractSelfTest.java
index 3faf42b..9eb9942 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxReentryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/IgniteTxReentryAbstractSelfTest.java
@@ -20,6 +20,7 @@ package org.gridgain.grid.kernal.processors.cache;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.transactions.*;
 import org.apache.ignite.internal.managers.communication.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
index d7e72fc..eef2a35 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.eviction.fifo.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bda1cbfd/modules/core/src/test/java/org/gridgain/grid/marshaller/GridMarshallerAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/marshaller/GridMarshallerAbstractTest.java b/modules/core/src/test/java/org/gridgain/grid/marshaller/GridMarshallerAbstractTest.java
index 8e547d1..c0531a9 100644
--- a/modules/core/src/test/java/org/gridgain/grid/marshaller/GridMarshallerAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/marshaller/GridMarshallerAbstractTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.streamer.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.*;


Mime
View raw message