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
public class FileStoreMonitor extends ActiveMQScheduledComponent
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 Classes Modifier and Type Class Description static interfaceFileStoreMonitor.Callback
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
executor, scheduledExecutorService
-
-
Constructor Summary
Constructors Constructor Description FileStoreMonitor(ScheduledExecutorService scheduledExecutorService, Executor executor, long checkPeriod, TimeUnit timeUnit, double maxUsage, IOCriticalErrorListener ioCriticalErrorListener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FileStoreMonitoraddCallback(FileStoreMonitor.Callback callback)FileStoreMonitoraddStore(File file)FileStoreMonitoraddStore(FileStore store)static doublecalculateUsage(long usableSpace, long totalSpace)doublegetMaxUsage()voidrun()FileStoreMonitorsetMaxUsage(double maxUsage)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, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
-
-
-
Constructor Detail
-
FileStoreMonitor
public FileStoreMonitor(ScheduledExecutorService scheduledExecutorService, Executor executor, long checkPeriod, TimeUnit timeUnit, double maxUsage, IOCriticalErrorListener ioCriticalErrorListener)
-
-
Method Detail
-
addCallback
public FileStoreMonitor addCallback(FileStoreMonitor.Callback callback)
-
addStore
public FileStoreMonitor addStore(File file) throws IOException
- Throws:
IOException
-
addStore
public FileStoreMonitor addStore(FileStore store)
-
run
public void run()
-
tick
public void tick()
-
getMaxUsage
public double getMaxUsage()
-
setMaxUsage
public FileStoreMonitor setMaxUsage(double maxUsage)
-
calculateUsage
public static double calculateUsage(long usableSpace, long totalSpace)
-
-