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



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/AbstractCacheQueryReducer.java
##########
@@ -0,0 +1,183 @@
+/*
+ * 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;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Queue;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.util.typedef.internal.U;
+
+/**
+ * Base abstract class for all Reducer descenders. It declares dependencies on 
cache query, and base logic for handling
+ * remote pages.
+ */
+public abstract class AbstractCacheQueryReducer<R> implements 
CacheQueryReducer<R> {
+    /** Query info. */
+    private final GridCacheQueryAdapter qry;
+
+    /** Flag shows whether all pages are ready. */
+    protected volatile boolean allPagesReady;
+
+    /** Timestamp when a query fails with timeout. */
+    private final long timeoutTime;
+
+    /** Lock shared between this reducer and future. */
+    private final Object sharedLock;
+
+    /**
+     * @param fut Cache query future relates to this query. Future is done 
when last page is delivered to reducer.
+     */
+    AbstractCacheQueryReducer(GridCacheQueryFutureAdapter fut) {
+        qry = fut.qry.query();
+        timeoutTime = fut.endTime();
+        // The only reason to use lock in 2 places is the deduplication 
mechanism.
+        sharedLock = fut.lock;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object sharedLock() {
+        return sharedLock;
+    }

Review comment:
       @AMashenkov hi! Thanks for review. I've removed this method from 
interface, and make protected.




-- 
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:
us...@infra.apache.org


Reply via email to