szetszwo commented on PR #8203:
URL: https://github.com/apache/ozone/pull/8203#issuecomment-2931619184
@sumitagrawl , @swamirishi ,
Below are the current API methods
```java
//Table.java
TableIterator<KEY, ? extends KeyValue<KEY, VALUE>> iterator() throws
IOException;
TableIterator<KEY, ? extends KeyValue<KEY, VALUE>> iterator(KEY prefix)
throws IOException;
```
The new API method should look like:
```java
TableIterator<KEY, ? extends KeyValue<KEY, VALUE>> iterator(KEY prefix,
Executor executor, boolean ordered) throws IOException;
```
See also [this
comment](https://github.com/apache/ozone/pull/8203#discussion_r2049466909).
The existing methods could should just pass null for executor and true for
ordered to the new method. When executor is non-null, the new implementation
will use it for parallel execution. When it is null, it will use the existing
(single-thread) implementation.
`SplitIterator` and reference count are all implementation detail in the new
implementation. It should not be exposed to the API. (Just like that iterator
can use `CodecBuffer` or `byte[]`. They are not in the API.)
It there is a need, we could add a nextAsync() method to TableIterator for
asynchronous execution at the caller side, i.e. the caller can process the
elements in parallel.
```java
//TableIterator
CompletableFuture<T> nextAsync();
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]