You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "xloya (via GitHub)" <gi...@apache.org> on 2023/03/30 04:16:35 UTC

[GitHub] [iceberg] xloya commented on pull request #7240: Spark: Close the delete threads pool in some actions like DeleteOrphan or ExpireSnapshots

xloya commented on PR #7240:
URL: https://github.com/apache/iceberg/pull/7240#issuecomment-1489665872

   Another improve method is to close it only in the CALL Procedure, because a new thread pool is created every time in the Procedure like this:  
   `  protected ExecutorService executorService(int threadPoolSize, String nameFormat) {
       Preconditions.checkArgument(
           executorService == null, "Cannot create a new executor service, one already exists.");
       Preconditions.checkArgument(
           nameFormat != null, "Cannot create a service with null nameFormat arg");
       this.executorService =
           MoreExecutors.getExitingExecutorService(
               (ThreadPoolExecutor)
                   Executors.newFixedThreadPool(
                       threadPoolSize,
                       new ThreadFactoryBuilder()
                           .setDaemon(true)
                           .setNameFormat(nameFormat + "-%d")
                           .build()));
   
       return executorService;
     }`


-- 
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@iceberg.apache.org

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


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