directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r419981 - in /directory/branches/apacheds/optimization: core/src/main/java/org/apache/directory/server/core/configuration/ core/src/main/java/org/apache/directory/server/core/partition/ core/src/main/java/org/apache/directory/server/core/pa...
Date Fri, 07 Jul 2006 20:53:41 GMT
Author: akarasulu
Date: Fri Jul  7 13:53:40 2006
New Revision: 419981

URL: http://svn.apache.org/viewvc?rev=419981&view=rev
Log: (empty)

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java
    directory/branches/apacheds/optimization/server-installers/src/main/installers/server.xml
    directory/branches/apacheds/optimization/server-main/server.xml

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java?rev=419981&r1=419980&r2=419981&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java
Fri Jul  7 13:53:40 2006
@@ -45,8 +45,10 @@
 {
     /** The name of reserved system partition */
     public static final String SYSTEM_PARTITION_NAME = "system";
+    public static final int DEFAULT_CACHE_SIZE = 1000;
 
     private String name;
+    private int cacheSize = -1;
     private String suffix;
     private Set indexedAttributes; // Set<String> or <IndexConfiguration>
     private Attributes contextEntry = new BasicAttributes( true );
@@ -204,5 +206,27 @@
         {
             throw new ConfigurationException( "Suffix is not specified." );
         }
+    }
+
+
+    /**
+     * Used to specify the entry cache size for a partition.  Various partition
+     * implementations may interpret this value in different ways: i.e. total cache 
+     * size limit verses the number of entries to cache.
+     * 
+     * @param cacheSize the size of the cache
+     */
+    protected void setCacheSize( int cacheSize )
+    {
+        this.cacheSize = cacheSize;
+    }
+
+
+    /**
+     * Get's the entry cache size for this partition.
+     */
+    public int getCacheSize()
+    {
+        return cacheSize;
     }
 }

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java?rev=419981&r1=419980&r2=419981&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java
Fri Jul  7 13:53:40 2006
@@ -71,4 +71,13 @@
     {
         super.setSuffix( suffix );
     }
+    
+    
+    /**
+     * Get's the entry cache size for this partition.
+     */
+    public void setCacheSize( int cacheSize )
+    {
+        super.setCacheSize( cacheSize );
+    }
 }

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java?rev=419981&r1=419980&r2=419981&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
Fri Jul  7 13:53:40 2006
@@ -231,6 +231,10 @@
         MutableDirectoryPartitionConfiguration systemCfg = new MutableDirectoryPartitionConfiguration();
         system = new JdbmDirectoryPartition(); // using default implementation.
         systemCfg.setName( "system" );
+        
+        // @TODO need to make this configurable for the system partition
+        systemCfg.setCacheSize( 500 );
+        
         systemCfg.setSuffix( DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX );
         systemCfg.setContextPartition( system );
 

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java?rev=419981&r1=419980&r2=419981&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java
Fri Jul  7 13:53:40 2006
@@ -145,7 +145,20 @@
             String path = workingDirectory.getPath() + File.separator + "master";
             BaseRecordManager base = new BaseRecordManager( path );
             base.disableTransactions();
-            recMan = new CacheRecordManager( base, new MRU( 1000 ) );
+            
+            int cacheSize = cfg.getCacheSize();
+            if ( cacheSize < 0 )
+            {
+                cacheSize = DirectoryPartitionConfiguration.DEFAULT_CACHE_SIZE;
+                log.warn( "Using the default entry cache size of {} for {} partition", 
+                    new Integer( cacheSize ), cfg.getName() );
+            }
+            else
+            {
+                log.info( "Using the custom configured cache size of {} for {} partition",

+                    new Integer( cacheSize ), cfg.getName() );
+            }
+            recMan = new CacheRecordManager( base, new MRU( cacheSize ) );
         }
         catch ( IOException e )
         {

Modified: directory/branches/apacheds/optimization/server-installers/src/main/installers/server.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/server-installers/src/main/installers/server.xml?rev=419981&r1=419980&r2=419981&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/server-installers/src/main/installers/server.xml
(original)
+++ directory/branches/apacheds/optimization/server-installers/src/main/installers/server.xml
Fri Jul  7 13:53:40 2006
@@ -161,6 +161,7 @@
   
   <bean id="examplePartitionConfiguration" class="org.apache.directory.server.core.configuration.MutableDirectoryPartitionConfiguration">
     <property name="name"><value>example</value></property>
+    <property name="cacheSize"><value>5000</value></property>
     <property name="suffix"><value>dc=example,dc=com</value></property>
     <property name="indexedAttributes">
       <set>

Modified: directory/branches/apacheds/optimization/server-main/server.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/server-main/server.xml?rev=419981&r1=419980&r2=419981&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/server-main/server.xml (original)
+++ directory/branches/apacheds/optimization/server-main/server.xml Fri Jul  7 13:53:40 2006
@@ -161,6 +161,7 @@
   
   <bean id="examplePartitionConfiguration" class="org.apache.directory.server.core.configuration.MutableDirectoryPartitionConfiguration">
     <property name="name"><value>example</value></property>
+    <property name="cacheSize"><value>5000</value></property>
     <property name="suffix"><value>dc=example,dc=com</value></property>
     <property name="indexedAttributes">
       <set>



Mime
View raw message