ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-6624: SQL: optimized backup filtering (no key wrap/unwrap). This closes #2847.
Date Wed, 01 Nov 2017 13:47:35 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 97fc7287d -> a15b45bdf


IGNITE-6624: SQL: optimized backup filtering (no key wrap/unwrap). This closes #2847.


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

Branch: refs/heads/master
Commit: a15b45bdfae738145ac25f9e3e9600a85aa607cb
Parents: 97fc728
Author: devozerov <vozerov@gridgain.com>
Authored: Wed Nov 1 16:47:16 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Nov 1 16:47:16 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/persistence/CacheDataRowAdapter.java |  2 +-
 .../ignite/spi/indexing/IndexingQueryCacheFilter.java     | 10 ++++++++++
 .../ignite/internal/processors/query/h2/H2Cursor.java     |  9 +--------
 .../processors/query/h2/database/H2PkHashIndex.java       |  2 +-
 .../internal/processors/query/h2/opt/GridH2IndexBase.java |  9 ++-------
 5 files changed, 15 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a15b45bd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRowAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRowAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRowAdapter.java
index 9257424..9f2e031 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRowAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRowAdapter.java
@@ -555,7 +555,7 @@ public class CacheDataRowAdapter implements CacheDataRow {
 
     /** {@inheritDoc} */
     @Override public int partition() {
-        return PageIdUtils.partId(link);
+        return PageIdUtils.partId(pageId(link));
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/a15b45bd/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryCacheFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryCacheFilter.java
b/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryCacheFilter.java
index 6257f47..fa3ec97 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryCacheFilter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryCacheFilter.java
@@ -64,6 +64,16 @@ public class IndexingQueryCacheFilter {
     public boolean apply(Object key) {
         int part = aff.partition(key);
 
+        return applyPartition(part);
+    }
+
+    /**
+     * Apply filter.
+     *
+     * @param part Partition.
+     * @return {@code True} if passed.
+     */
+    public boolean applyPartition(int part) {
         if (parts == null)
             return aff.primaryByPartition(locNode, part, topVer);
         else

http://git-wip-us.apache.org/repos/asf/ignite/blob/a15b45bd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Cursor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Cursor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Cursor.java
index e09108d..f4c35f2 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Cursor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Cursor.java
@@ -82,14 +82,7 @@ public class H2Cursor implements Cursor {
                 if (row.expireTime() > 0 && row.expireTime() <= time)
                     continue;
 
-                if (filter == null)
-                    return true;
-
-                Object key = row.getValue(0).getObject();
-
-                assert key != null;
-
-                if (filter.apply(key))
+                if (filter == null || filter.applyPartition(row.partition()))
                     return true;
             }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a15b45bd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
index 59bf153..be3a02e 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
@@ -218,7 +218,7 @@ public class H2PkHashIndex extends GridH2IndexBase {
 
                     CacheDataRow dataRow = cursor.get();
 
-                    if (filter.apply(dataRow.key()))
+                    if (filter.applyPartition(dataRow.partition()))
                         return true;
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a15b45bd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
index 92b7d10..c28d067 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
@@ -1612,17 +1612,12 @@ public abstract class GridH2IndexBase extends BaseIndex {
          * @param row Row.
          * @return If this row was accepted.
          */
-        @SuppressWarnings("unchecked")
+        @SuppressWarnings({"unchecked", "SimplifiableIfStatement"})
         protected boolean accept(GridH2Row row) {
             if (row.expireTime() != 0 && row.expireTime() <= time)
                 return false;
 
-            if (fltr == null)
-                return true;
-
-            Object key = row.getValue(KEY_COL).getObject();
-
-            return fltr.apply(key);
+            return fltr == null || fltr.applyPartition(row.partition());
         }
 
         /** {@inheritDoc} */


Mime
View raw message