directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1551486 - in /directory/mavibot/trunk/mavibot/src: main/java/org/apache/directory/mavibot/btree/PersistedBTree.java test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java
Date Tue, 17 Dec 2013 08:40:05 GMT
Author: elecharny
Date: Tue Dec 17 08:40:05 2013
New Revision: 1551486

URL: http://svn.apache.org/r1551486
Log:
o Cleaned the cache at shutdown
o Close the Btree and deleted the temp file in one test

Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java?rev=1551486&r1=1551485&r2=1551486&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
Tue Dec 17 08:40:05 2013
@@ -303,6 +303,10 @@ public class PersistedBTree<K, V> extend
         // Stop the readTransaction thread
         // readTransactionsThread.interrupt();
         // readTransactions.clear();
+        
+        // Clean the cache
+        cache.removeAll();
+        cache.dispose();
 
         rootPage = null;
     }

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java?rev=1551486&r1=1551485&r2=1551486&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java
Tue Dec 17 08:40:05 2013
@@ -35,6 +35,7 @@ import org.apache.directory.mavibot.btre
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -77,6 +78,20 @@ public class RecordManagerFreePageTest
             throw new RuntimeException( e );
         }
     }
+    
+    
+    @After
+    public void cleanup() throws IOException
+    {
+        dataDir = new File( System.getProperty( "java.io.tmpdir" ) + "/recordman" );
+        
+        btree.close();
+
+        if ( dataDir.exists() )
+        {
+            FileUtils.deleteDirectory( dataDir );
+        }
+    }
 
 
     private void openRecordManagerAndBtree()



Mime
View raw message