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


##########
modules/api/src/main/java/org/apache/ignite/sql/ClosableCursor.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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;
+
+import java.util.Iterator;
+import java.util.Spliterators;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+import org.apache.ignite.table.KeyValueView;
+import org.apache.ignite.table.RecordView;
+import org.apache.ignite.table.criteria.Criteria;
+import org.apache.ignite.table.criteria.CriteriaQueryOptions;
+import org.apache.ignite.tx.Transaction;
+
+/**
+ * An iterator over a query results.
+ *
+ * @param <T> The type of elements returned by this iterator.
+ *
+ * @see KeyValueView#queryCriteria(Transaction, Criteria, CriteriaQueryOptions)
+ * @see RecordView#queryCriteria(Transaction, Criteria, CriteriaQueryOptions)
+ */
+public interface ClosableCursor<T> extends Iterator<T>, AutoCloseable {
+    /**
+     * Returns a sequential Stream over the elements covered by this iterator.
+     *
+     * @return Sequential Stream over the elements covered by this iterator.
+     */
+    default Stream<T> stream() {

Review Comment:
   Why do you want the utility method has as part of interface?



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