directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1814571 - /directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
Date Wed, 08 Nov 2017 11:17:54 GMT
Author: elecharny
Date: Wed Nov  8 11:17:54 2017
New Revision: 1814571

URL: http://svn.apache.org/viewvc?rev=1814571&view=rev
Log:
Added a constructor that allows the cache to be sized

Modified:
    directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java

Modified: directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java?rev=1814571&r1=1814570&r2=1814571&view=diff
==============================================================================
--- directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
(original)
+++ directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
Wed Nov  8 11:17:54 2017
@@ -192,7 +192,7 @@ public class RecordManager implements Tr
      */
     public RecordManager( String fileName )
     {
-        this( fileName, BTreeConstants.DEFAULT_PAGE_SIZE );
+        this( fileName, BTreeConstants.DEFAULT_PAGE_SIZE, BTreeConstants.DEFAULT_CACHE_SIZE
);
     }
 
 
@@ -204,7 +204,7 @@ public class RecordManager implements Tr
      * @param name The file name, or a folder name
      * @param pageSize the size of a page on disk, in bytes
      */
-    public RecordManager( String fileName, int pageSize )
+    public RecordManager( String fileName, int pageSize, int cacheSize )
     {
         // Create the RMH
         RecordManagerHeader recordManagerHeader = new RecordManagerHeader();
@@ -241,7 +241,7 @@ public class RecordManager implements Tr
         CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder()
             .withCache( "pageCache", CacheConfigurationBuilder.
                 newCacheConfigurationBuilder( Long.class, Page.class, 
-                ResourcePoolsBuilder.heap( 10000 ) ) ).build( true );
+                ResourcePoolsBuilder.heap( cacheSize ) ) ).build( true );
 
         pageCache = cacheManager.getCache( "pageCache", Long.class, Page.class ); 
 



Mime
View raw message