activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r741600 - /activemq/trunk/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java
Date Fri, 06 Feb 2009 15:54:20 GMT
Author: chirino
Date: Fri Feb  6 15:54:19 2009
New Revision: 741600

URL: http://svn.apache.org/viewvc?rev=741600&view=rev
Log:
Making the removeDataFile a little smarter to avoid removing data files that are still being
worked on

Modified:
    activemq/trunk/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java

Modified: activemq/trunk/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java
URL: http://svn.apache.org/viewvc/activemq/trunk/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java?rev=741600&r1=741599&r2=741600&view=diff
==============================================================================
--- activemq/trunk/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java (original)
+++ activemq/trunk/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java Fri Feb  6
15:54:19 2009
@@ -295,12 +295,14 @@
 
     public synchronized void removeDataFiles(Set<Integer> files) throws IOException
{
         for (Integer key : files) {
+            // Can't remove the data file (or subsequent files) that is currently being written
to.
+        	if( key >= lastAppendLocation.get().getDataFileId() ) {
+        		continue;
+        	}
             DataFile dataFile = fileMap.get(key);
-            // Can't remove the last file.
-            if( dataFile == dataFiles.getTail() ) {
-                continue;
+            if( dataFile!=null ) {
+            	forceRemoveDataFile(dataFile);
             }
-            forceRemoveDataFile(dataFile);
         }
     }
 



Mime
View raw message