http://git-wip-us.apache.org/repos/asf/ignite/blob/35706b94/modules/core/src/main/java/org/apache/ignite/internal/util/snaptree/package-info.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/snaptree/package-info.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/snaptree/package-info.java
deleted file mode 100644
index 2d75a8c..0000000
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/snaptree/package-info.java
+++ /dev/null
@@ -1,22 +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 description. -->
- * Snaptree and related classes.
- */
-package org.apache.ignite.internal.util.snaptree;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/35706b94/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
index 4d15047..bf726d5 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
@@ -45,7 +45,6 @@ import 
org.apache.ignite.thread.GridThreadPoolExecutorServiceSelfTest;
 import org.apache.ignite.thread.GridThreadTest;
 import org.apache.ignite.thread.IgniteThreadPoolSizeTest;
 import org.apache.ignite.util.GridConcurrentLinkedDequeMultiThreadedTest;
-import org.apache.ignite.util.GridIndexFillTest;
 import org.apache.ignite.util.GridIntListSelfTest;
 import org.apache.ignite.util.GridLogThrottleTest;
 import org.apache.ignite.util.GridLongListSelfTest;
@@ -106,7 +105,6 @@ public class IgniteUtilSelfTestSuite extends TestSuite {
         suite.addTestSuite(GridMessageCollectionTest.class);
         suite.addTestSuite(WorkersControlMXBeanTest.class);
         suite.addTestSuite(GridConcurrentLinkedDequeMultiThreadedTest.class);
-        suite.addTestSuite(GridIndexFillTest.class);
         suite.addTestSuite(GridLogThrottleTest.class);
         suite.addTestSuite(GridRandomSelfTest.class);
         suite.addTestSuite(GridSnapshotLockSelfTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/35706b94/modules/core/src/test/java/org/apache/ignite/util/GridIndexFillTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/util/GridIndexFillTest.java 
b/modules/core/src/test/java/org/apache/ignite/util/GridIndexFillTest.java
deleted file mode 100644
index 63635bd..0000000
--- a/modules/core/src/test/java/org/apache/ignite/util/GridIndexFillTest.java
+++ /dev/null
@@ -1,259 +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.apache.ignite.util;
-
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ThreadLocalRandom;
-import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.util.GridConcurrentSkipListSet;
-import org.apache.ignite.internal.util.snaptree.SnapTreeMap;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- * TODO write doc
- */
-public class GridIndexFillTest extends GridCommonAbstractTest {
-    /** */
-    private CopyOnWriteArrayList<Idx> idxs;
-
-    /** */
-    private ConcurrentHashMap<Integer, CountDownLatch> keyLocks;
-
-    @Override protected void beforeTest() throws Exception {
-        super.beforeTest();
-
-        idxs = new CopyOnWriteArrayList<>();
-
-        idxs.add(new Idx(true));
-
-        keyLocks = new ConcurrentHashMap<>();
-    }
-
-    /**
-     * @param k Key.
-     */
-    private CountDownLatch lock(String op, Integer k) {
-//        U.debug(op + " lock: " + k);
-        CountDownLatch latch = new CountDownLatch(1);
-
-        for(;;) {
-            CountDownLatch l = keyLocks.putIfAbsent(k, latch);
-
-            if (l == null)
-                return latch;
-
-            try {
-                l.await();
-            }
-            catch (InterruptedException e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    /**
-     * @param k Key.
-     */
-    private void unlock(Integer k, CountDownLatch latch) {
-//        U.debug("unlock: " + k);
-        assertTrue(keyLocks.remove(k, latch));
-
-        latch.countDown();
-    }
-
-    private void put(Integer k, Long v) {
-        CountDownLatch l = lock("add", k);
-
-        for (Idx idx : idxs)
-            idx.add(k, v);
-
-        unlock(k, l);
-    }
-
-    private void remove(Integer k) {
-        CountDownLatch l = lock("rm", k);
-
-        try {
-            Long v = null;
-
-            for (Idx idx : idxs) {
-                Long v2 = idx.remove(k, v);
-
-                if (v2 == null) {
-                    assert v == null;
-
-                    return; // Nothing to remove.
-                }
-
-                if (v == null)
-                    v = v2;
-                else
-                    assert v.equals(v2);
-            }
-        }
-        finally {
-            unlock(k, l);
-        }
-    }
-
-    public void testSnaptreeParallelBuild() throws Exception {
-        final AtomicBoolean stop = new AtomicBoolean();
-
-        IgniteInternalFuture<?> fut = multithreadedAsync(new 
Callable<Object>() {
-            @Override public Object call() throws Exception {
-                int i = ThreadLocalRandom.current().nextInt(100);
-
-                while (!stop.get()) {
-                    int k = i++ % 100;
-                    long v = i++ % 10;
-
-                    if (i++ % 2 == 0)
-                        put(k, v);
-                    else
-                        remove(k);
-                 }
-
-                return null;
-            }
-        }, 12, "put");
-
-        Thread.sleep(500);
-
-        Idx newIdx = new Idx(false);
-
-        idxs.add(newIdx);
-
-        SnapTreeMap<Integer, Long> snap = idxs.get(0).tree.clone();
-
-        for (Map.Entry<Integer, Long> entry : snap.entrySet())
-            newIdx.addX(entry.getKey(), entry.getValue());
-
-        newIdx.finish();
-
-        stop.set(true);
-
-        fut.get();
-
-        assertEquals(idxs.get(0).tree, idxs.get(1).tree);
-    }
-
-    private static class Idx {
-
-        static int z = 1;
-
-        private final SnapTreeMap<Integer, Long> tree = new SnapTreeMap<>(); 
//new ConcurrentSkipListMap<>();
-
-        private volatile Rm rm;
-
-        private final String name = "idx" + z++;
-
-        public Idx(boolean pk) {
-            if (!pk)
-                rm = new Rm();
-        }
-
-        public void add(Integer k, Long v) {
-//            U.debug(name + " add: k" + k + " " + v);
-
-            Long old = tree.put(k, v);
-
-            if (old != null) {
-                Rm rm = this.rm;
-
-                if (rm != null)
-                    rm.keys.add(k);
-            }
-        }
-
-        public void addX(Integer k, Long v) {
-//            U.debug(name + " addX: k" + k + " " + v);
-
-            assert v != null;
-            assert k != null;
-
-//            Lock l = rm.lock.writeLock();
-
-//            l.lock();
-
-            try {
-                if (!rm.keys.contains(k)) {
-//                    U.debug(name + " addX-put: k" + k + " " + v);
-
-                    tree.putIfAbsent(k, v);
-                }
-            }
-            finally {
-//                l.unlock();
-            }
-        }
-
-        public Long remove(Integer k, Long v) {
-            Rm rm = this.rm;
-
-            if (rm != null) {
-                assert v != null;
-
-//                Lock l = rm.lock.readLock();
-
-//                l.lock();
-
-                try {
-                    rm.keys.add(k);
-
-                    Long v2 = tree.remove(k);
-
-//                    U.debug(name + " rm1: k" + k + " " + v + " " + v2);
-
-                }
-                finally {
-//                    l.unlock();
-                }
-            }
-            else {
-                Long v2 = tree.remove(k);
-
-//                U.debug(name + " rm2: k" + k + " " + v + " " + v2);
-
-                if (v == null)
-                    v = v2;
-                else
-                    assertEquals(v, v2);
-            }
-
-            return v;
-        }
-
-        public void finish() {
-//            assertTrue(rm.tree.isEmpty());
-
-            rm = null;
-        }
-    }
-
-    private static class Rm {
-//        private final ReentrantReadWriteLock lock = new 
ReentrantReadWriteLock();
-
-        private final GridConcurrentSkipListSet<Integer> keys = new 
GridConcurrentSkipListSet<>();
-            //new SnapTreeMap<>(); //new ConcurrentSkipListMap<>();
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/35706b94/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTestEntity.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTestEntity.java
 
b/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTestEntity.java
deleted file mode 100644
index 015ec96..0000000
--- 
a/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTestEntity.java
+++ /dev/null
@@ -1,67 +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.apache.ignite.loadtests.h2indexing;
-
-import java.util.Date;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-
-/**
- * Test entity.
- */
-public class GridTestEntity {
-    /** */
-    @QuerySqlField(index = true)
-    private final String name;
-
-    /** */
-    @QuerySqlField(index = false)
-    private final Date date;
-
-    /**
-     * Constructor.
-     *
-     * @param name Name.
-     * @param date Date.
-     */
-    @SuppressWarnings("AssignmentToDateFieldFromParameter")
-    public GridTestEntity(String name, Date date) {
-        this.name = name;
-        this.date = date;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        GridTestEntity that = (GridTestEntity) o;
-
-        return !(date != null ? !date.equals(that.date) : that.date != null) &&
-            !(name != null ? !name.equals(that.name) : that.name != null);
-
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        int res = name != null ? name.hashCode() : 0;
-
-        res = 31 * res + (date != null ? date.hashCode() : 0);
-
-        return res;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/35706b94/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTreeBenchmark.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTreeBenchmark.java
 
b/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTreeBenchmark.java
deleted file mode 100644
index a711468..0000000
--- 
a/modules/indexing/src/test/java/org/apache/ignite/loadtests/h2indexing/GridTreeBenchmark.java
+++ /dev/null
@@ -1,280 +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.apache.ignite.loadtests.h2indexing;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.BrokenBarrierException;
-import java.util.concurrent.ConcurrentNavigableMap;
-import java.util.concurrent.ConcurrentSkipListMap;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.ignite.internal.util.snaptree.SnapTreeMap;
-
-/**
- * NavigableMaps PUT benchmark.
- */
-public class GridTreeBenchmark {
-    /** */
-    private static final int PUTS = 8000000;
-
-    /** */
-    private static final int THREADS = 8;
-
-    /** */
-    private static final int ITERATIONS = PUTS / THREADS;
-
-    /**
-     * Main method.
-     *
-     * @param args Command line args (not used).
-     * @throws BrokenBarrierException If failed.
-     * @throws InterruptedException If failed.
-     */
-    public static void main(String... args) throws BrokenBarrierException, 
InterruptedException {
-        doTestMaps();
-    }
-
-    /**
-     * @throws BrokenBarrierException If failed.
-     * @throws InterruptedException If failed.
-     */
-    private static void doTestAtomicInt() throws BrokenBarrierException, 
InterruptedException {
-        final AtomicInteger[] cnts = new AtomicInteger[8];
-
-        for (int i = 0; i < cnts.length; i++)
-            cnts[i] = new AtomicInteger();
-
-        final Thread[] ths = new Thread[THREADS];
-
-        final CyclicBarrier barrier = new CyclicBarrier(THREADS + 1);
-
-        final AtomicInteger cnt = new AtomicInteger();
-
-        for (int i = 0; i < ths.length; i++) {
-            ths[i] = new Thread(new Runnable() {
-                @Override public void run() {
-                    int idx = cnt.getAndIncrement();
-
-                    AtomicInteger x = cnts[idx % cnts.length];
-
-                    try {
-                        barrier.await();
-                    }
-                    catch (Exception e) {
-                        throw new IllegalStateException(e);
-                    }
-
-                    for (int i = 0; i < ITERATIONS; i++)
-                        x.incrementAndGet();
-                }
-            });
-
-            ths[i].start();
-        }
-
-        barrier.await();
-
-        long start = System.currentTimeMillis();
-
-        for (Thread t : ths)
-            t.join();
-
-        long time = System.currentTimeMillis() - start;
-
-        System.out.println(time);
-
-    }
-
-    /**
-     * @throws BrokenBarrierException If failed.
-     * @throws InterruptedException If failed.
-     */
-    private static void doTestMaps() throws BrokenBarrierException, 
InterruptedException {
-        final UUID[] data = generate();
-
-        @SuppressWarnings("unchecked")
-        final Map<UUID, UUID>[] maps = new Map[4];
-
-        for (int i = 0; i < maps.length; i++)
-            maps[i] =
-                new SnapTreeMap<>();
-
-
-        final Thread[] ths = new Thread[THREADS];
-
-        final CyclicBarrier barrier = new CyclicBarrier(THREADS + 1);
-
-        final AtomicInteger cnt = new AtomicInteger();
-
-        for (int i = 0; i < ths.length; i++) {
-            ths[i] = new Thread(new Runnable() {
-                @Override public void run() {
-                    int idx = cnt.getAndIncrement();
-
-                    int off = idx * ITERATIONS;
-
-                    Map<UUID, UUID> map = maps[idx % maps.length];
-
-                    try {
-                        barrier.await();
-                    }
-                    catch (Exception e) {
-                        throw new IllegalStateException(e);
-                    }
-
-                    for (int i = 0; i < ITERATIONS; i++) {
-                        UUID id = data[off + i];
-
-                        id = map.put(id, id);
-
-                        assert id == null;
-                    }
-                }
-            });
-
-            ths[i].start();
-        }
-
-        System.out.println("Sleep");
-        Thread.sleep(10000);
-
-        System.out.println("Go");
-        barrier.await();
-
-        long start = System.currentTimeMillis();
-
-        for (Thread t : ths)
-            t.join();
-
-        long time = System.currentTimeMillis() - start;
-
-        System.out.println(time);
-    }
-
-    /**
-     * @throws BrokenBarrierException If failed.
-     * @throws InterruptedException If failed.
-     */
-    private static void doBenchmark() throws BrokenBarrierException, 
InterruptedException {
-        int attemts = 20;
-        int warmups = 10;
-
-        long snapTreeTime = 0;
-        long skipListTime = 0;
-
-        for (int i = 0; i < attemts; i++) {
-            ConcurrentNavigableMap<UUID, UUID> skipList = new 
ConcurrentSkipListMap<>();
-            ConcurrentNavigableMap<UUID, UUID> snapTree = new SnapTreeMap<>();
-
-            UUID[] ids = generate();
-
-            boolean warmup = i < warmups;
-
-            snapTreeTime += doTest(snapTree, ids, warmup);
-            skipListTime += doTest(skipList, ids, warmup);
-
-            assert skipList.size() == snapTree.size();
-
-            Iterator<UUID> snapIt = snapTree.keySet().iterator();
-            Iterator<UUID> listIt = skipList.keySet().iterator();
-
-            for (int x = 0, len = skipList.size(); x < len; x++)
-                assert snapIt.next() == listIt.next();
-
-            System.out.println(i + " ==================");
-        }
-
-        attemts -= warmups;
-
-        System.out.println("Avg for GridSnapTreeMap: " + (snapTreeTime / 
attemts) + " ms");
-        System.out.println("Avg for ConcurrentSkipListMap: " + (skipListTime / 
attemts) + " ms");
-     }
-
-    /**
-     * @return UUIDs.
-     */
-    private static UUID[] generate() {
-        UUID[] ids = new UUID[ITERATIONS * THREADS];
-
-        for (int i = 0; i < ids.length; i++)
-            ids[i] = UUID.randomUUID();
-
-        return ids;
-    }
-
-    /**
-     * @param tree Tree.
-     * @param data Data.
-     * @param warmup Warmup.
-     * @return Time.
-     * @throws BrokenBarrierException If failed.
-     * @throws InterruptedException If failed.
-     */
-    private static long doTest(final ConcurrentNavigableMap<UUID, UUID> tree, 
final UUID[] data, boolean warmup)
-        throws BrokenBarrierException, InterruptedException {
-        Thread[] ths = new Thread[THREADS];
-
-        final CyclicBarrier barrier = new CyclicBarrier(THREADS + 1);
-
-        final AtomicInteger cnt = new AtomicInteger();
-
-        for (int i = 0; i < ths.length; i++) {
-            ths[i] = new Thread(new Runnable() {
-                @Override public void run() {
-                    int off = cnt.getAndIncrement() * ITERATIONS;
-
-                    try {
-                        barrier.await();
-                    }
-                    catch (Exception e) {
-                        throw new IllegalStateException(e);
-                    }
-
-                    for (int i = 0; i < ITERATIONS; i++) {
-                        UUID id = data[off + i];
-
-                        id = tree.put(id, id);
-
-                        assert id == null;
-                    }
-                }
-            });
-
-            ths[i].start();
-        }
-
-        barrier.await();
-
-        long start = System.currentTimeMillis();
-
-        for (Thread t : ths)
-            t.join();
-
-        long time = System.currentTimeMillis() - start;
-
-        if (!warmup) {
-            System.out.println(tree.getClass().getSimpleName() + "  " + time + 
" ms");
-
-            return time;
-        }
-
-        return 0;
-    }
-}

Reply via email to