directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r421263 - in /directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree: BTreePartitionConfiguration.java jdbm/JdbmDirectoryPartition.java
Date Wed, 12 Jul 2006 13:07:55 GMT
Author: akarasulu
Date: Wed Jul 12 06:07:54 2006
New Revision: 421263

URL: http://svn.apache.org/viewvc?rev=421263&view=rev
Log:
implement synchOnWrite for jdbm partition

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartitionConfiguration.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartitionConfiguration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartitionConfiguration.java?rev=421263&r1=421262&r2=421263&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartitionConfiguration.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartitionConfiguration.java
Wed Jul 12 06:07:54 2006
@@ -45,10 +45,8 @@
     }
 
     
-    public boolean isSynchImmediately()
+    public boolean isSynchOnWrite()
     {
         return synchOnWrite;
     }
-
-    
 }

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=421263&r1=421262&r2=421263&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
Wed Jul 12 06:07:54 2006
@@ -43,6 +43,7 @@
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.partition.DirectoryPartition;
 import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
+import org.apache.directory.server.core.partition.impl.btree.BTreePartitionConfiguration;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.IndexAssertion;
 import org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration;
@@ -111,6 +112,7 @@
     
     private OidRegistry oidRegistry;
     private AttributeTypeRegistry attrRegistry;
+    private BTreePartitionConfiguration cfg;
 
 
     // ------------------------------------------------------------------------
@@ -128,6 +130,7 @@
     public synchronized void init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration
cfg )
         throws NamingException
     {
+        this.cfg = ( BTreePartitionConfiguration ) cfg;
         oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
         attrRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
         this.upSuffix = new LdapDN( cfg.getSuffix() );
@@ -857,6 +860,11 @@
         }
 
         master.put( entry, id );
+        
+        if ( cfg.isSynchOnWrite() )
+        {
+            sync();
+        }
     }
 
 
@@ -912,6 +920,11 @@
         }
 
         master.delete( id );
+        
+        if ( cfg.isSynchOnWrite() )
+        {
+            sync();
+        }
     }
 
 
@@ -1245,6 +1258,11 @@
         }
 
         master.put( entry, id );
+        
+        if ( cfg.isSynchOnWrite() )
+        {
+            sync();
+        }
     }
 
 
@@ -1274,6 +1292,11 @@
         }
 
         master.put( entry, id );
+        
+        if ( cfg.isSynchOnWrite() )
+        {
+            sync();
+        }
     }
 
 
@@ -1394,6 +1417,11 @@
         newUpdn.remove( newUpdn.size() - 1 ); // remove old upRdn
         newUpdn.add( newUpdn.size(), newRdn ); // add da new upRdn
         modifyDn( id, newUpdn, false ); // propagate dn changes
+        
+        if ( cfg.isSynchOnWrite() )
+        {
+            sync();
+        }
     }
 
 
@@ -1474,6 +1502,11 @@
         BigInteger childId = getEntryId( oldChildDn.toString() );
         modifyRn( oldChildDn, newRdn, deleteOldRdn );
         move( oldChildDn, childId, newParentDn );
+        
+        if ( cfg.isSynchOnWrite() )
+        {
+            sync();
+        }
     }
 
 
@@ -1481,6 +1514,11 @@
     {
         BigInteger childId = getEntryId( oldChildDn.toString() );
         move( oldChildDn, childId, newParentDn );
+        
+        if ( cfg.isSynchOnWrite() )
+        {
+            sync();
+        }
     }
 
 



Mime
View raw message