sarvekshayr commented on code in PR #11662:
URL: https://github.com/apache/ozone/pull/11662#discussion_r4350919692


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/export/ContainerExportManager.java:
##########
@@ -70,20 +79,25 @@ public class ContainerExportManager {
   private final ExportFileManager fileManager;
   private final BooleanSupplier isLeaderReady;
   private final ExportSizing defaultSizing;
+  private final int maxRetained;
+  // Both deque are only touched by the single worker thread, and by start() 
before any job is submitted.
+  private final Deque<ExportJob.Id> finishedJobIds = new ArrayDeque<>();
+  private final Deque<String> completedArchiveNames = new ArrayDeque<>();
 
   public ContainerExportManager(String scmId, ContainerManager 
containerManager, BooleanSupplier isLeaderReady,
       OzoneConfiguration conf) {
     this(scmId, containerManager, isLeaderReady,
-        ExportFileManager.resolveExportDirectory(conf), DEFAULT_PART_SIZE, 
DEFAULT_BATCH_SIZE);
+        ExportFileManager.resolveExportDirectory(conf), DEFAULT_PART_SIZE, 
DEFAULT_BATCH_SIZE, DEFAULT_MAX_RETAINED);
   }
 
   ContainerExportManager(String scmId, ContainerManager containerManager, 
BooleanSupplier isLeaderReady,
-      String exportDirectory, int partSize, int batchSize) {
+      String exportDirectory, int partSize, int batchSize, int maxRetained) {
     this.defaultSizing = new ExportSizing(0, 0, 0, batchSize, partSize);
     this.containerManager = Objects.requireNonNull(containerManager, 
"containerManager == null");
     this.isLeaderReady = Objects.requireNonNull(isLeaderReady, "isLeaderReady 
== null");
     this.fileManager = new ExportFileManager(exportDirectory);
     this.workerPool = newWorkerPool(scmId);
+    this.maxRetained = maxRetained;

Review Comment:
   I had planned to add this after making it configurable, but I've updated the 
PR with validation now.



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