directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1382934 - in /directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm: JdbmIndex.java JdbmPartition.java JdbmRdnIndex.java
Date Mon, 10 Sep 2012 15:16:42 GMT
Author: elecharny
Date: Mon Sep 10 15:16:41 2012
New Revision: 1382934

URL: http://svn.apache.org/viewvc?rev=1382934&view=rev
Log:
Using the Jdbm CacheManager to speed up the server (except for the RDN index)

Modified:
    directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
    directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java

Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1382934&r1=1382933&r2=1382934&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
Mon Sep 10 15:16:41 2012
@@ -26,7 +26,9 @@ import java.io.IOException;
 import java.net.URI;
 
 import jdbm.RecordManager;
+import jdbm.helper.MRU;
 import jdbm.recman.BaseRecordManager;
+import jdbm.recman.CacheRecordManager;
 
 import org.apache.directory.server.core.partition.impl.btree.IndexCursorAdaptor;
 import org.apache.directory.server.i18n.I18n;
@@ -155,7 +157,8 @@ public class JdbmIndex<K, V> extends Abs
 
         String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();
 
-        recMan = new BaseRecordManager( path );
+        BaseRecordManager base = new BaseRecordManager( path );
+        recMan = new CacheRecordManager( base, new MRU( DEFAULT_INDEX_CACHE_SIZE ) );
 
         try
         {

Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=1382934&r1=1382933&r2=1382934&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
Mon Sep 10 15:16:41 2012
@@ -29,7 +29,9 @@ import java.util.Arrays;
 import java.util.List;
 
 import jdbm.RecordManager;
+import jdbm.helper.MRU;
 import jdbm.recman.BaseRecordManager;
+import jdbm.recman.CacheRecordManager;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.api.partition.Partition;
@@ -131,7 +133,9 @@ public class JdbmPartition extends Abstr
 
             // First, check if the file storing the data exists
             String path = partitionDir.getPath() + File.separator + "master";
-            recMan = new BaseRecordManager( path );
+
+            BaseRecordManager base = new BaseRecordManager( path );
+            base.disableTransactions();
 
             if ( cacheSize < 0 )
             {
@@ -143,6 +147,8 @@ public class JdbmPartition extends Abstr
                 LOG.debug( "Using the custom configured cache size of {} for {} partition",
cacheSize, id );
             }
 
+            recMan = new CacheRecordManager( base, new MRU( cacheSize ) );
+
             // Create the master table (the table containing all the entries)
             master = new JdbmMasterTable( recMan, schemaManager );
 

Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java?rev=1382934&r1=1382933&r2=1382934&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
Mon Sep 10 15:16:41 2012
@@ -82,8 +82,10 @@ public class JdbmRdnIndex extends JdbmIn
 
         String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();
 
-        //System.out.println( "IDX Created index " + path );
-        recMan = new BaseRecordManager( path );
+        //System.out.println( "IDX Created index " + path )
+        BaseRecordManager base = new BaseRecordManager( path );
+        base.disableTransactions();
+        recMan = base; //new CacheRecordManager( base, new MRU( cacheSize ) );
 
         try
         {



Mime
View raw message