amogh-jahagirdar commented on a change in pull request #4342:
URL: https://github.com/apache/iceberg/pull/4342#discussion_r831631757
##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -94,6 +107,19 @@ public S3FileIO(SerializableSupplier<S3Client> s3) {
public S3FileIO(SerializableSupplier<S3Client> s3, AwsProperties
awsProperties) {
this.s3 = s3;
this.awsProperties = awsProperties;
+ if (executorService == null) {
+ synchronized (S3OutputStream.class) {
+ if (executorService == null) {
+ executorService = MoreExecutors.getExitingExecutorService(
+ (ThreadPoolExecutor) Executors.newFixedThreadPool(
+ awsProperties.s3FileIoDeleteTagThreads(),
+ new ThreadFactoryBuilder()
+ .setDaemon(true)
+ .setNameFormat("iceberg-s3fileio-deletetags-%d")
+ .build()));
+ }
+ }
+ }
Review comment:
I think there's a utility for this that we can leverage.
ThreadPools.newWorkerPool(String namePrefix, int poolSize)
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/util/ThreadPools.java#L62
--
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]