sanpwc commented on code in PR #931:
URL: https://github.com/apache/ignite-3/pull/931#discussion_r916957679


##########
modules/metastorage-client/src/main/java/org/apache/ignite/internal/metastorage/client/CursorImpl.java:
##########
@@ -50,19 +52,41 @@
 
     private final Iterator<T> it;
 
-    private final Function<Object, T> fn;
+    /**
+     * Constructor.
+     *
+     * @param metaStorageRaftGrpSvc Meta storage raft group service.
+     * @param initOp                Future that runs meta storage service 
operation that provides cursor.
+     * @param fn                    Function transforming the element of type 
{@link M} to the type of {@link T}.
+     */
+    public <M> CursorImpl(
+            RaftGroupService metaStorageRaftGrpSvc,
+            CompletableFuture<IgniteUuid> initOp,
+            Function<M, T> fn
+    ) {
+        this.metaStorageRaftGrpSvc = metaStorageRaftGrpSvc;
+        this.initOp = initOp;
+        this.it = new InnerIterator(e -> singleton(e), fn);
+    }
 
     /**
      * Constructor.
      *
      * @param metaStorageRaftGrpSvc Meta storage raft group service.
      * @param initOp                Future that runs meta storage service 
operation that provides cursor.
+     * @param internalCacheFn       Function transforming the result of {@link 
CursorNextCommand} to the
+     *                              {@link Iterable} of elements of type 
{@link M}.
+     * @param fn                    Function transforming the element of type 
{@link M} to the type of {@link T}.
      */
-    CursorImpl(RaftGroupService metaStorageRaftGrpSvc, 
CompletableFuture<IgniteUuid> initOp, Function<Object, T> fn) {
+    public <M> CursorImpl(
+            RaftGroupService metaStorageRaftGrpSvc,
+            CompletableFuture<IgniteUuid> initOp,
+            Function<Object, Iterable<M>> internalCacheFn,

Review Comment:
   I don't think that we need two explicit transformation functions. Please 
consider approach that is used within
   `new CursorImpl<>(metaStorageRaftGrpSvc, watchRes, 
MetaStorageServiceImpl::watchResponse),`. 



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