Class QuotaManager


  • public class QuotaManager
    extends java.lang.Object
    A class to manage requests based on request context.
    • Constructor Summary

      Constructors 
      Constructor Description
      QuotaManager​(com.github.ambry.config.FrontendConfig frontendConfig)  
      QuotaManager​(java.util.Map<com.github.ambry.rest.RestMethod,​com.github.ambry.utils.RejectThrottler> quotaMap)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean shouldThrottle​(com.github.ambry.rest.RestRequest restRequest)
      Return true if throttling is required.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QuotaManager

        public QuotaManager​(com.github.ambry.config.FrontendConfig frontendConfig)
      • QuotaManager

        public QuotaManager​(java.util.Map<com.github.ambry.rest.RestMethod,​com.github.ambry.utils.RejectThrottler> quotaMap)
    • Method Detail

      • shouldThrottle

        public boolean shouldThrottle​(com.github.ambry.rest.RestRequest restRequest)
        Return true if throttling is required. Return false if no throttler for this rest method or quota is not reached.
        Parameters:
        restRequest - provides the information.