sodonnel commented on a change in pull request #2973:
URL: https://github.com/apache/ozone/pull/2973#discussion_r784153624



##########
File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/ExcludeList.java
##########
@@ -34,31 +37,54 @@
  */
 public class ExcludeList {
 
-  private final Set<DatanodeDetails> datanodes;
+  private final Map<DatanodeDetails, Long> datanodes;
   private final Set<ContainerID> containerIds;
   private final Set<PipelineID> pipelineIds;
+  private long expiryTime = 0;
+  private java.time.Clock clock;
 
 
   public ExcludeList() {
-    datanodes = new HashSet<>();
+    datanodes = new HashMap<>();
     containerIds = new HashSet<>();
     pipelineIds = new HashSet<>();
   }
 
+  public ExcludeList(long autoExpiryTime, java.time.Clock clock) {
+    this();
+    this.expiryTime = autoExpiryTime;
+    this.clock = clock;
+  }
+
   public Set<ContainerID> getContainerIds() {
     return containerIds;
   }
 
   public Set<DatanodeDetails> getDatanodes() {
-    return datanodes;
+    if (expiryTime > 0) {

Review comment:
       The way this method is now, we will need to iterate the nodes twice - 
once to remove the expired ones and then once to form the new Set. It would 
probably be a tiny bit more efficient to just combine the two into one 
iteration.




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