Merge remote-tracking branch 'remotes/origin/ignite-3477' into ignite-4652

# Conflicts:
#       
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java


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

Branch: refs/heads/ignite-4652
Commit: 8b68231e0e5235dc1401cc3a9f50ba97ecbe9cf3
Parents: 5f83c94 8f836cb
Author: sboikov <sboi...@gridgain.com>
Authored: Thu Feb 16 14:54:46 2017 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Thu Feb 16 14:54:46 2017 +0300

----------------------------------------------------------------------
 .../benchmarks/jmh/tree/BPlusTreeBenchmark.java |  13 +-
 .../apache/ignite/IgniteSystemProperties.java   |   7 +
 .../org/apache/ignite/cache/QueryIndex.java     |  21 ++
 .../configuration/CacheConfiguration.java       |  35 ++-
 .../apache/ignite/internal/IgniteKernal.java    |   2 +
 .../apache/ignite/internal/pagemem/Page.java    |   2 +-
 .../ignite/internal/pagemem/PageIdUtils.java    |   2 +-
 .../ignite/internal/pagemem/PageMemory.java     |   4 -
 .../pagemem/impl/PageMemoryNoStoreImpl.java     |  22 +-
 .../internal/pagemem/wal/record/WALRecord.java  |   5 +-
 .../pagemem/wal/record/delta/InsertRecord.java  |  25 +-
 .../delta/MetaPageInitRootInlineRecord.java     |  62 +++++
 .../record/delta/MetaPageInitRootRecord.java    |   3 +-
 .../wal/record/delta/NewRootInitRecord.java     |  26 +-
 .../pagemem/wal/record/delta/ReplaceRecord.java |  23 +-
 .../cache/IgniteCacheOffheapManagerImpl.java    |  54 +---
 .../IgniteCacheDatabaseSharedManager.java       |   9 +
 .../cache/database/MetadataStorage.java         |  57 +---
 .../cache/database/freelist/FreeList.java       |   6 +
 .../cache/database/freelist/FreeListImpl.java   |  43 +++
 .../cache/database/freelist/PagesList.java      | 258 ++++++++++-------
 .../cache/database/tree/BPlusTree.java          |  99 +++++--
 .../cache/database/tree/io/BPlusIO.java         |  34 ++-
 .../cache/database/tree/io/BPlusInnerIO.java    |  44 +--
 .../cache/database/tree/io/BPlusLeafIO.java     |   9 +-
 .../cache/database/tree/io/BPlusMetaIO.java     |  45 ++-
 .../cache/database/tree/io/DataPageIO.java      |   4 +-
 .../cache/database/tree/io/DataPagePayload.java |   2 +-
 .../cache/database/tree/io/PageIO.java          |  60 ++++
 .../cluster/IgniteChangeGlobalStateSupport.java |   2 +
 .../query/GridQueryIndexDescriptor.java         |   7 +
 .../processors/query/GridQueryProcessor.java    |  47 +++-
 .../apache/ignite/internal/util/GridUnsafe.java |  45 ++-
 .../processors/database/BPlusTreeSelfTest.java  |  13 +-
 .../unsafe/GridUnsafeMemorySelfTest.java        |  35 +++
 .../processors/query/h2/IgniteH2Indexing.java   |  23 +-
 .../processors/query/h2/database/H2Tree.java    |  57 +++-
 .../query/h2/database/H2TreeIndex.java          | 236 +++++++++++++++-
 .../query/h2/database/InlineIndexHelper.java    | 279 +++++++++++++++++++
 .../query/h2/database/io/H2ExtrasInnerIO.java   | 135 +++++++++
 .../query/h2/database/io/H2ExtrasLeafIO.java    | 132 +++++++++
 .../query/h2/database/io/H2InnerIO.java         |  10 -
 .../query/h2/database/io/H2LeafIO.java          |  10 -
 .../processors/query/h2/opt/GridH2Row.java      |   2 +-
 .../processors/query/h2/opt/GridH2Table.java    |   3 +-
 .../h2/GridIndexingSpiAbstractSelfTest.java     |   5 +
 .../query/h2/database/H2TreeIndexTest.java      |  59 ++++
 .../h2/database/InlineIndexHelperTest.java      |  46 +++
 48 files changed, 1723 insertions(+), 399 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8b68231e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index eed9f09,5df99b6..e4118e8
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@@ -1042,65 -956,43 +1044,68 @@@ public class IgniteCacheOffheapManagerI
                      }
                      else
                          old = dataTree.put(dataRow);
 -
 -                    if (old == null)
 -                        storageSize.incrementAndGet();
                  }
  
 -                if (indexingEnabled) {
 -                    GridCacheQueryManager qryMgr = cctx.queries();
 +                finishUpdate(dataRow, old);
 +            }
 +            finally {
 +                busyLock.leaveBusy();
 +            }
 +        }
 +
 +        /**
 +         * @param newRow New row.
 +         * @param oldRow Old row if available.
 +         * @throws IgniteCheckedException If failed.
 +         */
 +        private void finishUpdate(CacheDataRow newRow, @Nullable CacheDataRow 
oldRow) throws IgniteCheckedException {
 +            if (oldRow == null)
 +                storageSize.incrementAndGet();
  
 -                    assert qryMgr.enabled();
 +            KeyCacheObject key = newRow.key();
  
 -                    if (old != null)
 -                        qryMgr.store(key, p, old.value(), old.version(), val, 
ver, expireTime, dataRow.link());
 -                    else
 -                        qryMgr.store(key, p, null, null, val, ver, 
expireTime, dataRow.link());
 -                }
 +            long expireTime = newRow.expireTime();
  
 -                if (old != null) {
 -                    assert old.link() != 0 : old;
 +            if (indexingEnabled) {
 +                GridCacheQueryManager qryMgr = cctx.queries();
  
 -                    if (pendingEntries != null && old.expireTime() != 0)
 -                        pendingEntries.removex(new 
PendingRow(old.expireTime(), old.link()));
 +                assert qryMgr.enabled();
  
 -                    if (rmvOld)
 -                        rowStore.removeRow(old.link());
 +                if (oldRow != null) {
 +                    qryMgr.store(key,
 +                        partId,
 +                        oldRow.value(), oldRow.version(),
 +                        newRow.value(), newRow.version(),
 +                        expireTime,
 +                        newRow.link());
 +                }
 +                else {
 +                    qryMgr.store(key,
 +                        partId,
 +                        null, null,
 +                        newRow.value(), newRow.version(),
 +                        expireTime,
 +                        newRow.link());
                  }
 +            }
  
 -                if (pendingEntries != null && expireTime != 0) {
 -                    pendingEntries.putx(new PendingRow(expireTime, 
dataRow.link()));
 +            if (oldRow != null) {
 +                assert oldRow.link() != 0 : oldRow;
  
 -                    hasPendingEntries = true;
 -                }
 +                if (pendingEntries != null && oldRow.expireTime() != 0)
 +                    pendingEntries.removex(new 
PendingRow(oldRow.expireTime(), oldRow.link()));
  
 -                updateIgfsMetrics(key, (old != null ? old.value() : null), 
val);
 +                if (newRow.link() != oldRow.link())
 +                    rowStore.removeRow(oldRow.link());
              }
 -            finally {
 -                busyLock.leaveBusy();
 +
-             if (pendingEntries != null && expireTime != 0)
++            if (pendingEntries != null && expireTime != 0) {
 +                pendingEntries.putx(new PendingRow(expireTime, 
newRow.link()));
 +
++                hasPendingEntries = true;
+             }
++
 +            updateIgfsMetrics(key, (oldRow != null ? oldRow.value() : null), 
newRow.value());
          }
  
          /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/8b68231e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
----------------------------------------------------------------------

Reply via email to