You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/06 11:19:36 UTC
[01/10] ignite git commit: Merge mistake was corrected,
obsolete tests were removed
Repository: ignite
Updated Branches:
refs/heads/ignite-4811-no-start-ver 112695b61 -> 1f9631e9f
Merge mistake was corrected, obsolete tests were removed
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b127153b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b127153b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b127153b
Branch: refs/heads/ignite-4811-no-start-ver
Commit: b127153b2d2733aab1881b056d2dd2bd7f374d81
Parents: 481f021
Author: Sergey Chugunov <se...@gmail.com>
Authored: Mon Apr 3 18:29:52 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Mon Apr 3 18:29:52 2017 +0300
----------------------------------------------------------------------
...ryDuplicateIndexObjectsAbstractSelfTest.java | 161 -------------------
...ateIndexObjectPartitionedAtomicSelfTest.java | 38 -----
...xObjectPartitionedTransactionalSelfTest.java | 41 -----
.../processors/query/h2/IgniteH2Indexing.java | 8 +-
.../IgniteBinaryCacheQueryTestSuite.java | 5 -
5 files changed, 4 insertions(+), 249 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b127153b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
deleted file mode 100644
index ccfe68b..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
+++ /dev/null
@@ -1,161 +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.internal.processors.cache.binary;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheTypeMetadata;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- * Tests that binary object is the same in cache entry and in index.
- */
-public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends GridCacheAbstractSelfTest {
- /** {@inheritDoc} */
- @Override protected int gridCount() {
- return 1;
- }
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
- BinaryConfiguration bCfg = new BinaryConfiguration();
-
- bCfg.setClassNames(Collections.singletonList(TestBinary.class.getName()));
-
- cfg.setBinaryConfiguration(bCfg);
-
- cfg.setMarshaller(new BinaryMarshaller());
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
- CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName);
-
- ccfg.setCopyOnRead(false);
-
- CacheTypeMetadata meta = new CacheTypeMetadata();
-
- meta.setKeyType(Integer.class);
- meta.setValueType(TestBinary.class.getName());
-
- Map<String, Class<?>> idx = new HashMap<>();
-
- idx.put("fieldOne", String.class);
- idx.put("fieldTwo", Integer.class);
-
- meta.setAscendingFields(idx);
-
- ccfg.setTypeMetadata(Collections.singletonList(meta));
-
- return ccfg;
- }
-
- /** {@inheritDoc} */
- @Override public abstract CacheAtomicityMode atomicityMode();
-
- /** {@inheritDoc} */
- @Override public abstract CacheMode cacheMode();
-
- /**
- * @throws Exception If failed.
- */
- public void testIndexReferences() throws Exception {
- IgniteCache<Integer, TestBinary> cache = grid(0).cache(null);
-
- String fieldOneVal = "123";
- int fieldTwoVal = 123;
- int key = 0;
-
- cache.put(key, new TestBinary(fieldOneVal, fieldTwoVal));
-
- IgniteCache<Integer, BinaryObject> prj = grid(0).cache(null).withKeepBinary();
-
- BinaryObject cacheVal = prj.get(key);
-
- assertEquals(fieldOneVal, cacheVal.field("fieldOne"));
- assertEquals(new Integer(fieldTwoVal), cacheVal.field("fieldTwo"));
-
- List<?> row = F.first(prj.query(new SqlFieldsQuery("select _val from " +
- "TestBinary where _key = ?").setArgs(key)).getAll());
-
- assertEquals(1, row.size());
-
- BinaryObject qryVal = (BinaryObject)row.get(0);
-
- assertEquals(fieldOneVal, qryVal.field("fieldOne"));
- assertEquals(new Integer(fieldTwoVal), qryVal.field("fieldTwo"));
- assertSame(cacheVal, qryVal);
- }
-
- /**
- * Test binary object.
- */
- private static class TestBinary {
- /** */
- private String fieldOne;
-
- /** */
- private int fieldTwo;
-
- /**
- *
- */
- private TestBinary() {
- // No-op.
- }
-
- /**
- * @param fieldOne Field one.
- * @param fieldTwo Field two.
- */
- private TestBinary(String fieldOne, int fieldTwo) {
- this.fieldOne = fieldOne;
- this.fieldTwo = fieldTwo;
- }
-
- /**
- * @return Field one.
- */
- public String fieldOne() {
- return fieldOne;
- }
-
- /**
- * @return Field two.
- */
- public int fieldTwo() {
- return fieldTwo;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b127153b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java
deleted file mode 100644
index 459d0ee..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java
+++ /dev/null
@@ -1,38 +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.internal.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.internal.processors.cache.binary.GridBinaryDuplicateIndexObjectsAbstractSelfTest;
-
-/**
- * Test PARTITIONED ATOMIC.
- */
-public class GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest extends
- GridBinaryDuplicateIndexObjectsAbstractSelfTest {
- /** {@inheritDoc} */
- @Override public CacheAtomicityMode atomicityMode() {
- return CacheAtomicityMode.ATOMIC;
- }
-
- /** {@inheritDoc} */
- @Override public CacheMode cacheMode() {
- return CacheMode.PARTITIONED;
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b127153b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java
deleted file mode 100644
index e319fe4..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java
+++ /dev/null
@@ -1,41 +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.internal.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.internal.processors.cache.binary.GridBinaryDuplicateIndexObjectsAbstractSelfTest;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
-/**
- * Test PARTITIONED and TRANSACTIONAL.
- */
-public class GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest extends
- GridBinaryDuplicateIndexObjectsAbstractSelfTest {
- /** {@inheritDoc} */
- @Override public CacheAtomicityMode atomicityMode() {
- return TRANSACTIONAL;
- }
-
- /** {@inheritDoc} */
- @Override public CacheMode cacheMode() {
- return PARTITIONED;
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b127153b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index b99f52b..725e742 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -3470,10 +3470,10 @@ public class IgniteH2Indexing implements GridQueryIndexing {
try {
if (val == null) // Only can happen for remove operation, can create simple search row.
row = GridH2RowFactory.create(wrap(key, keyType));
-
- row = schema.offheap == null ?
- new GridH2KeyValueRowOnheap(this, key, keyType, val, valType, expirationTime) :
- new GridH2KeyValueRowOffheap(this, key, keyType, val, valType, expirationTime);
+ else
+ row = schema.offheap == null ?
+ new GridH2KeyValueRowOnheap(this, key, keyType, val, valType, expirationTime) :
+ new GridH2KeyValueRowOffheap(this, key, keyType, val, valType, expirationTime);
}
catch (ClassCastException e) {
throw new IgniteCheckedException("Failed to convert key to SQL type. " +
http://git-wip-us.apache.org/repos/asf/ignite/blob/b127153b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
index 3cb603c..5826b72 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
@@ -22,8 +22,6 @@ import org.apache.ignite.internal.binary.BinaryMarshaller;
import org.apache.ignite.internal.processors.cache.BinarySerializationQuerySelfTest;
import org.apache.ignite.internal.processors.cache.BinarySerializationQueryWithReflectiveSerializerSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheBinaryObjectsScanSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest;
import org.apache.ignite.testframework.config.GridTestProperties;
/**
@@ -47,9 +45,6 @@ public class IgniteBinaryCacheQueryTestSuite extends TestSuite {
//Should be adjusted. Not ready to be used with BinaryMarshaller.
//suite.addTestSuite(GridCacheBinarySwapScanQuerySelfTest.class);
- suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.class);
- suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.class);
-
//TODO: the following tests= was never tested with binary. Exclude or pass?
// suite.addTestSuite(IgniteSqlSchemaIndexingTest.class);
[03/10] ignite git commit: Merge branch 'ignite-3477-master' of
https://github.com/gridgain/apache-ignite into ignite-3477-master
Posted by sb...@apache.org.
Merge branch 'ignite-3477-master' of https://github.com/gridgain/apache-ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dce205fe
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dce205fe
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dce205fe
Branch: refs/heads/ignite-4811-no-start-ver
Commit: dce205fe288e048707596bb0b467fe562e93e845
Parents: 281efd4 b127153
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Mon Apr 3 19:20:41 2017 +0300
Committer: Ilya Lantukh <il...@gridgain.com>
Committed: Mon Apr 3 19:20:41 2017 +0300
----------------------------------------------------------------------
...ryDuplicateIndexObjectsAbstractSelfTest.java | 161 -------------------
...ateIndexObjectPartitionedAtomicSelfTest.java | 38 -----
...xObjectPartitionedTransactionalSelfTest.java | 41 -----
.../processors/query/h2/IgniteH2Indexing.java | 8 +-
.../IgniteBinaryCacheQueryTestSuite.java | 5 -
5 files changed, 4 insertions(+), 249 deletions(-)
----------------------------------------------------------------------
[06/10] ignite git commit: review
Posted by sb...@apache.org.
review
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3ed1cbf6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3ed1cbf6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3ed1cbf6
Branch: refs/heads/ignite-4811-no-start-ver
Commit: 3ed1cbf64bbf3d994f071c19db638e4542c515c3
Parents: 6495975
Author: Igor Seliverstov <gv...@gmail.com>
Authored: Wed Apr 5 17:48:24 2017 +0300
Committer: Igor Seliverstov <gv...@gmail.com>
Committed: Wed Apr 5 17:48:24 2017 +0300
----------------------------------------------------------------------
.../cache/database/freelist/FreeListImpl.java | 9 +-
.../cache/database/freelist/PagesList.java | 114 ++++++++++---------
2 files changed, 62 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3ed1cbf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
index 8ca95f0..b74c85e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
@@ -58,9 +58,6 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
private static final Long FAIL_L = Long.MAX_VALUE;
/** */
- private static final Boolean FAIL_B = null;
-
- /** */
private static final int MIN_PAGE_FREE_SPACE = 8;
/** */
@@ -437,7 +434,7 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
boolean allocated = pageId == 0L;
- if(allocated)
+ if (allocated)
pageId = allocateDataPage(row.partition());
DataPageIO init = reuseBucket || allocated ? DataPageIO.VERSIONS.latest() : null;
@@ -456,9 +453,9 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
long pageId = PageIdUtils.pageId(link);
int itemId = PageIdUtils.itemId(link);
- Boolean updated = write(pageId, updateRow, row, itemId, FAIL_B);
+ Boolean updated = write(pageId, updateRow, row, itemId, null);
- assert updated != FAIL_B; // Can't fail here.
+ assert updated != null; // Can't fail here.
return updated;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/3ed1cbf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
index 4cf38ba..98a55bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
@@ -272,13 +272,13 @@ public abstract class PagesList extends DataStructure {
int tailIdx = 0;
while (tailIdx < tails.length) {
- int written = curAddr != 0L ? curIo.addTails(pageMem.pageSize(), curAddr, bucket, tails, tailIdx) : 0;
+ int written = curPage != 0L ? curIo.addTails(pageMem.pageSize(), curAddr, bucket, tails, tailIdx) : 0;
if (written == 0) {
if (nextPageId == 0L) {
nextPageId = allocatePageNoReuse();
- if (curAddr != 0L) {
+ if (curPage != 0L) {
curIo.setNextMetaPageId(curAddr, nextPageId);
releaseAndClose(curId, curPage, curAddr);
@@ -350,7 +350,7 @@ public abstract class PagesList extends DataStructure {
* @throws IgniteCheckedException If failed.
*/
private void releaseAndClose(long pageId, long page, long pageAddr) throws IgniteCheckedException {
- if (pageAddr != 0L && page != 0L) {
+ if (page != 0L) {
try {
// No special WAL record because we most likely changed the whole page.
writeUnlock(pageId, page, pageAddr, TRUE, true);
@@ -821,7 +821,7 @@ public abstract class PagesList extends DataStructure {
Boolean walPlc = null;
- List<long[]> locked = null; // TODO may be unlock right away and do not keep all these pages locked?
+ GridLongList locked = null; // TODO may be unlock right away and do not keep all these pages locked?
try {
while ((nextId = bag.pollFreePage()) != 0L) {
@@ -837,10 +837,12 @@ public abstract class PagesList extends DataStructure {
assert nextPageAddr != 0L;
if (locked == null) {
- locked = new ArrayList<>(2);
+ locked = new GridLongList(6);
}
- locked.add(new long[]{nextId, nextPage, nextPageAddr});
+ locked.add(nextId);
+ locked.add(nextPage);
+ locked.add(nextPageAddr);
setupNextPage(io, prevId, prevAddr, nextId, nextPageAddr);
@@ -848,7 +850,7 @@ public abstract class PagesList extends DataStructure {
wal.log(new PagesListSetNextRecord(cacheId, prevId, nextId));
// Here we should never write full page, because it is known to be new.
- if (needWalDeltaRecord(nextId, nextPage, walPlc = FALSE))
+ if (needWalDeltaRecord(nextId, nextPage, FALSE))
wal.log(new PagesListInitNewPageRecord(
cacheId,
nextId,
@@ -868,6 +870,9 @@ public abstract class PagesList extends DataStructure {
prevAddr = nextPageAddr;
prevId = nextId;
prevPage = nextPage;
+ // Starting from tis point all wal records are written for reused pages from the bag.
+ // This mean that we use delta records only.
+ walPlc = FALSE;
}
finally {
releasePage(nextId, nextPage);
@@ -888,9 +893,8 @@ public abstract class PagesList extends DataStructure {
updateTail(bucket, pageId, prevId);
// Release write.
- for (int i = 0; i < locked.size(); i++) {
- long[] vals = locked.get(i);
- writeUnlock(vals[0], vals[1], vals[2], FALSE, true);
+ for (int i = 0; i < locked.size(); i+=3) {
+ writeUnlock(locked.get(i), locked.get(i + 1), locked.get(i + 2), FALSE, true);
}
}
}
@@ -1008,7 +1012,7 @@ public abstract class PagesList extends DataStructure {
assert PageIO.getType(tailAddr) == PageIO.T_PAGE_LIST_NODE;
boolean dirty = false;
- long ret;
+ long dataPageId;
long recycleId = 0L;
try {
@@ -1029,7 +1033,7 @@ public abstract class PagesList extends DataStructure {
dirty = true;
- ret = pageId;
+ dataPageId = pageId;
if (io.isEmpty(tailAddr)) {
long prevId = io.getPreviousId(tailAddr);
@@ -1068,19 +1072,19 @@ public abstract class PagesList extends DataStructure {
bucketsSize[bucket].decrementAndGet();
if (initIoVers != null) {
- ret = PageIdUtils.changeType(tailId, FLAG_DATA);
+ dataPageId = PageIdUtils.changeType(tailId, FLAG_DATA);
PageIO initIo = initIoVers.latest();
- initIo.initNewPage(tailAddr, ret, pageSize());
+ initIo.initNewPage(tailAddr, dataPageId, pageSize());
if (needWalDeltaRecord(tailId, tailPage, null)) {
wal.log(new InitNewPageRecord(cacheId, tailId, initIo.getType(),
- initIo.getVersion(), ret));
+ initIo.getVersion(), dataPageId));
}
}
else
- ret = recyclePage(tailId, tailPage, tailAddr, null);
+ dataPageId = recyclePage(tailId, tailPage, tailAddr, null);
dirty = true;
}
@@ -1101,7 +1105,7 @@ public abstract class PagesList extends DataStructure {
reuseList.addForRecycle(new SingletonReuseBag(recycleId));
}
- return ret;
+ return dataPageId;
}
finally {
releasePage(tailId, tailPage);
@@ -1196,6 +1200,43 @@ public abstract class PagesList extends DataStructure {
/**
* @param pageId Page ID.
* @param page Page pointer.
+ * @param pageAddr Page address.
+ * @param prevId Previous page ID.
+ * @param bucket Bucket index.
+ * @return Page ID to recycle.
+ * @throws IgniteCheckedException If failed.
+ */
+ private long mergeNoNext(
+ long pageId,
+ long page,
+ long pageAddr,
+ long prevId,
+ int bucket)
+ throws IgniteCheckedException {
+ // If we do not have a next page (we are tail) and we are on reuse bucket,
+ // then we can leave as is as well, because it is normal to have an empty tail page here.
+ if (isReuseBucket(bucket))
+ return 0L;
+
+ if (prevId != 0L) { // Cut tail if we have a previous page.
+ Boolean ok = write(prevId, cutTail, null, bucket, FALSE);
+
+ assert ok == TRUE: ok;
+ }
+ else {
+ // If we don't have a previous, then we are tail page of free list, just drop the stripe.
+ boolean rmvd = updateTail(bucket, pageId, 0L);
+
+ if (!rmvd)
+ return 0L;
+ }
+
+ return recyclePage(pageId, page, pageAddr, null);
+ }
+
+ /**
+ * @param pageId Page ID.
+ * @param page Page pointer.
* @param nextId Next page ID.
* @param bucket Bucket index.
* @return Page ID to recycle.
@@ -1252,7 +1293,7 @@ public abstract class PagesList extends DataStructure {
}
}
finally {
- if(curPage != 0L)
+ if (curPage != 0L)
releasePage(curId, curPage);
}
}
@@ -1260,43 +1301,6 @@ public abstract class PagesList extends DataStructure {
/**
* @param pageId Page ID.
- * @param page Page pointer.
- * @param pageAddr Page address.
- * @param prevId Previous page ID.
- * @param bucket Bucket index.
- * @return Page ID to recycle.
- * @throws IgniteCheckedException If failed.
- */
- private long mergeNoNext(
- long pageId,
- long page,
- long pageAddr,
- long prevId,
- int bucket)
- throws IgniteCheckedException {
- // If we do not have a next page (we are tail) and we are on reuse bucket,
- // then we can leave as is as well, because it is normal to have an empty tail page here.
- if (isReuseBucket(bucket))
- return 0L;
-
- if (prevId != 0L) { // Cut tail if we have a previous page.
- Boolean ok = write(prevId, cutTail, null, bucket, FALSE);
-
- assert ok == TRUE: ok;
- }
- else {
- // If we don't have a previous, then we are tail page of free list, just drop the stripe.
- boolean rmvd = updateTail(bucket, pageId, 0L);
-
- if (!rmvd)
- return 0L;
- }
-
- return recyclePage(pageId, page, pageAddr, null);
- }
-
- /**
- * @param pageId Page ID.
* @param page Page absolute pointer.
* @param pageAddr Page address.
* @param io IO.
[08/10] ignite git commit: Merge branch 'ignite-3477-master' of
https://github.com/gridgain/apache-ignite into ignite-3477-master
Posted by sb...@apache.org.
Merge branch 'ignite-3477-master' of https://github.com/gridgain/apache-ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6d0a419c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6d0a419c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6d0a419c
Branch: refs/heads/ignite-4811-no-start-ver
Commit: 6d0a419c4aa18d299865a745c25a32c168d3566e
Parents: b7aaf3e dbe7782
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 6 10:31:47 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 6 10:31:47 2017 +0300
----------------------------------------------------------------------
.../processors/cache/H2CacheStoreStrategy.java | 2 +-
...ryDuplicateIndexObjectsAbstractSelfTest.java | 161 -------------------
...ateIndexObjectPartitionedAtomicSelfTest.java | 38 -----
...xObjectPartitionedTransactionalSelfTest.java | 41 -----
...eRebalancingUnmarshallingFailedSelfTest.java | 6 +-
...IgniteCacheFullApiMultiJvmSelfTestSuite.java | 2 +
.../processors/query/h2/IgniteH2Indexing.java | 8 +-
.../IgniteBinaryCacheQueryTestSuite.java | 5 -
8 files changed, 12 insertions(+), 251 deletions(-)
----------------------------------------------------------------------
[09/10] ignite git commit: Merge branch 'ignite-3477-master' into
ignite-4811
Posted by sb...@apache.org.
Merge branch 'ignite-3477-master' into ignite-4811
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/43098a43
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/43098a43
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/43098a43
Branch: refs/heads/ignite-4811-no-start-ver
Commit: 43098a43e06cebe00b0fc8deb09922c4047121b8
Parents: e8b9747 6d0a419
Author: Igor Seliverstov <gv...@gmail.com>
Authored: Thu Apr 6 13:14:22 2017 +0300
Committer: Igor Seliverstov <gv...@gmail.com>
Committed: Thu Apr 6 13:14:22 2017 +0300
----------------------------------------------------------------------
.../processors/cache/H2CacheStoreStrategy.java | 2 +-
...ryDuplicateIndexObjectsAbstractSelfTest.java | 161 -------------------
...ateIndexObjectPartitionedAtomicSelfTest.java | 38 -----
...xObjectPartitionedTransactionalSelfTest.java | 41 -----
...eRebalancingUnmarshallingFailedSelfTest.java | 6 +-
...IgniteCacheFullApiMultiJvmSelfTestSuite.java | 2 +
.../processors/query/h2/IgniteH2Indexing.java | 8 +-
.../IgniteBinaryCacheQueryTestSuite.java | 5 -
modules/yardstick/config/ignite-base-config.xml | 2 -
.../config/ignite-failover-base-config.xml | 6 -
.../ignite-int-max-values-offheap-config.xml | 1 -
.../ignite-int-max-values-onheap-config.xml | 1 -
.../yardstick/config/ignite-store-config.xml | 2 -
13 files changed, 12 insertions(+), 263 deletions(-)
----------------------------------------------------------------------
[05/10] ignite git commit: increase number of JDBC connections for
MultiJvm suite
Posted by sb...@apache.org.
increase number of JDBC connections for MultiJvm suite
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dbe7782f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dbe7782f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dbe7782f
Branch: refs/heads/ignite-4811-no-start-ver
Commit: dbe7782fa6c718f60f2fdcea51b23e4213916f99
Parents: dce205f
Author: Konstantin Dudkov <kd...@ya.ru>
Authored: Wed Apr 5 17:33:45 2017 +0300
Committer: Konstantin Dudkov <kd...@ya.ru>
Committed: Wed Apr 5 17:33:45 2017 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/cache/H2CacheStoreStrategy.java | 2 +-
.../ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/dbe7782f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
index ccb2994..0167b7d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
@@ -265,7 +265,7 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
*/
static JdbcConnectionPool createDataSource() {
JdbcConnectionPool pool = JdbcConnectionPool.create("jdbc:h2:tcp://localhost/mem:TestDb;LOCK_MODE=0", "sa", "");
- pool.setMaxConnections(100);
+ pool.setMaxConnections(Integer.getInteger("H2_JDBC_CONNECTIONS", 100));
return pool;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/dbe7782f/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java
index 584916a..b621ce5 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java
@@ -71,6 +71,8 @@ public class IgniteCacheFullApiMultiJvmSelfTestSuite extends TestSuite {
public static TestSuite suite() throws Exception {
TestSuite suite = new TestSuite("Cache Full API Multi Jvm Test Suite");
+ System.setProperty("H2_JDBC_CONNECTIONS", "500");
+
// Multi-node.
suite.addTestSuite(GridCacheReplicatedMultiJvmFullApiSelfTest.class);
suite.addTestSuite(GridCacheReplicatedMultiJvmP2PDisabledFullApiSelfTest.class);
[10/10] ignite git commit: Merge remote-tracking branch
'remotes/community/ignite-4811' into ignite-4811-no-start-ver
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/community/ignite-4811' into ignite-4811-no-start-ver
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1f9631e9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1f9631e9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1f9631e9
Branch: refs/heads/ignite-4811-no-start-ver
Commit: 1f9631e9f1f830e38596c89b570606c5ef1739c4
Parents: 112695b 43098a4
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 6 14:12:43 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 6 14:12:43 2017 +0300
----------------------------------------------------------------------
.../cache/database/freelist/FreeListImpl.java | 9 +-
.../cache/database/freelist/PagesList.java | 114 ++++++-------
.../cache/database/tree/BPlusTree.java | 49 +++---
.../processors/cache/H2CacheStoreStrategy.java | 2 +-
...ryDuplicateIndexObjectsAbstractSelfTest.java | 161 -------------------
...ateIndexObjectPartitionedAtomicSelfTest.java | 38 -----
...xObjectPartitionedTransactionalSelfTest.java | 41 -----
...eRebalancingUnmarshallingFailedSelfTest.java | 6 +-
...IgniteCacheFullApiMultiJvmSelfTestSuite.java | 2 +
.../processors/query/h2/IgniteH2Indexing.java | 8 +-
.../IgniteBinaryCacheQueryTestSuite.java | 5 -
.../config/ignite-failover-base-config.xml | 6 -
.../ignite-int-max-values-offheap-config.xml | 1 -
.../ignite-int-max-values-onheap-config.xml | 1 -
.../yardstick/config/ignite-store-config.xml | 2 -
15 files changed, 97 insertions(+), 348 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1f9631e9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
----------------------------------------------------------------------
[02/10] ignite git commit: Fixed
GridCacheRebalancingUnmarshallingFailedSelfTest.
Posted by sb...@apache.org.
Fixed GridCacheRebalancingUnmarshallingFailedSelfTest.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/281efd4b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/281efd4b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/281efd4b
Branch: refs/heads/ignite-4811-no-start-ver
Commit: 281efd4b9f0577d55260c7ea53c450e6182085c6
Parents: b6c1761
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Mon Apr 3 19:19:30 2017 +0300
Committer: Ilya Lantukh <il...@gridgain.com>
Committed: Mon Apr 3 19:19:30 2017 +0300
----------------------------------------------------------------------
.../GridCacheRebalancingUnmarshallingFailedSelfTest.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/281efd4b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingUnmarshallingFailedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingUnmarshallingFailedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingUnmarshallingFailedSelfTest.java
index 6d3f707..d745dcd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingUnmarshallingFailedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingUnmarshallingFailedSelfTest.java
@@ -32,6 +32,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.config.GridTestProperties;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.thread.IgniteThread;
/**
*
@@ -90,7 +91,10 @@ public class GridCacheRebalancingUnmarshallingFailedSelfTest extends GridCommonA
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
field = (String)in.readObject();
- if (readCnt.decrementAndGet() <= 0)
+ Thread cur = Thread.currentThread();
+
+ // Decrement readCnt and fail only on node with index 1.
+ if (cur instanceof IgniteThread && ((IgniteThread)cur).getIgniteInstanceName().endsWith("1") && readCnt.decrementAndGet() <= 0)
throw new IOException("Class can not be unmarshalled.");
}
}
[04/10] ignite git commit: Removed swapEnabled from cache configs.
Posted by sb...@apache.org.
Removed swapEnabled from cache configs.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b7aaf3e4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b7aaf3e4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b7aaf3e4
Branch: refs/heads/ignite-4811-no-start-ver
Commit: b7aaf3e46fc5cbf4f2be56e6e99955f73a251e3b
Parents: b6c1761
Author: sboikov <sb...@gridgain.com>
Authored: Wed Apr 5 16:20:53 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Apr 5 16:20:53 2017 +0300
----------------------------------------------------------------------
modules/yardstick/config/ignite-base-config.xml | 2 --
modules/yardstick/config/ignite-failover-base-config.xml | 6 ------
.../yardstick/config/ignite-int-max-values-offheap-config.xml | 1 -
.../yardstick/config/ignite-int-max-values-onheap-config.xml | 1 -
modules/yardstick/config/ignite-store-config.xml | 2 --
5 files changed, 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7aaf3e4/modules/yardstick/config/ignite-base-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-base-config.xml b/modules/yardstick/config/ignite-base-config.xml
index 2ef3ba6..4416657 100644
--- a/modules/yardstick/config/ignite-base-config.xml
+++ b/modules/yardstick/config/ignite-base-config.xml
@@ -119,8 +119,6 @@
<property name="atomicityMode" value="ATOMIC"/>
- <property name="swapEnabled" value="false"/>
-
<property name="memoryMode" value="OFFHEAP_TIERED"/>
<property name="indexedTypes">
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7aaf3e4/modules/yardstick/config/ignite-failover-base-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-failover-base-config.xml b/modules/yardstick/config/ignite-failover-base-config.xml
index 1e1dcff..0a3bd88 100644
--- a/modules/yardstick/config/ignite-failover-base-config.xml
+++ b/modules/yardstick/config/ignite-failover-base-config.xml
@@ -90,8 +90,6 @@
<property name="cacheMode" value="PARTITIONED"/>
<property name="atomicityMode" value="ATOMIC"/>
-
- <property name="swapEnabled" value="false"/>
</bean>
<bean id="atomic-offheap" class="org.apache.ignite.configuration.CacheConfiguration" abstract="true">
@@ -101,8 +99,6 @@
<property name="atomicityMode" value="ATOMIC"/>
- <property name="swapEnabled" value="false"/>
-
<property name="memoryMode" value="OFFHEAP_TIERED"/>
</bean>
@@ -119,8 +115,6 @@
<property name="atomicityMode" value="TRANSACTIONAL"/>
- <property name="swapEnabled" value="false"/>
-
<property name="memoryMode" value="OFFHEAP_TIERED"/>
</bean>
</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7aaf3e4/modules/yardstick/config/ignite-int-max-values-offheap-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-int-max-values-offheap-config.xml b/modules/yardstick/config/ignite-int-max-values-offheap-config.xml
index 86e9656..353744e 100644
--- a/modules/yardstick/config/ignite-int-max-values-offheap-config.xml
+++ b/modules/yardstick/config/ignite-int-max-values-offheap-config.xml
@@ -75,7 +75,6 @@
<property name="atomicityMode" value="ATOMIC"/>
<property name="memoryMode" value="ONHEAP_TIERED"/>
<property name="offHeapMaxMemory" value="#{32 * 1024 * 1024 * 1024L}"/>
- <property name="swapEnabled" value="false"/>
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy">
<property name="maxSize" value="4000000"/>
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7aaf3e4/modules/yardstick/config/ignite-int-max-values-onheap-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-int-max-values-onheap-config.xml b/modules/yardstick/config/ignite-int-max-values-onheap-config.xml
index 65f51b9..c0d777d 100644
--- a/modules/yardstick/config/ignite-int-max-values-onheap-config.xml
+++ b/modules/yardstick/config/ignite-int-max-values-onheap-config.xml
@@ -76,7 +76,6 @@
<property name="atomicityMode" value="ATOMIC"/>
<property name="memoryMode" value="ONHEAP_TIERED"/>
<property name="offHeapMaxMemory" value="-1"/>
- <property name="swapEnabled" value="false"/>
</bean>
</list>
</property>
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7aaf3e4/modules/yardstick/config/ignite-store-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-store-config.xml b/modules/yardstick/config/ignite-store-config.xml
index 031de91..09b0b00 100644
--- a/modules/yardstick/config/ignite-store-config.xml
+++ b/modules/yardstick/config/ignite-store-config.xml
@@ -77,8 +77,6 @@
<property name="atomicityMode" value="ATOMIC"/>
- <property name="swapEnabled" value="false"/>
-
<property name="cacheStoreFactory">
<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
<property name="dataSourceBean" value="storeDataSource"/>
[07/10] ignite git commit: review
Posted by sb...@apache.org.
review
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e8b97470
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e8b97470
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e8b97470
Branch: refs/heads/ignite-4811-no-start-ver
Commit: e8b97470180216fba1abf5c4f55c78e8048cd901
Parents: 3ed1cbf
Author: Igor Seliverstov <gv...@gmail.com>
Authored: Wed Apr 5 19:04:11 2017 +0300
Committer: Igor Seliverstov <gv...@gmail.com>
Committed: Wed Apr 5 19:04:11 2017 +0300
----------------------------------------------------------------------
.../cache/database/tree/BPlusTree.java | 49 +++++++++-----------
1 file changed, 23 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8b97470/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
index 7be8297..1290e5b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
@@ -187,9 +187,6 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
return printPage(io, pageAddr, keys);
}
- catch (IgniteCheckedException e) {
- throw new IllegalStateException(e);
- }
finally {
readUnlock(pageId, page, pageAddr);
}
@@ -198,8 +195,8 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
releasePage(pageId, page);
}
}
- catch (IgniteCheckedException ignored) {
- throw new AssertionError("Can not acquire page.");
+ catch (IgniteCheckedException e) {
+ throw new IllegalStateException(e);
}
}
};
@@ -2499,7 +2496,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
assert (tailId == 0L) == (tailPage == 0L);
assert (tailPage == 0L) == (tailPageAddr == 0L);
- if (this.tailAddr != 0L)
+ if (this.tailPage != 0L)
writeUnlockAndClose(this.tailId, this.tailPage, this.tailAddr, null);
this.tailId = tailId;
@@ -3346,7 +3343,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
if (tail.getCount() == 0 && tail.lvl != 0 && getRootLevel() == tail.lvl) {
// Free root if it became empty after merge.
cutRoot(tail.lvl);
- freePage(tail.id, tail.page, tail.buf, tail.walPlc, false);
+ freePage(tail.pageId, tail.page, tail.buf, tail.walPlc, false);
// Exit: we are done.
}
@@ -3381,7 +3378,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
Tail<L> leaf = getTail(t, 0);
- removeDataRowFromLeaf(leaf.id, leaf.page, leaf.buf, leaf.walPlc, leaf.io, leaf.getCount(), insertionPoint(leaf));
+ removeDataRowFromLeaf(leaf.pageId, leaf.page, leaf.buf, leaf.walPlc, leaf.io, leaf.getCount(), insertionPoint(leaf));
}
/**
@@ -3577,7 +3574,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
Tail<L> left = t.getLeftChild();
Tail<L> right = t.getRightChild();
- assert left.id != right.id;
+ assert left.pageId != right.pageId;
int cnt = t.getCount();
@@ -3628,7 +3625,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
if (right && cnt != 0)
idx++;
- return inner(prnt.io).getLeft(prnt.buf, idx) == child.id;
+ return inner(prnt.io).getLeft(prnt.buf, idx) == child.pageId;
}
/**
@@ -3641,8 +3638,8 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
private boolean checkChildren(Tail<L> prnt, Tail<L> left, Tail<L> right, int idx) {
assert idx >= 0 && idx < prnt.getCount(): idx;
- return inner(prnt.io).getLeft(prnt.buf, idx) == left.id &&
- inner(prnt.io).getRight(prnt.buf, idx) == right.id;
+ return inner(prnt.io).getLeft(prnt.buf, idx) == left.pageId &&
+ inner(prnt.io).getRight(prnt.buf, idx) == right.pageId;
}
/**
@@ -3655,7 +3652,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
private boolean doMerge(Tail<L> prnt, Tail<L> left, Tail<L> right)
throws IgniteCheckedException {
assert right.io == left.io; // Otherwise incompatible.
- assert left.io.getForward(left.buf) == right.id;
+ assert left.io.getForward(left.buf) == right.pageId;
int prntCnt = prnt.getCount();
int prntIdx = fix(insertionPoint(prnt));
@@ -3687,10 +3684,10 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
// Remove split key from parent. If we are merging empty branch then remove only on the top iteration.
if (needMergeEmptyBranch != READY)
- doRemove(prnt.id, prnt.page, prnt.buf, prnt.walPlc, prnt.io, prntCnt, prntIdx);
+ doRemove(prnt.pageId, prnt.page, prnt.buf, prnt.walPlc, prnt.io, prntCnt, prntIdx);
// Forward page is now empty and has no links, can free and release it right away.
- freePage(right.id, right.page, right.buf, right.walPlc, true);
+ freePage(right.pageId, right.page, right.buf, right.walPlc, true);
return true;
}
@@ -3724,9 +3721,9 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
* @throws IgniteCheckedException If failed.
*/
private void cutRoot(int lvl) throws IgniteCheckedException {
- Bool res = write(metaPageId, cutRoot, lvl, FALSE);
+ Bool res = write(metaPageId, cutRoot, lvl, FALSE);
- assert res == TRUE : res;
+ assert res == TRUE : res;
}
/**
@@ -3789,8 +3786,8 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
// Update remove ID for the leaf page.
leaf.io.setRemoveId(leaf.buf, rmvId);
- if (needWalDeltaRecord(leaf.id, leaf.page, leaf.walPlc))
- wal.log(new FixRemoveId(cacheId, leaf.id, rmvId));
+ if (needWalDeltaRecord(leaf.pageId, leaf.page, leaf.walPlc))
+ wal.log(new FixRemoveId(cacheId, leaf.pageId, rmvId));
}
/**
@@ -3848,12 +3845,12 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
*/
private void doReleaseTail(Tail<L> t) {
while (t != null) {
- writeUnlockAndClose(t.id, t.page, t.buf, t.walPlc);
+ writeUnlockAndClose(t.pageId, t.page, t.buf, t.walPlc);
Tail<L> s = t.sibling;
if (s != null)
- writeUnlockAndClose(s.id, s.page, s.buf, s.walPlc);
+ writeUnlockAndClose(s.pageId, s.page, s.buf, s.walPlc);
t = t.down;
}
@@ -3877,12 +3874,12 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
return false;
if (t.lvl == lvl) {
- if (t.id == pageId)
+ if (t.pageId == pageId)
return true;
t = t.sibling;
- return t != null && t.id == pageId;
+ return t != null && t.pageId == pageId;
}
t = t.down;
@@ -4054,7 +4051,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
static final byte FORWARD = 2;
/** */
- private final long id;
+ private final long pageId;
/** */
private final long page;
@@ -4098,7 +4095,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
assert page != 0L;
assert buf != 0L;
- this.id = pageId;
+ this.pageId = pageId;
this.page = page;
this.buf = buf;
this.io = io;
@@ -4115,7 +4112,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
/** {@inheritDoc} */
@Override public String toString() {
- return new SB("Tail[").a("pageId=").appendHex(id).a(", cnt= ").a(getCount())
+ return new SB("Tail[").a("pageId=").appendHex(pageId).a(", cnt= ").a(getCount())
.a(", lvl=" + lvl).a(", sibling=").a(sibling).a("]").toString();
}