You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "javanna (via GitHub)" <gi...@apache.org> on 2023/09/20 10:18:56 UTC

[GitHub] [lucene] javanna opened a new pull request, #12574: Make TaskExecutor public

javanna opened a new pull request, #12574:
URL: https://github.com/apache/lucene/pull/12574

   TaskExecutor is currently package private. We have scenarios where we want to parallelize the execution and reuse it outside of its package, hence this commit makes it public.
   
   Note that its constructor remains package private as it is supposed to be created by the index searcher, and later retrieved from it via the appropriate getter, which is also made public as part of this commit.
   
   This is a pre-requisite for #12183 .


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] javanna merged pull request #12574: Make TaskExecutor public

Posted by "javanna (via GitHub)" <gi...@apache.org>.
javanna merged PR #12574:
URL: https://github.com/apache/lucene/pull/12574


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] javanna commented on a diff in pull request #12574: Make TaskExecutor public

Posted by "javanna (via GitHub)" <gi...@apache.org>.
javanna commented on code in PR #12574:
URL: https://github.com/apache/lucene/pull/12574#discussion_r1331497358


##########
lucene/core/src/java/org/apache/lucene/search/TaskExecutor.java:
##########
@@ -85,11 +85,24 @@ final <T> List<T> invokeAll(Collection<Task<T>> tasks) throws IOException {
     return results;
   }
 
-  final <C> Task<C> createTask(Callable<C> callable) {
+  /**
+   * Creates a task given the provided {@link Callable}
+   *
+   * @param callable the callable to be executed as part of the task
+   * @return the created task
+   * @param <C> the return type of the task
+   */
+  public <C> Task<C> createTask(Callable<C> callable) {
     return new Task<>(callable);
   }
 
-  static class Task<V> extends FutureTask<V> {
+  /**
+   * Extension of {@link FutureTask} that tracks the number of tasks that are running in each
+   * thread.
+   *
+   * @param <V> the return tyupe of the task

Review Comment:
   Thanks @gf2121 



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] gf2121 commented on a diff in pull request #12574: Make TaskExecutor public

Posted by "gf2121 (via GitHub)" <gi...@apache.org>.
gf2121 commented on code in PR #12574:
URL: https://github.com/apache/lucene/pull/12574#discussion_r1331468750


##########
lucene/core/src/java/org/apache/lucene/search/TaskExecutor.java:
##########
@@ -85,11 +85,24 @@ final <T> List<T> invokeAll(Collection<Task<T>> tasks) throws IOException {
     return results;
   }
 
-  final <C> Task<C> createTask(Callable<C> callable) {
+  /**
+   * Creates a task given the provided {@link Callable}
+   *
+   * @param callable the callable to be executed as part of the task
+   * @return the created task
+   * @param <C> the return type of the task
+   */
+  public <C> Task<C> createTask(Callable<C> callable) {
     return new Task<>(callable);
   }
 
-  static class Task<V> extends FutureTask<V> {
+  /**
+   * Extension of {@link FutureTask} that tracks the number of tasks that are running in each
+   * thread.
+   *
+   * @param <V> the return tyupe of the task

Review Comment:
   ```suggestion
      * @param <V> the return type of the task
   ```



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org