directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r939492 - /directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
Date Thu, 29 Apr 2010 22:04:45 GMT
Author: seelmann
Date: Thu Apr 29 22:04:45 2010
New Revision: 939492

URL: http://svn.apache.org/viewvc?rev=939492&view=rev
Log:
no need to build the new DN, just update the RDN index

Modified:
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java?rev=939492&r1=939491&r2=939492&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
Thu Apr 29 22:04:45 2010
@@ -1251,6 +1251,8 @@ public class JdbmStore<E> extends Abstra
         Long id = getEntryId( dn );
         Entry entry = lookup( id );
         DN updn = entry.getDn();
+        
+        newRdn.normalize( schemaManager.getNormalizerMapping() );
 
         /* 
          * H A N D L E   N E W   R D N
@@ -1344,25 +1346,14 @@ public class JdbmStore<E> extends Abstra
         /*
          * H A N D L E   D N   C H A N G E
          * ====================================================================
-         * 1) Build the new user defined distinguished name
-         *      - clone / copy old updn
-         *      - remove old upRdn from copy
-         *      - add the new upRdn to the copy
-         * 2) Make call to recursive modifyDn method to change the names of the
-         *    entry and its descendants
+         * We only need to update the RDN index.
+         * No need to calculate the new DN.
          */
 
-        DN newUpdn = ( DN ) updn.clone(); // copy da old updn
-        newUpdn.remove( newUpdn.size() - 1 ); // remove old upRdn
-        newUpdn.add( newRdn.getName() ); // add da new upRdn
-
-        // gotta normalize cuz this thang is cloned and not normalized by default
-        newUpdn.normalize( schemaManager.getNormalizerMapping() );
-
-        modifyDn( id, newUpdn, false ); // propagate dn changes
-
-        // Update the current entry
-        entry.setDn( newUpdn );
+        Long parentId = getParentId( id );
+        rdnIdx.drop( id );
+        ParentIdAndRdn<Long> key = new ParentIdAndRdn<Long>( parentId, newRdn
);
+        rdnIdx.add( key, id );
 
         master.put( id, entry );
 



Mime
View raw message