ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [50/50] ignite git commit: Merge remote-tracking branch 'remotes/community/ignite-db-x' into ignite-db-x-10884
Date Thu, 28 Apr 2016 08:53:20 GMT
Merge remote-tracking branch 'remotes/community/ignite-db-x' into ignite-db-x-10884

Conflicts:
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
	modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheH2DatabaseManager.java
	modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
	modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodePutGetSelfTest.java


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

Branch: refs/heads/ignite-db-x-10884
Commit: fc7e0630b1c3d4426152f6a77068f3a932523191
Parents: ce4698f 06feabe
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Apr 28 11:52:18 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Apr 28 11:52:18 2016 +0300

----------------------------------------------------------------------
 .../mem/unsafe/UnsafeMemoryProvider.java        |    1 +
 .../internal/pagemem/DirectMemoryUtils.java     |   10 +
 .../ignite/internal/pagemem/FullPageId.java     |   44 +-
 .../ignite/internal/pagemem/PageIdUtils.java    |   89 +-
 .../ignite/internal/pagemem/PageMemory.java     |    3 +-
 .../internal/pagemem/impl/FullPageIdTable.java  |  111 +-
 .../ignite/internal/pagemem/impl/PageImpl.java  |   23 +-
 .../internal/pagemem/impl/PageMemoryImpl.java   |  239 +++-
 .../processors/cache/database/MetaStore.java    |   39 +
 .../cache/database/MetadataStorage.java         |   49 +-
 .../processors/cache/database/RowStore.java     |   29 +-
 .../cache/database/freelist/FreeItem.java       |   48 +-
 .../cache/database/freelist/FreeList.java       |  147 +-
 .../cache/database/freelist/FreeTree.java       |   34 +-
 .../cache/database/freelist/io/FreeIO.java      |    8 +-
 .../cache/database/freelist/io/FreeInnerIO.java |   57 +-
 .../cache/database/freelist/io/FreeLeafIO.java  |   41 +-
 .../cache/database/tree/BPlusTree.java          | 1333 ++++++++++--------
 .../cache/database/tree/io/BPlusIO.java         |   23 +-
 .../cache/database/tree/io/BPlusInnerIO.java    |   34 +-
 .../cache/database/tree/io/BPlusLeafIO.java     |    9 +-
 .../cache/database/tree/io/BPlusMetaIO.java     |    8 +-
 .../cache/database/tree/io/DataPageIO.java      |   57 +-
 .../cache/database/tree/io/PageIO.java          |    4 +-
 .../cache/database/tree/reuse/ReuseBag.java     |   35 +
 .../cache/database/tree/reuse/ReuseList.java    |  101 +-
 .../cache/database/tree/reuse/ReuseTree.java    |   10 +-
 .../database/tree/reuse/io/ReuseInnerIO.java    |    6 +-
 .../database/tree/reuse/io/ReuseLeafIO.java     |   10 +-
 .../cache/database/tree/util/PageHandler.java   |    4 +-
 .../pagemem/impl/PageIdUtilsSelfTest.java       |   39 +
 .../processors/query/h2/database/H2Tree.java    |   14 +-
 .../query/h2/database/H2TreeIndex.java          |    5 +-
 .../query/h2/database/io/H2InnerIO.java         |    6 +-
 .../query/h2/database/io/H2LeafIO.java          |   10 +-
 .../database/BPlusTreeReuseSelfTest.java        |   34 +
 .../processors/database/BPlusTreeSelfTest.java  |  713 ++++++++++
 .../IgniteDbMultiNodePutGetSelfTest.java        |    5 +
 .../IgniteDbSingleNodePutGetSelfTest.java       |  123 +-
 .../database/MetadataStorageSelfTest.java       |    4 +-
 40 files changed, 2618 insertions(+), 941 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fc7e0630/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
index c9ae050,97ea6df..85562de
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
@@@ -53,22 -53,16 +53,22 @@@ public abstract class PageIO 
      public static final short T_H2_REF_INNER = 4;
  
      /** */
 -    public static final short T_FREE_LEAF = 5;
 +    public static final short T_DATA_REF_INNER = 5;
  
      /** */
 -    public static final short T_FREE_INNER = 6;
 +    public static final short T_DATA_REF_LEAF = 6;
  
      /** */
 -    public static final short T_REUSE_LEAF = 7;
 +    public static final short T_FREE_LEAF = 7;
  
      /** */
 -    public static final short T_REUSE_INNER = 8;
 +    public static final short T_FREE_INNER = 8;
 +
 +    /** */
 +    public static final short T_REUSE_LEAF = 9;
 +
 +    /** */
-     public static final short T_REUSE_INNER = 8;
++    public static final short T_REUSE_INNER = 10;
  
      /** */
      private final int ver;

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc7e0630/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc7e0630/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodePutGetSelfTest.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodePutGetSelfTest.java
index f83d050,99dc937..c50d012
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodePutGetSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodePutGetSelfTest.java
@@@ -15,8 -15,8 +15,9 @@@ import java.util.List
  import java.util.Map;
  import java.util.Random;
  import org.apache.ignite.IgniteCache;
+ import org.apache.ignite.IgniteDataStreamer;
  import org.apache.ignite.cache.CacheAtomicityMode;
 +import org.apache.ignite.cache.CachePeekMode;
  import org.apache.ignite.cache.CacheRebalanceMode;
  import org.apache.ignite.cache.CacheWriteSynchronizationMode;
  import org.apache.ignite.cache.query.SqlFieldsQuery;
@@@ -275,40 -274,120 +276,157 @@@ public class IgniteDbSingleNodePutGetSe
      /**
       * @throws Exception if failed.
       */
 +    public void testSizeClear() throws Exception {
 +        IgniteEx ig = grid(0);
 +
 +        final IgniteCache<Integer, DbValue> cache = ig.cache(null);
 +
 +        GridCacheAdapter<Object, Object> internalCache = ig.context().cache().internalCache();
 +
 +        int cnt = 5000;
 +
 +        X.println("Put start");
 +
 +        for (int i = 0; i < cnt; i++) {
 +            DbValue v0 = new DbValue(i, "test-value", i);
 +
 +            cache.put(i, v0);
 +
 +            checkEmpty(internalCache, i);
 +
 +            assertEquals(v0, cache.get(i));
 +        }
 +
 +        awaitPartitionMapExchange();
 +
 +        assertEquals(cnt, cache.size(CachePeekMode.OFFHEAP));
 +
 +        X.println("Clear start.");
 +
 +        cache.clear();
 +
 +        assertEquals(0, cache.size(CachePeekMode.OFFHEAP));
 +
 +        for (int i = 0; i < cnt; i++)
 +            assertNull(cache.get(i));
 +    }
++    /**
++     * @throws Exception if failed.
++     */
+     public void testBounds() throws Exception {
+         IgniteEx ig = grid(0);
+ 
+         final IgniteCache<Integer, DbValue> cache = ig.cache(null);
+ 
+         X.println("Put start");
+ 
+         int cnt = 1000;
+ 
+         try (IgniteDataStreamer<Integer, DbValue> st = ig.dataStreamer(null)) {
+             st.allowOverwrite(true);
+ 
+             for (int i = 0; i < cnt; i++) {
+                 int k = 2 * i;
+ 
+                 DbValue v0 = new DbValue(k, "test-value", k);
+ 
+                 st.addData(k, v0);
+             }
+         }
+ 
+         X.println("Get start");
+ 
+         for (int i = 0; i < cnt; i++) {
+             int k = 2 * i;
+ 
+             DbValue v0 = new DbValue(k, "test-value", k);
+ 
+             assertEquals(v0, cache.get(k));
+         }
+ 
+         awaitPartitionMapExchange();
+ 
+         X.println("Query start");
+ 
+         // Make sure to cover multiple pages.
+         int limit = 500;
+ 
+         for (int i = 0; i < limit; i++) {
+             List<List<?>> res = cache.query(new SqlFieldsQuery("select ival,
_val from dbvalue where ival < ? order by ival")
+                 .setArgs(i)).getAll();
+ 
+             // 0 => 0, 1 => 1, 2=>1,...
+             assertEquals((i + 1) / 2, res.size());
+ 
+             res = cache.query(new SqlFieldsQuery("select ival, _val from dbvalue where ival
<= ? order by ival")
+                 .setArgs(i)).getAll();
+ 
+             // 0 => 1, 1 => 1, 2=>2,...
+             assertEquals(i / 2 + 1, res.size());
+         }
+     }
+ 
+     /**
+      * @throws Exception if failed.
+      */
+     public void testMultithreadedPut() throws Exception {
+         IgniteEx ig = grid(0);
+ 
+         final IgniteCache<Integer, DbValue> cache = ig.cache(null);
+ 
+         X.println("Put start");
+ 
+         int cnt = 20_000;
+ 
+         try (IgniteDataStreamer<Integer, DbValue> st = ig.dataStreamer(null)) {
+             st.allowOverwrite(true);
+ 
+             for (int i = 0; i < cnt; i++) {
+                 DbValue v0 = new DbValue(i, "test-value", i);
+ 
+                 st.addData(i, v0);
+             }
+         }
+ 
+         X.println("Get start");
+ 
+         for (int i = 0; i < cnt; i++) {
+             DbValue v0 = new DbValue(i, "test-value", i);
+ 
+             assertEquals(v0, cache.get(i));
+         }
+ 
+         awaitPartitionMapExchange();
+ 
+         X.println("Query start");
+ 
+         assertEquals(cnt, cache.query(new SqlFieldsQuery("select null from dbvalue")).getAll().size());
+ 
+         int limit = 500;
+ 
+         List<List<?>> res = cache.query(new SqlFieldsQuery("select ival, _val
from dbvalue where ival < ? order by ival")
+             .setArgs(limit)).getAll();
+ 
+         assertEquals(limit, res.size());
+ 
+         for (int i = 0; i < limit; i++) {
+             List<?> row = res.get(i);
+ 
+             assertEquals(2, row.size());
+             assertEquals(i, row.get(0));
+ 
+             assertEquals(new DbValue(i, "test-value", i), row.get(1));
+         }
+ 
+         assertEquals(1, cache.query(new SqlFieldsQuery("select lval from dbvalue where ival
= 7899")).getAll().size());
+         assertEquals(2000, cache.query(new SqlFieldsQuery("select lval from dbvalue where
ival >= 5000 and ival < 7000"))
+             .getAll().size());
+ 
+         String plan = cache.query(new SqlFieldsQuery(
+             "explain select lval from dbvalue where ival >= 5000 and ival < 7000")).getAll().get(0).get(0).toString();
+ 
+         assertTrue(plan, plan.contains("iVal_idx"));
+     }
  
      /**
       * @throws Exception if failed.


Mime
View raw message