Class FileStoreMonitor
java.lang.Object
org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
org.apache.activemq.artemis.core.server.files.FileStoreMonitor
- All Implemented Interfaces:
Runnable,ActiveMQComponent
This will keep a list of fileStores. It will make a comparison on all file stores registered. if any is over the
limit, all Callbacks will be called with over.
For instance: if Large Messages folder is registered on a different folder and it's over capacity, the whole system will be waiting it to be released.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enum -
Field Summary
Fields inherited from class org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
executor, scheduledExecutorService -
Constructor Summary
ConstructorsConstructorDescriptionFileStoreMonitor(ScheduledExecutorService scheduledExecutorService, Executor executor, long checkPeriod, TimeUnit timeUnit, Number referenceValue, IOCriticalErrorListener ioCriticalErrorListener, FileStoreMonitor.FileStoreMonitorType type) -
Method Summary
Modifier and TypeMethodDescriptionaddCallback(FileStoreMonitor.Callback callback) static doublecalculateUsage(long usableSpace, long totalSpace) doublelongremoveCallback(FileStoreMonitor.Callback callback) voidrun()setMaxUsage(double maxUsage) setMinDiskFree(long minDiskFree) voidtick()Methods inherited from class org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
delay, getInitialDelay, getPeriod, getThreadFactory, getTimeUnit, isStarted, setInitialDelay, setInitialDelayAndPeriod, setInitialDelayAndPeriod, setPeriod, setPeriod, setTimeUnit, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Constructor Details
-
FileStoreMonitor
public FileStoreMonitor(ScheduledExecutorService scheduledExecutorService, Executor executor, long checkPeriod, TimeUnit timeUnit, Number referenceValue, IOCriticalErrorListener ioCriticalErrorListener, FileStoreMonitor.FileStoreMonitorType type)
-
-
Method Details
-
addCallback
-
removeCallback
-
addStore
- Throws:
IOException
-
addStore
-
run
public void run() -
tick
public void tick() -
getMaxUsage
public double getMaxUsage() -
getMinDiskFree
public long getMinDiskFree() -
setMaxUsage
-
setMinDiskFree
-
calculateUsage
public static double calculateUsage(long usableSpace, long totalSpace)
-