ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-5075
Date Tue, 23 May 2017 13:22:07 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5075-pds 92346eb86 -> ca57919da


ignite-5075


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

Branch: refs/heads/ignite-5075-pds
Commit: ca57919da536bace707eb1cc140a75f507a460de
Parents: 92346eb
Author: sboikov <sboikov@gridgain.com>
Authored: Tue May 23 16:22:01 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue May 23 16:22:01 2017 +0300

----------------------------------------------------------------------
 .../cache/database/MetadataStorage.java         | 20 +++++------
 .../processors/query/h2/database/H2Tree.java    |  6 ++--
 .../query/h2/database/H2TreeIndex.java          |  7 ++--
 ...tentStoreMultiNodePutGetRestartSelfTest.java |  2 --
 ...dexingAndGroupPutGetPersistenceSelfTest.java | 35 ++++++++++++++++++++
 .../ignite/testsuites/IgnitePdsTestSuite.java   |  2 ++
 6 files changed, 53 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ca57919d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
index ca4ad05..20123f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
@@ -53,8 +53,8 @@ public class MetadataStorage implements MetaStore {
     /** Meta page reuse tree. */
     private final ReuseList reuseList;
 
-    /** Cache ID. */
-    private final int cacheId;
+    /** Cache group ID. */
+    private final int grpId;
 
     /** */
     private final int allocPartId;
@@ -70,7 +70,7 @@ public class MetadataStorage implements MetaStore {
         final PageMemory pageMem,
         final IgniteWriteAheadLogManager wal,
         final AtomicLong globalRmvId,
-        final int cacheId,
+        final int grpId,
         final int allocPartId,
         final byte allocSpace,
         final ReuseList reuseList,
@@ -79,12 +79,12 @@ public class MetadataStorage implements MetaStore {
     ) {
         try {
             this.pageMem = pageMem;
-            this.cacheId = cacheId;
+            this.grpId = grpId;
             this.allocPartId = allocPartId;
             this.allocSpace = allocSpace;
             this.reuseList = reuseList;
 
-            metaTree = new MetaTree(cacheId, allocPartId, allocSpace, pageMem, wal, globalRmvId,
rootPageId,
+            metaTree = new MetaTree(grpId, allocPartId, allocSpace, pageMem, wal, globalRmvId,
rootPageId,
                 reuseList, MetaStoreInnerIO.VERSIONS, MetaStoreLeafIO.VERSIONS, initNew);
         }
         catch (IgniteCheckedException e) {
@@ -111,14 +111,14 @@ public class MetadataStorage implements MetaStore {
                 if (reuseList != null)
                     pageId = reuseList.takeRecycledPage();
 
-                pageId = pageId == 0 ? pageMem.allocatePage(cacheId, allocPartId, allocSpace)
: pageId;
+                pageId = pageId == 0 ? pageMem.allocatePage(grpId, allocPartId, allocSpace)
: pageId;
 
                 tree.put(new IndexItem(idxNameBytes, pageId));
 
-                return new RootPage(new FullPageId(pageId, cacheId), true);
+                return new RootPage(new FullPageId(pageId, grpId), true);
             }
             else {
-                final FullPageId pageId = new FullPageId(row.pageId, cacheId);
+                final FullPageId pageId = new FullPageId(row.pageId, grpId);
 
                 return new RootPage(pageId, false);
             }
@@ -134,10 +134,10 @@ public class MetadataStorage implements MetaStore {
 
         if (row != null) {
             if (reuseList == null)
-                pageMem.freePage(cacheId, row.pageId);
+                pageMem.freePage(grpId, row.pageId);
         }
 
-        return row != null ? new RootPage(new FullPageId(row.pageId, cacheId), false) : null;
+        return row != null ? new RootPage(new FullPageId(row.pageId, grpId), false) : null;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca57919d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
index f673717..f2b8bad 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
@@ -63,7 +63,7 @@ public abstract class H2Tree extends BPlusTree<SearchRow, GridH2Row>
{
     /**
      * @param name Tree name.
      * @param reuseList Reuse list.
-     * @param cacheId Cache ID.
+     * @param grpId Cache group ID.
      * @param pageMem Page memory.
      * @param wal Write ahead log manager.
      * @param rowStore Row data store.
@@ -74,7 +74,7 @@ public abstract class H2Tree extends BPlusTree<SearchRow, GridH2Row>
{
     protected H2Tree(
         String name,
         ReuseList reuseList,
-        int cacheId,
+        int grpId,
         PageMemory pageMem,
         IgniteWriteAheadLogManager wal,
         AtomicLong globalRmvId,
@@ -85,7 +85,7 @@ public abstract class H2Tree extends BPlusTree<SearchRow, GridH2Row>
{
         List<InlineIndexHelper> inlineIdxs,
         int inlineSize
     ) throws IgniteCheckedException {
-        super(name, cacheId, pageMem, wal, globalRmvId, metaPageId, reuseList);
+        super(name, grpId, pageMem, wal, globalRmvId, metaPageId, reuseList);
 
         if (!initNew) {
             // Page is ready - read inline size from it.

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca57919d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
index 58ab32d..ceb4255 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
@@ -100,8 +100,6 @@ public class H2TreeIndex extends GridH2IndexBase {
         name = BPlusTree.treeName(name, "H2Tree");
 
         if (cctx.affinityNode()) {
-            IgniteCacheDatabaseSharedManager dbMgr = cctx.shared().database();
-
             inlineIdxs = getAvailableInlineColumns(cols);
 
             segments = new H2Tree[segmentsCnt];
@@ -110,8 +108,9 @@ public class H2TreeIndex extends GridH2IndexBase {
                 RootPage page = getMetaPage(name, i);
 
                 segments[i] = new H2Tree(
-                    name,cctx.offheap().reuseListForIndex(name),
-                    cctx.cacheId(),
+                    name,
+                    cctx.offheap().reuseListForIndex(name),
+                    cctx.groupId(),
                     cctx.memoryPolicy().pageMemory(),
                     cctx.shared().wal(),
                     cctx.offheap().globalRemoveId(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca57919d/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
index d67aafe..4bcef98 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
@@ -132,8 +132,6 @@ public class IgnitePersistentStoreMultiNodePutGetRestartSelfTest extends
GridCom
      * @throws Exception if failed.
      */
     public void testPutGetSimple() throws Exception {
-
-
         info(">>> Will use path: " + allocPath);
 
         startGrids(GRID_CNT);

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca57919d/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest.java
b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest.java
new file mode 100644
index 0000000..ed011ac
--- /dev/null
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * 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.cache.database;
+
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+
+/**
+ *
+ */
+public class IgnitePersistentStoreSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest
+    extends IgnitePersistentStoreSingleNodeWithIndexingPutGetPersistenceSelfTest {
+    /** {@inheritDoc} */
+    @Override protected void configure(IgniteConfiguration cfg) {
+        super.configure(cfg);
+
+        for (CacheConfiguration ccfg : cfg.getCacheConfiguration())
+            ccfg.setGroupName("testGroup");
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca57919d/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
index c781176..d38d403 100644
--- a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
+++ b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cache.database.IgnitePersistentStoreCacheGroupsTest;
 import org.apache.ignite.cache.database.IgnitePersistentStoreClientNearCachePutGetWithPersistenceSelfTest;
 import org.apache.ignite.cache.database.IgnitePersistentStoreDynamicCacheTest;
 import org.apache.ignite.cache.database.IgnitePersistentStoreSingleNodePutGetPersistenceSelfTest;
+import org.apache.ignite.cache.database.IgnitePersistentStoreSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest;
 import org.apache.ignite.cache.database.IgnitePersistentStoreSingleNodeWithIndexingPutGetPersistenceSelfTest;
 import org.apache.ignite.cache.database.db.IgniteDbMultiNodePutGetRestartSelfTest;
 import org.apache.ignite.cache.database.db.IgniteDbPageEvictionSelfTest;
@@ -81,6 +82,7 @@ public class IgnitePdsTestSuite extends TestSuite {
         suite.addTestSuite(IgniteDbMultiNodePutGetRestartSelfTest.class);
         suite.addTestSuite(IgnitePersistentStoreSingleNodePutGetPersistenceSelfTest.class);
         suite.addTestSuite(IgnitePersistentStoreSingleNodeWithIndexingPutGetPersistenceSelfTest.class);
+        suite.addTestSuite(IgnitePersistentStoreSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest.class);
         suite.addTestSuite(IgniteDbPageEvictionSelfTest.class);
         suite.addTestSuite(IgnitePersistentStoreDynamicCacheTest.class);
         suite.addTestSuite(IgniteWalDirectoriesConfigurationTest.class);


Mime
View raw message