Class UserQuotaRequestCostPolicy

  • All Implemented Interfaces:
    com.github.ambry.quota.RequestCostPolicy

    public class UserQuotaRequestCostPolicy
    extends java.lang.Object
    implements com.github.ambry.quota.RequestCostPolicy
    RequestCostPolicy implementation that calculates request cost in terms of metrics tracked by user quota - capacity unit and storage. Capacity unit cost is defined as the number of 4MB chunks. Storage cost is defined as number of GB of storage used.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Double> calculateRequestCost​(com.github.ambry.rest.RestRequest restRequest, com.github.ambry.rest.RestResponseChannel restResponseChannel, com.github.ambry.messageformat.BlobInfo blobInfo)  
      • Methods inherited from class java.lang.Object

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

      • UserQuotaRequestCostPolicy

        public UserQuotaRequestCostPolicy()
    • Method Detail

      • calculateRequestCost

        public java.util.Map<java.lang.String,​java.lang.Double> calculateRequestCost​(com.github.ambry.rest.RestRequest restRequest,
                                                                                           com.github.ambry.rest.RestResponseChannel restResponseChannel,
                                                                                           com.github.ambry.messageformat.BlobInfo blobInfo)
        Specified by:
        calculateRequestCost in interface com.github.ambry.quota.RequestCostPolicy