codelipenghui commented on a change in pull request #10093:
URL: https://github.com/apache/pulsar/pull/10093#discussion_r604951777



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2276,6 +2277,57 @@ public boolean isBacklogExceeded() {
         return (storageSize >= backlogQuotaLimitInBytes);
     }
 
+    /**
+     * @return determine if backlog quota enforcement needs to be done for 
topic based on time limit
+     */
+    public boolean isTimeBacklogExceeded() {

Review comment:
       A more efficient way to achieve this is based on the Ledger metadata, we 
can evaluated a time based on the Ledger create time, Ledger create time(next 
ledger create time) and the max entry Id of the ledger. So that we don't need 
to read an entry. Of course this will affect the accuracy of the limit,  but 
the way to read the entry every time will make the bookkeeper's burden heavier 
in a large number of topic cluster




-- 
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:
[email protected]


Reply via email to