directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1371866 - /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Date Sat, 11 Aug 2012 04:03:49 GMT
Author: gokturk
Date: Sat Aug 11 04:03:48 2012
New Revision: 1371866

URL: http://svn.apache.org/viewvc?rev=1371866&view=rev
Log:
* Removed the 'top' check on objectclass index at removals as a cleanup mechanism when old
partition files are used directly.
* lookup method is fixed for this scenario:
    LookupContext has attributeIds containing ALL_OPERATIONAL and couple of user attributes.
Before then, code was discarding the all user attributes completely on this scenario.
    *Formatted the code with Directory formatter

Modified:
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1371866&r1=1371865&r2=1371866&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Sat Aug 11 04:03:48 2012
@@ -855,10 +855,6 @@ public abstract class AbstractBTreeParti
             // Update the ObjectClass index
             for ( Value<?> value : objectClass )
             {
-                if ( value.equals( SchemaConstants.TOP_OC ) )
-                {
-                    continue;
-                }
                 objectClassIdx.drop( value.getString(), id );
             }
 
@@ -1043,10 +1039,14 @@ public abstract class AbstractBTreeParti
                 for ( Attribute attribute : ( ( ( ClonedServerEntry ) entry ).getOriginalEntry()
).getAttributes() )
                 {
                     AttributeType attributeType = attribute.getAttributeType();
+                    String oid = attributeType.getOid();
 
                     if ( attributeType.getUsage() == UsageEnum.USER_APPLICATIONS )
                     {
-                        entry.removeAttributes( attributeType );
+                        if ( !lookupContext.getAttrsId().contains( oid ) )
+                        {
+                            entry.removeAttributes( attributeType );
+                        }
                     }
                 }
             }
@@ -1305,6 +1305,11 @@ public abstract class AbstractBTreeParti
 
             for ( Value<?> value : mods )
             {
+                if ( value.equals( SchemaConstants.TOP_OC ) )
+                {
+                    continue;
+                }
+
                 objectClassIdx.add( ( String ) value.getNormValue(), id );
             }
         }



Mime
View raw message