activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r900420 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java
Date Mon, 18 Jan 2010 15:17:51 GMT
Author: rajdavies
Date: Mon Jan 18 15:17:44 2010
New Revision: 900420

URL: http://svn.apache.org/viewvc?rev=900420&view=rev
Log:
added size() method to return amount of disk space the store occupies on disk

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java?rev=900420&r1=900419&r2=900420&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java
Mon Jan 18 15:17:44 2010
@@ -172,6 +172,17 @@
     public void setDirectory(File directory) {
         this.directory = directory;
     }
+    
+    public long size() {
+        if ( !isStarted() ) {
+            return 0;
+        }
+        try {
+            return journal.getDiskSize() + pageFile.getDiskSize();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
 
     public JobScheduler getJobScheduler(final String name) throws Exception {
         JobSchedulerImpl result = this.schedulers.get(name);



Mime
View raw message