anton-vinogradov commented on a change in pull request #9540:
URL: https://github.com/apache/ignite/pull/9540#discussion_r744561708
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/IndexKeyDefinition.java
##########
@@ -70,4 +83,17 @@ public boolean validate(IndexKey key) {
return idxType == key.type();
}
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ // Send only required info for using in MergeSort algorithm.
+ out.writeInt(idxType);
+ out.writeInt(order.sortOrder().ordinal());
Review comment:
U.writeEnum
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/IndexKeyDefinition.java
##########
@@ -70,4 +83,17 @@ public boolean validate(IndexKey key) {
return idxType == key.type();
}
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ // Send only required info for using in MergeSort algorithm.
+ out.writeInt(idxType);
+ out.writeInt(order.sortOrder().ordinal());
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
Review comment:
what about precision?
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
##########
@@ -149,6 +163,12 @@ protected GridCacheDistributedQueryFuture(
}
}
+ /** {@inheritDoc} */
+ @Override protected void onMeta(Object metaData) {
+ if (metaData instanceof IndexQueryResultMeta)
Review comment:
why not just null check?
what if `metaData NOT instanceof IndexQueryResultMeta`? should this be
ignored?
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/reducer/IndexQueryReducer.java
##########
@@ -0,0 +1,149 @@
+/*
+ * 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.cache.query.reducer;
+
+import java.io.Serializable;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.internal.cache.query.index.IndexQueryResultMeta;
+import org.apache.ignite.internal.cache.query.index.sorted.IndexKeyDefinition;
+import org.apache.ignite.internal.cache.query.index.sorted.IndexRowComparator;
+import
org.apache.ignite.internal.cache.query.index.sorted.IndexRowCompartorImpl;
+import org.apache.ignite.internal.cache.query.index.sorted.keys.IndexKey;
+import
org.apache.ignite.internal.cache.query.index.sorted.keys.IndexKeyFactory;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.query.GridQueryProperty;
+import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
+import org.apache.ignite.internal.processors.query.QueryUtils;
+import org.apache.ignite.lang.IgniteBiTuple;
+
+import static org.apache.ignite.internal.cache.query.index.SortOrder.DESC;
+
+/**
+ * Reducer for {@code IndexQuery} results.
+ */
+public class IndexQueryReducer<R> extends MergeSortCacheQueryReducer<R> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Future that will be completed with first page response. */
+ private final CompletableFuture<IndexQueryResultMeta> meta;
Review comment:
`fut` word missed
BTW, why not `IgniteInternalFuture`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]