cryptoe commented on code in PR #16481: URL: https://github.com/apache/druid/pull/16481#discussion_r1609306271
########## extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/RetryableS3OutputStream.java: ########## @@ -103,13 +109,35 @@ public class RetryableS3OutputStream extends OutputStream private boolean error; private boolean closed; + /** + * A map to store number of files pending to be uploaded for a given uploadId. + */ + private static final ConcurrentHashMap<String, AtomicInteger> PENDING_FILES = new ConcurrentHashMap<>(); + + /** + * A map containing the lock for a given uploadId used for notifying the main thread about the completion of + * s3.uploadPart() for all chunks for the uploadId, and hence starting the s3.completeMultipartUpload() for + * the uploadId. + */ + private static final ConcurrentHashMap<String, Object> FILE_LOCK_MAP = new ConcurrentHashMap<>(); + + /** + * Semaphore to restrict the maximum number of simultaneous chunks on disk. + */ + private static final int MAX_CONCURRENT_CHUNKS = 10; Review Comment: This is dependent on * Size of the local disk we have * SIze of the chunk * Number of upload threads So we need to come up with a formula like `WorkerStorageParameters` -- 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]
