timoninmaxim commented on a change in pull request #8490:
URL: https://github.com/apache/ignite/pull/8490#discussion_r582086425



##########
File path: 
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
##########
@@ -464,41 +427,59 @@ public GridKernalContext kernalContext() {
      * @param unwrappedCols Unwrapped index columns for complex types.
      * @param wrappedCols Index columns as is complex types.
      * @param inlineSize Index inline size.
+     * @param cacheVisitor whether index created with new cache or on existing 
one.
      * @return Index.
      */
     @SuppressWarnings("ConstantConditions")
     GridH2IndexBase createSortedIndex(String name, GridH2Table tbl, boolean 
pk, boolean affinityKey,
-        List<IndexColumn> unwrappedCols, List<IndexColumn> wrappedCols, int 
inlineSize) {
-        try {
-            GridCacheContextInfo cacheInfo = tbl.cacheInfo();
-
-            if (log.isDebugEnabled())
-                log.debug("Creating cache index [cacheId=" + 
cacheInfo.cacheId() + ", idxName=" + name + ']');
-
-            if (cacheInfo.affinityNode()) {
-                final int segments = 
tbl.rowDescriptor().context().config().getQueryParallelism();
-
-                H2RowCache cache = rowCache.forGroup(cacheInfo.groupId());
-
-                return H2TreeIndex.createIndex(
-                    cacheInfo.cacheContext(),
-                    cache,
-                    tbl,
-                    name,
-                    pk,
-                    affinityKey,
-                    unwrappedCols,
-                    wrappedCols,
-                    inlineSize,
-                    segments,
-                    log
-                );
-            }
+        List<IndexColumn> unwrappedCols, List<IndexColumn> wrappedCols, int 
inlineSize, @Nullable SchemaIndexCacheVisitor cacheVisitor) {
+        GridCacheContextInfo cacheInfo = tbl.cacheInfo();
+
+        if (log.isDebugEnabled())
+            log.debug("Creating cache index [cacheId=" + cacheInfo.cacheId() + 
", idxName=" + name + ']');
+
+        QueryIndexSchema schemaUnwrapped = new QueryIndexSchema(
+            tbl, unwrappedCols.toArray(new IndexColumn[0]));
+
+        QueryIndexSchema schemaWrapped = new QueryIndexSchema(
+            tbl, wrappedCols.toArray(new IndexColumn[0]));
+
+        if (cacheInfo.affinityNode()) {
+            SortedIndexDefinition idxDef = new QueryIndexDefinition(

Review comment:
       Wait for merge of [#8811](https://github.com/apache/ignite/pull/8811).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to