ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject ignite git commit: ignite-1282-sql - new h2 + row factory
Date Wed, 11 Nov 2015 10:05:36 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1282-sql [created] 03f3b419c


ignite-1282-sql - new h2 + row factory


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

Branch: refs/heads/ignite-1282-sql
Commit: 03f3b419c70787862b932c92544aab0ba1effe72
Parents: 0dc8902
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Wed Nov 11 13:05:12 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Wed Nov 11 13:05:12 2015 +0300

----------------------------------------------------------------------
 modules/core/pom.xml                            |   2 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |   2 +-
 .../processors/query/h2/IgniteH2Indexing.java   |  20 ++-
 .../query/h2/opt/GridH2AbstractKeyValueRow.java |  28 ++-
 .../query/h2/opt/GridH2IndexBase.java           |  42 -----
 .../processors/query/h2/opt/GridH2Row.java      |  82 ++++++++-
 .../query/h2/opt/GridH2RowFactory.java          | 171 +++++++++++++++++++
 .../processors/query/h2/opt/GridH2Table.java    |  17 +-
 .../query/h2/opt/GridH2TreeIndex.java           |   5 +-
 .../query/h2/opt/GridH2ValueCacheObject.java    |   3 +-
 .../query/h2/twostep/GridMergeIndex.java        |   2 +-
 .../h2/twostep/GridMergeIndexUnsorted.java      |   3 +-
 .../query/h2/twostep/GridMergeTable.java        |   4 +-
 .../query/h2/twostep/GridThreadLocalTable.java  |   9 +-
 .../query/h2/twostep/msg/GridH2Timestamp.java   |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/spring/pom.xml                          |  10 +-
 18 files changed, 314 insertions(+), 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index e02bb23..159b0cb 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -90,7 +90,7 @@
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
-            <version>1.3.175</version>
+            <version>1.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 8a04ab7..d197901 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -71,7 +71,7 @@
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
-            <version>1.3.175</version>
+            <version>1.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index d539f6b..1e15ddf 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -56,7 +56,7 @@
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
-            <version>1.3.175</version>
+            <version>1.0-SNAPSHOT</version>
         </dependency>
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/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 d5efebf..023967d 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
@@ -85,6 +85,7 @@ import org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOffhe
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2Row;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor;
+import org.apache.ignite.internal.processors.query.h2.opt.GridH2RowFactory;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2Table;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2Utils;
@@ -113,7 +114,7 @@ import org.apache.ignite.spi.IgniteSpiCloseableIterator;
 import org.apache.ignite.spi.indexing.IndexingQueryFilter;
 import org.h2.api.JavaObjectSerializer;
 import org.h2.command.CommandInterface;
-import org.h2.constant.SysProperties;
+import org.h2.engine.SysProperties;
 import org.h2.index.Index;
 import org.h2.index.SpatialIndex;
 import org.h2.jdbc.JdbcPreparedStatement;
@@ -124,7 +125,7 @@ import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.Table;
 import org.h2.tools.Server;
-import org.h2.util.Utils;
+import org.h2.util.JdbcUtils;
 import org.h2.value.DataType;
 import org.h2.value.Value;
 import org.h2.value.ValueArray;
@@ -1296,10 +1297,10 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             SysProperties.serializeJavaObject = false;
         }
 
-        if (Utils.serializer != null)
+        if (JdbcUtils.serializer != null)
             U.warn(log, "Custom H2 serialization is already configured, will override.");
 
-        Utils.serializer = h2Serializer();
+        JdbcUtils.serializer = h2Serializer();
 
         String dbName = (ctx != null ? ctx.localNodeId() : UUID.randomUUID()).toString();
 
@@ -2041,8 +2042,13 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             this.offheap = offheap;
             this.ccfg = ccfg;
 
-            if (offheap != null)
-                rowCache = new CacheLongKeyLIRS<>(ccfg.getSqlOnheapRowCacheSize(),
1, 128, 256);
+            if (offheap != null) {
+                CacheLongKeyLIRS.Config lirsCfg = new CacheLongKeyLIRS.Config();
+
+                lirsCfg.maxMemory = ccfg.getSqlOnheapRowCacheSize();
+
+                rowCache = new CacheLongKeyLIRS<>(lirsCfg);
+            }
             else
                 rowCache = null;
         }
@@ -2225,7 +2231,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             throws IgniteCheckedException {
             try {
                 if (val == null) // Only can happen for remove operation, can create simple
search row.
-                    return new GridH2Row(wrap(key, keyType), null);
+                    return GridH2RowFactory.INSTANCE.create(wrap(key, keyType));
 
                 return schema.offheap == null ?
                     new GridH2KeyValueRowOnheap(this, key, keyType, val, valType, expirationTime)
:

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
index ca5442a..b876bd8 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
@@ -55,6 +55,12 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row {
     @SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized")
     protected long expirationTime;
 
+    /** */
+    private Value key;
+
+    /** */
+    private volatile Value val;
+
     /**
      * Constructor.
      *
@@ -68,8 +74,6 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row {
      */
     protected GridH2AbstractKeyValueRow(GridH2RowDescriptor desc, Object key, int keyType,
@Nullable Object val,
         int valType, long expirationTime) throws IgniteCheckedException {
-        super(null, null);
-
         setValue(KEY_COL, desc.wrap(key, keyType));
 
         if (val != null) // We remove by key only, so value can be null here.
@@ -85,8 +89,6 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row {
      * @param desc Row descriptor.
      */
     protected GridH2AbstractKeyValueRow(GridH2RowDescriptor desc) {
-        super(new Value[DEFAULT_COLUMNS_COUNT]);
-
         this.desc = desc;
     }
 
@@ -184,7 +186,7 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row {
      * @return Value if exists.
      */
     protected final Value peekValue(int col) {
-        return getValueList()[col];
+        return col == KEY_COL ? key : val;
     }
 
     /** {@inheritDoc} */
@@ -469,4 +471,20 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row {
             throw new IllegalStateException();
         }
     }
+
+    /** {@inheritDoc} */
+    @Override public Value[] getValueList() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void setValue(int idx, Value v) {
+        if (idx == VAL_COL)
+            val = v;
+        else {
+            assert idx == KEY_COL : idx + " " + v;
+
+            key = v;
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/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 39664ff..ff9aa23 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
@@ -27,8 +27,6 @@ import org.h2.index.BaseIndex;
 import org.h2.message.DbException;
 import org.h2.result.Row;
 import org.h2.result.SearchRow;
-import org.h2.result.SortOrder;
-import org.h2.value.Value;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -108,46 +106,6 @@ public abstract class GridH2IndexBase extends BaseIndex {
         // No-op.
     }
 
-    /** {@inheritDoc} */
-    @Override public int compareRows(SearchRow rowData, SearchRow compare) {
-        if (rowData == compare)
-            return 0;
-
-        for (int i = 0, len = indexColumns.length; i < len; i++) {
-            int index = columnIds[i];
-
-            Value v1 = rowData.getValue(index);
-            Value v2 = compare.getValue(index);
-
-            if (v1 == null || v2 == null)
-                return 0;
-
-            int c = compareValues(v1, v2, indexColumns[i].sortType);
-
-            if (c != 0)
-                return c;
-        }
-        return 0;
-    }
-
-    /**
-     * @param a First value.
-     * @param b Second value.
-     * @param sortType Sort type.
-     * @return Comparison result.
-     */
-    private int compareValues(Value a, Value b, int sortType) {
-        if (a == b)
-            return 0;
-
-        int comp = table.compareTypeSave(a, b);
-
-        if ((sortType & SortOrder.DESCENDING) != 0)
-            comp = -comp;
-
-        return comp;
-    }
-
     /**
      * Filters rows from expired ones and using predicate.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/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 3b6b56e..0d6cc22 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
@@ -18,19 +18,13 @@
 package org.apache.ignite.internal.processors.query.h2.opt;
 
 import org.h2.result.Row;
-import org.h2.value.Value;
+import org.h2.result.SearchRow;
+import org.h2.store.Data;
 
 /**
  * Row with locking support needed for unique key conflicts resolution.
  */
-public class GridH2Row extends Row implements GridSearchRowPointer {
-    /**
-     * @param data Column values.
-     */
-    public GridH2Row(Value... data) {
-        super(data, MEMORY_CALCULATE);
-    }
-
+public abstract class GridH2Row extends Row implements GridSearchRowPointer {
     /** {@inheritDoc} */
     @Override public long pointer() {
         throw new IllegalStateException();
@@ -45,4 +39,74 @@ public class GridH2Row extends Row implements GridSearchRowPointer {
     @Override public void decrementRefCount() {
         throw new IllegalStateException();
     }
+
+    /** {@inheritDoc} */
+    @Override public Row getCopy() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void setVersion(int version) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getByteCount(Data dummy) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void setDeleted(boolean deleted) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void setSessionId(int sessionId) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getSessionId() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void commit() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isDeleted() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void setKeyAndVersion(SearchRow old) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getVersion() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void setKey(long key) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getKey() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getMemory() {
+        throw new UnsupportedOperationException();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
new file mode 100644
index 0000000..6671ef9
--- /dev/null
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
@@ -0,0 +1,171 @@
+/*
+ * 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.query.h2.opt;
+
+import org.h2.result.RowFactory;
+import org.h2.value.Value;
+
+/**
+ * Row factory.
+ */
+public class GridH2RowFactory extends RowFactory {
+    /** */
+    public static final GridH2RowFactory INSTANCE = new GridH2RowFactory();
+
+    /**
+     * @param v Value.
+     * @return Row.
+     */
+    public GridH2Row create(Value v) {
+        return new RowKey(v);
+    }
+
+    /**
+     * @param v1 Value 1.
+     * @param v2 Value 2.
+     * @return Row.
+     */
+    public GridH2Row create(Value v1, Value v2) {
+        return new RowPair(v1, v2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public GridH2Row createRow(Value[] data, int memory) {
+        switch (data.length) {
+            case 1:
+                return new RowKey(data[0]);
+
+            case 2:
+                return new RowPair(data[0], data[1]);
+
+            default:
+                return new RowSimple(data);
+        }
+    }
+
+    /**
+     * Single value row.
+     */
+    private static final class RowKey extends GridH2Row {
+        /** */
+        private Value key;
+
+        /**
+         * @param key Key.
+         */
+        public RowKey(Value key) {
+            this.key = key;
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getColumnCount() {
+            return 1;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Value getValue(int idx) {
+            assert idx == 0 : idx;
+            return key;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setValue(int index, Value v) {
+            throw new UnsupportedOperationException();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Value[] getValueList() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     * Row of two values.
+     */
+    private static final class RowPair extends GridH2Row  {
+        /** */
+        private Value v1;
+
+        /** */
+        private Value v2;
+
+        /**
+         * @param v1 First value.
+         * @param v2 Second value.
+         */
+        private RowPair(Value v1, Value v2) {
+            this.v1 = v1;
+            this.v2 = v2;
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getColumnCount() {
+            return 2;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Value getValue(int idx) {
+            return idx == 0 ? v1 : v2;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setValue(int index, Value v) {
+            throw new UnsupportedOperationException();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Value[] getValueList() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     * Simple array based row.
+     */
+    private static final class RowSimple extends GridH2Row {
+        /** */
+        private Value[] vals;
+
+        /**
+         * @param vals Values.
+         */
+        private RowSimple(Value[] vals) {
+            this.vals = vals;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Value[] getValueList() {
+            return vals;
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getColumnCount() {
+            return vals.length;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Value getValue(int idx) {
+            return vals[idx];
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setValue(int idx, Value v) {
+            throw new UnsupportedOperationException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/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 bf318b2..902b67b 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
@@ -40,6 +40,7 @@ import org.h2.engine.DbObject;
 import org.h2.engine.Session;
 import org.h2.index.Cursor;
 import org.h2.index.Index;
+import org.h2.index.IndexLookupBatch;
 import org.h2.index.IndexType;
 import org.h2.message.DbException;
 import org.h2.result.Row;
@@ -199,10 +200,10 @@ public class GridH2Table extends TableBase {
 
     /** {@inheritDoc} */
     @SuppressWarnings({"LockAcquiredButNotSafelyReleased", "SynchronizationOnLocalVariableOrMethodParameter",
"unchecked"})
-    @Override public void lock(@Nullable final Session ses, boolean exclusive, boolean force)
{
+    @Override public boolean lock(@Nullable final Session ses, boolean exclusive, boolean
force) {
         if (ses != null) {
             if (!sessions.add(ses))
-                return;
+                return false;
 
             synchronized (ses) {
                 ses.addLock(this);
@@ -219,7 +220,7 @@ public class GridH2Table extends TableBase {
                 for (int i = 1, len = idxs.size(); i < len; i++)
                     index(i).takeSnapshot(snapshot[i - 1]);
 
-                return;
+                return false;
             }
 
             try {
@@ -253,6 +254,8 @@ public class GridH2Table extends TableBase {
             for (int i = 1, len = idxs.size(); i < len; i++)
                 index(i).takeSnapshot(snapshot[i - 1]);
         }
+
+        return false;
     }
 
     /**
@@ -771,7 +774,8 @@ public class GridH2Table extends TableBase {
         }
 
         /** {@inheritDoc} */
-        @Override public double getCost(Session ses, int[] masks, TableFilter tblFilter,
SortOrder sortOrder) {
+        @Override public double getCost(Session ses, int[] masks, TableFilter[] filters,
int filter,
+            SortOrder sortOrder) {
             return getRowCountApproximation() + Constants.COST_ROW_OFFSET;
         }
 
@@ -836,6 +840,11 @@ public class GridH2Table extends TableBase {
         }
 
         /** {@inheritDoc} */
+        @Override public IndexLookupBatch createLookupBatch(TableFilter filter) {
+            return delegate.createLookupBatch(filter);
+        }
+
+        /** {@inheritDoc} */
         @Override public void truncate(Session ses) {
             // No-op.
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index 387c58b..4e790b0 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -229,8 +229,9 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter filter, SortOrder
sortOrder) {
-        return getCostRangeIndex(masks, getRowCountApproximation(), filter, sortOrder);
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter,
+        SortOrder sortOrder) {
+        return getCostRangeIndex(masks, getRowCountApproximation(), filters, filter, sortOrder);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ValueCacheObject.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ValueCacheObject.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ValueCacheObject.java
index fd0e6ed..92bbabb 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ValueCacheObject.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ValueCacheObject.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.processors.cache.CacheObject;
 import org.apache.ignite.internal.processors.cache.CacheObjectContext;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.h2.message.DbException;
+import org.h2.util.JdbcUtils;
 import org.h2.util.Utils;
 import org.h2.value.CompareMode;
 import org.h2.value.Value;
@@ -115,7 +116,7 @@ public class GridH2ValueCacheObject extends Value {
         }
 
         // For user-provided and array types.
-        return Utils.serialize(obj, null);
+        return JdbcUtils.serialize(obj, null);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
index 7f8caed..95ed4be 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
@@ -252,7 +252,7 @@ public abstract class GridMergeIndex extends BaseIndex {
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter filter, SortOrder
sortOrder) {
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder) {
         return getRowCountApproximation() + Constants.COST_ROW_OFFSET;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
index 5f5eb25..fb2efa1 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
@@ -24,6 +24,7 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import javax.cache.CacheException;
+import org.apache.ignite.internal.processors.query.h2.opt.GridH2RowFactory;
 import org.h2.index.Cursor;
 import org.h2.index.IndexType;
 import org.h2.result.Row;
@@ -95,7 +96,7 @@ public class GridMergeIndexUnsorted extends GridMergeIndex {
             }
 
             @Override public Row next() {
-                return new Row(iter.next(), 0);
+                return GridH2RowFactory.INSTANCE.createRow(iter.next(), 0);
             }
 
             @Override public void remove() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
index adfd220..97170bf 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
@@ -64,8 +64,8 @@ public class GridMergeTable extends TableBase {
     }
 
     /** {@inheritDoc} */
-    @Override public void lock(Session session, boolean exclusive, boolean force) {
-        // No-op.
+    @Override public boolean lock(Session session, boolean exclusive, boolean force) {
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
index a38d137..03cc6ce 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
@@ -77,8 +77,9 @@ public class GridThreadLocalTable extends Table {
     }
 
     /** {@inheritDoc} */
-    @Override public PlanItem getBestPlanItem(Session session, int[] masks, TableFilter filter,
SortOrder sortOrder) {
-        return tbl.get().getBestPlanItem(session, masks, filter, sortOrder);
+    @Override public PlanItem getBestPlanItem(Session session, int[] masks, TableFilter[]
filters, int filter,
+        SortOrder sortOrder) {
+        return tbl.get().getBestPlanItem(session, masks, filters, filter, sortOrder);
     }
 
     /** {@inheritDoc} */
@@ -122,8 +123,8 @@ public class GridThreadLocalTable extends Table {
     }
 
     /** {@inheritDoc} */
-    @Override public void lock(Session session, boolean exclusive, boolean force) {
-        tbl.get().lock(session, exclusive, force);
+    @Override public boolean lock(Session session, boolean exclusive, boolean force) {
+        return tbl.get().lock(session, exclusive, force);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Timestamp.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Timestamp.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Timestamp.java
index ccdba92..dda93a6 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Timestamp.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Timestamp.java
@@ -50,7 +50,7 @@ public class GridH2Timestamp extends GridH2ValueMessage {
         ValueTimestamp t = (ValueTimestamp)val;
 
         date = t.getDateValue();
-        nanos = t.getNanos();
+        nanos = t.getTimeNanos();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 1e63cae..c094d3c 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -44,7 +44,7 @@
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
-            <version>1.3.175</version>
+            <version>1.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
     </dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/03f3b419/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 8d1f918..cd4d190 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -106,7 +106,7 @@
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
-            <version>1.3.175</version>
+            <version>1.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
 
@@ -117,14 +117,6 @@
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
-
-
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-            <version>1.3.175</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <build>


Mime
View raw message