Class NamedMemoryLimiter
java.lang.Object
org.apache.cassandra.index.sai.utils.NamedMemoryLimiter
A simple, thread-safe memory usage tracker, named to reflect a particular scope.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglongdecrement(long bytes) longincrement(long bytes) longvoidsetLimitBytes(long bytes) boolean
-
Constructor Details
-
NamedMemoryLimiter
-
-
Method Details
-
usageExceedsLimit
public boolean usageExceedsLimit()- Returns:
- true if the current number of bytes allocated against the tracker has breached the limit, false otherwise
-
increment
public long increment(long bytes) -
decrement
public long decrement(long bytes) -
currentBytesUsed
public long currentBytesUsed() -
limitBytes
public long limitBytes() -
setLimitBytes
public void setLimitBytes(long bytes)
-