You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/10/06 22:12:44 UTC

[GitHub] [trafficserver] bneradt commented on a change in pull request #7243: RolledLogDeleter: do not sort on each candidate consideration.

bneradt commented on a change in pull request #7243:
URL: https://github.com/apache/trafficserver/pull/7243#discussion_r500625590



##########
File path: proxy/logging/RolledLogDeleter.h
##########
@@ -201,14 +201,27 @@ class RolledLogDeleter
    */
   void clear_candidates();
 
+private:
+  /** Sort all the assembled candidates for each LogDeletingInfo.
+   *
+   * After any additions to the @a deleting_info, this should be called before
+   * calling @a take_next_candidate_to_delete because the latter depends upon
+   * the candidate entries being sorted.
+   */
+  void sort_candidates();
+
 private:
   /** The owning references to the set of LogDeletingInfo added to the below
    * hash map. */
-  std::list<std::unique_ptr<LogDeletingInfo>> deletingInfoList;
+  std::deque<std::unique_ptr<LogDeletingInfo>> deletingInfoList;
 
   /** The set of candidates for deletion keyed by log_type. */
   IntrusiveHashMap<LogDeletingInfoDescriptor> deleting_info;
 
   /** The number of tracked candidates. */
   size_t num_candidates = 0;
+
+  /** Whether the candidates have been sorted since the last addition to the

Review comment:
       True. I'll update the comment.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org