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-5937
Date Wed, 25 Oct 2017 12:09:44 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5937 739417afb -> aaddadf5a


ignite-5937


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

Branch: refs/heads/ignite-5937
Commit: aaddadf5a64a693befb017ed8b03ad38f1a77e7d
Parents: 739417a
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Oct 25 15:09:39 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Oct 25 15:09:39 2017 +0300

----------------------------------------------------------------------
 .../cache/persistence/tree/BPlusTree.java       |  3 ++
 .../processors/cache/tree/MvccCleanupRow.java   | 12 +++----
 .../processors/query/GridQueryProcessor.java    |  9 ++++--
 .../processors/query/h2/IgniteH2Indexing.java   |  7 +++--
 .../processors/query/h2/database/H2Tree.java    |  7 +++--
 .../query/h2/database/H2TreeIndex.java          |  3 +-
 .../h2/database/H2TreeMvccFilterClosure.java    |  6 ++++
 .../query/h2/database/io/H2IOUtils.java         | 33 +++++++++++++++++---
 .../query/h2/opt/GridH2QueryContext.java        |  1 -
 .../processors/query/h2/opt/GridH2Row.java      |  6 ++++
 .../processors/query/h2/opt/GridH2Table.java    |  1 +
 .../query/h2/twostep/GridMapQueryExecutor.java  |  1 +
 12 files changed, 67 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/BPlusTree.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/BPlusTree.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/BPlusTree.java
index e69284d..1ebb1e9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/BPlusTree.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/BPlusTree.java
@@ -884,6 +884,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
 
     /**
      * @param upper Upper bound.
+     * @param c Filter closure.
      * @param x Implementation specific argument, {@code null} always means that we need
to return full detached data row.
      * @return Cursor.
      * @throws IgniteCheckedException If failed.
@@ -952,6 +953,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
     /**
      * @param lower Lower bound inclusive or {@code null} if unbounded.
      * @param upper Upper bound inclusive or {@code null} if unbounded.
+     * @param c Filter closure.
      * @param x Implementation specific argument, {@code null} always means that we need
to return full detached data row.
      * @return Cursor.
      * @throws IgniteCheckedException If failed.
@@ -4768,6 +4770,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
         /**
          * @param lowerBound Lower bound.
          * @param upperBound Upper bound.
+         * @param c Filter closure.
          * @param x Implementation specific argument, {@code null} always means that we need
to return full detached data row.
          */
         ForwardCursor(L lowerBound, L upperBound, TreeRowClosure<L, T> c, Object x)
{

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/MvccCleanupRow.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/MvccCleanupRow.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/MvccCleanupRow.java
index 3093e0d..92caf70 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/MvccCleanupRow.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/MvccCleanupRow.java
@@ -20,18 +20,18 @@ package org.apache.ignite.internal.processors.cache.tree;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 
 /**
- *
+ * Row contains only link.
  */
 public class MvccCleanupRow extends MvccSearchRow {
     /** */
     private final long link;
 
     /**
-     * @param cacheId
-     * @param key
-     * @param crdVer
-     * @param mvccCntr
-     * @param link
+     * @param cacheId Cache ID.
+     * @param key Key.
+     * @param crdVer Mvcc coordinator version.
+     * @param mvccCntr Mvcc counter.
+     * @param link Link.
      */
     MvccCleanupRow(int cacheId, KeyCacheObject key, long crdVer, long mvccCntr, long link)
{
         super(cacheId, key, crdVer, mvccCntr);

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 9dd3757..3b3dec0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -1750,10 +1750,11 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             if (desc == null)
                 return;
 
-            // TODO IGNITE-3478 index size (always inc on update?)
             if (cctx.mvccEnabled()) {
+                // Add new mvcc value.
                 idx.store(cctx, desc, newRow, null);
 
+                // Set info about more recent version for previous record.
                 if (prevRow != null)
                     idx.store(cctx, desc, prevRow, mvccVer);
             }
@@ -2350,8 +2351,10 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 return;
 
             if (cctx.mvccEnabled()) {
-                if (newVer != null)
-                    idx.store(cctx, desc, val, newVer); // Set info about more recent version
for previous record.
+                if (newVer != null) {
+                    // Set info about more recent version for previous record.
+                    idx.store(cctx, desc, val, newVer);
+                }
                 else
                     idx.remove(cctx, desc, val);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/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 2359ae1..6dc93c4 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
@@ -540,8 +540,11 @@ public class IgniteH2Indexing implements GridQueryIndexing {
     }
 
     /** {@inheritDoc} */
-    @Override public void store(GridCacheContext cctx, GridQueryTypeDescriptor type, CacheDataRow
row, @Nullable MvccCoordinatorVersion newVer)
-        throws IgniteCheckedException {
+    @Override public void store(GridCacheContext cctx,
+        GridQueryTypeDescriptor type,
+        CacheDataRow row,
+        @Nullable MvccCoordinatorVersion newVer) throws IgniteCheckedException
+    {
         String cacheName = cctx.name();
 
         H2TableDescriptor tbl = tableDescriptor(schema(cacheName), cacheName, type.name());

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/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 9231775..df77f7a 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
@@ -61,15 +61,15 @@ public abstract class H2Tree extends BPlusTree<GridH2SearchRow, GridH2Row>
{
     private final int[] columnIds;
 
     /** */
+    private final boolean mvccEnabled;
+
+    /** */
     private final Comparator<Value> comp = new Comparator<Value>() {
         @Override public int compare(Value o1, Value o2) {
             return compareValues(o1, o2);
         }
     };
 
-    /** */
-    private final boolean mvccEnabled;
-
     /**
      * @param name Tree name.
      * @param reuseList Reuse list.
@@ -79,6 +79,7 @@ public abstract class H2Tree extends BPlusTree<GridH2SearchRow, GridH2Row>
{
      * @param rowStore Row data store.
      * @param metaPageId Meta page ID.
      * @param initNew Initialize new index.
+     * @param mvccEnabled Mvcc flag.
      * @throws IgniteCheckedException If failed.
      */
     H2Tree(

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/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 63b33af..87a6eca 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
@@ -329,8 +329,7 @@ public class H2TreeIndex extends GridH2IndexBase {
                 H2TreeMvccFilterClosure mvccFilter = qctx.mvccFilter();
 
                 assert mvccFilter != null;
-
-                // TODO IGNITE-3478
+                // TODO IGNITE-3478 (support filter for first/last)
             }
 
             GridH2Row row = b ? tree.findFirst(): tree.findLast();

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeMvccFilterClosure.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeMvccFilterClosure.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeMvccFilterClosure.java
index 72384c0..6ae2312 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeMvccFilterClosure.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeMvccFilterClosure.java
@@ -24,6 +24,7 @@ import org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusIO;
 import org.apache.ignite.internal.processors.query.h2.database.io.H2RowLinkIO;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2Row;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2SearchRow;
+import org.apache.ignite.internal.util.typedef.internal.S;
 
 import static org.apache.ignite.internal.processors.cache.mvcc.CacheCoordinatorsProcessor.assertMvccVersionValid;
 import static org.apache.ignite.internal.processors.cache.mvcc.CacheCoordinatorsProcessor.unmaskCoordinatorVersion;
@@ -97,4 +98,9 @@ public class H2TreeMvccFilterClosure implements H2Tree.TreeRowClosure<GridH2Sear
         else
             return cmp < 0;
     }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(H2TreeMvccFilterClosure.class, this);
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/io/H2IOUtils.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/io/H2IOUtils.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/io/H2IOUtils.java
index 54b168d..c0b2314 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/io/H2IOUtils.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/io/H2IOUtils.java
@@ -24,11 +24,20 @@ import org.apache.ignite.internal.processors.query.h2.opt.GridH2SearchRow;
 
 import static org.apache.ignite.internal.processors.cache.mvcc.CacheCoordinatorsProcessor.assertMvccVersionValid;
 
-public class H2IOUtils {
+/**
+ *
+ */
+class H2IOUtils {
     /**
-     * @param row
-     * @param pageAddr
-     * @param off
+     *
+     */
+    private H2IOUtils() {}
+
+    /**
+     * @param row Row.
+     * @param pageAddr Page address.
+     * @param off Offset.
+     * @param storeMvcc {@code True} to store mvcc data.
      */
     static void storeRow(GridH2Row row, long pageAddr, int off, boolean storeMvcc) {
         assert row.link() != 0;
@@ -58,7 +67,21 @@ public class H2IOUtils {
         }
     }
 
-    static void store(long dstPageAddr, int dstOff, BPlusIO<GridH2SearchRow> srcIo,
long srcPageAddr, int srcIdx, boolean storeMvcc) {
+    /**
+     * @param dstPageAddr Destination page address.
+     * @param dstOff Destination page offset.
+     * @param srcIo Source IO.
+     * @param srcPageAddr Source page address.
+     * @param srcIdx Source index.
+     * @param storeMvcc {@code True} to store mvcc data.
+     */
+    static void store(long dstPageAddr,
+        int dstOff,
+        BPlusIO<GridH2SearchRow> srcIo,
+        long srcPageAddr,
+        int srcIdx,
+        boolean storeMvcc)
+    {
         H2RowLinkIO rowIo = (H2RowLinkIO)srcIo;
 
         long link = rowIo.getLink(srcPageAddr, srcIdx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2QueryContext.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2QueryContext.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2QueryContext.java
index 9444aa4..b490179 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2QueryContext.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2QueryContext.java
@@ -25,7 +25,6 @@ import java.util.concurrent.ConcurrentMap;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccCoordinatorVersion;
 import org.apache.ignite.internal.processors.query.h2.database.H2TreeMvccFilterClosure;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
index 70f0330..785b791 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
@@ -107,10 +107,16 @@ public abstract class GridH2Row extends GridH2SearchRowAdapter implements
CacheD
         return false;
     }
 
+    /**
+     * @return Part of new mvcc version.
+     */
     public long newMvccCoordinatorVersion() {
         return 0;
     }
 
+    /**
+     * @return Part of new mvcc version.
+     */
     public long newMvccCounter() {
         return CacheCoordinatorsProcessor.MVCC_COUNTER_NA;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
index baa4d92..ca9c1f5 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
@@ -458,6 +458,7 @@ public class GridH2Table extends TableBase {
     @SuppressWarnings("LockAcquiredButNotSafelyReleased")
     private boolean doUpdate(final GridH2Row row, boolean del) throws IgniteCheckedException
{
         assert !cctx.mvccEnabled() || row.mvccCounter() != CacheCoordinatorsProcessor.MVCC_COUNTER_NA
: row;
+
         // Here we assume that each key can't be updated concurrently and case when different
indexes
         // getting updated from different threads with different rows with the same key is
impossible.
         lock(false);

http://git-wip-us.apache.org/repos/asf/ignite/blob/aaddadf5/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index f0144b7..fe21b1d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -549,6 +549,7 @@ public class GridMapQueryExecutor {
      * @param pageSize Page size.
      * @param distributedJoinMode Query distributed join mode.
      * @param lazy Streaming flag.
+     * @param mvccVer Mvcc version.
      */
     private void onQueryRequest0(
         final ClusterNode node,


Mime
View raw message