nva commented on code in PR #2882:
URL: https://github.com/apache/ignite-3/pull/2882#discussion_r1432701048


##########
modules/api/src/main/java/org/apache/ignite/sql/async/AsyncClosableCursor.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.sql.async;
+
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.sql.NoRowSetExpectedException;
+
+/**
+ * Closeable cursor.
+ *
+ * @param <T> Type of elements.
+ */
+public interface AsyncClosableCursor<T> {
+    /**
+     * Returns the current page content if the query returns rows.
+     *
+     * @return Iterable set of rows.
+     * @throws NoRowSetExpectedException if no row set is returned.
+     */
+    Iterable<T> currentPage();
+
+    /**
+     * Returns the current page size if the query return rows.
+     *
+     * @return The size of {@link #currentPage()}.
+     * @throws NoRowSetExpectedException if no row set is returned.
+     */
+    int currentPageSize();
+
+    /**
+     * Fetches the next page of results asynchronously.
+     * The future that is completed with the same {@code AsyncResultSet} 
object.
+     * The current page is changed after the future completion.
+     * The methods {@link #currentPage()}, {@link #currentPageSize()}, {@link 
#hasMorePages()}
+     * use the current page and return consistent results between complete 
last page future and call {@code fetchNextPage}.
+     *
+     * @return Operation future.
+     * @throws NoRowSetExpectedException if no row set is expected as a query 
result.
+     */
+    CompletableFuture<? extends AsyncResultSet<T>> fetchNextPage();

Review Comment:
   Added by mistake, fixed



-- 
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]

Reply via email to