Class ResourceQuota
- java.lang.Object
-
- org.apache.pulsar.common.policies.data.ResourceQuota
-
public class ResourceQuota extends java.lang.ObjectResource quota for a namespace or namespace bundle.
-
-
Constructor Summary
Constructors Constructor Description ResourceQuota()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ResourceQuota quota)Add quota.booleanequals(java.lang.Object obj)doublegetBandwidthIn()Get inbound bandwidth quota.doublegetBandwidthOut()Get outbound bandwidth quota.booleangetDynamic()Get dynamic setting.doublegetMemory()Get memory quota.doublegetMsgRateIn()Get incoming message rate quota.doublegetMsgRateOut()Get outgoing message rate quota.inthashCode()booleanisValid()Check if this is a valid quota definition.voidsetBandwidthIn(double bandwidthIn)Set inbound bandwidth quota.voidsetBandwidthOut(double bandwidthOut)Set outbound bandwidth quota.voidsetDynamic(boolean dynamic)Set dynamic to true/false.voidsetMemory(double memory)Set memory quota.voidsetMsgRateIn(double msgRateIn)Set incoming message rate quota.voidsetMsgRateOut(double msgRateOut)Set outgoing message rate quota.voidsubstract(ResourceQuota quota)Substract quota.
-
-
-
Method Detail
-
setMsgRateIn
public void setMsgRateIn(double msgRateIn)
Set incoming message rate quota.- Parameters:
msgRateIn- incoming messages rate quota (msg/sec)
-
getMsgRateIn
public double getMsgRateIn()
Get incoming message rate quota.- Returns:
- incoming message rate quota (msg/sec)
-
setMsgRateOut
public void setMsgRateOut(double msgRateOut)
Set outgoing message rate quota.- Parameters:
msgRateOut- outgoing messages rate quota (msg/sec)
-
getMsgRateOut
public double getMsgRateOut()
Get outgoing message rate quota.- Returns:
- outgoing message rate quota (msg/sec)
-
setBandwidthIn
public void setBandwidthIn(double bandwidthIn)
Set inbound bandwidth quota.- Parameters:
bandwidthIn- inbound bandwidth quota (bytes/sec)
-
getBandwidthIn
public double getBandwidthIn()
Get inbound bandwidth quota.- Returns:
- inbound bandwidth quota (bytes/sec)
-
setBandwidthOut
public void setBandwidthOut(double bandwidthOut)
Set outbound bandwidth quota.- Parameters:
bandwidthOut- outbound bandwidth quota (bytes/sec)
-
getBandwidthOut
public double getBandwidthOut()
Get outbound bandwidth quota.- Returns:
- outbound bandwidth quota (bytes/sec)
-
setMemory
public void setMemory(double memory)
Set memory quota.- Parameters:
memory- memory quota (Mbytes)
-
getMemory
public double getMemory()
Get memory quota.- Returns:
- memory quota (Mbytes)
-
setDynamic
public void setDynamic(boolean dynamic)
Set dynamic to true/false.- Parameters:
dynamic- allow the quota to be dynamically re-calculated
-
getDynamic
public boolean getDynamic()
Get dynamic setting.- Returns:
- is dynamic or not
-
isValid
public boolean isValid()
Check if this is a valid quota definition.
-
add
public void add(ResourceQuota quota)
Add quota.- Parameters:
quota-ResourceQuotato add
-
substract
public void substract(ResourceQuota quota)
Substract quota.- Parameters:
quota-ResourceQuotato substract
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-