Akshat-Jain commented on code in PR #16481:
URL: https://github.com/apache/druid/pull/16481#discussion_r1615463749


##########
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:
   @cryptoe I'm a bit confused on this. The `maxConcurrentChunks` should be the 
same across all instances of `RetryableS3OutputStream` (IIUC??), but `SIze of 
the chunk` is a per-instance property for RetryableS3OutputStream.
   
   Similar confusion for adding a dependency on `Number of upload threads`.
   
   Appreciate your inputs, thanks!



-- 
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]

Reply via email to