Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3501E9922 for ; Wed, 30 Nov 2011 09:42:02 +0000 (UTC) Received: (qmail 43831 invoked by uid 500); 30 Nov 2011 09:42:01 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 43751 invoked by uid 500); 30 Nov 2011 09:42:01 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 43341 invoked by uid 99); 30 Nov 2011 09:42:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 09:42:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 09:41:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9D9D623889FD for ; Wed, 30 Nov 2011 09:41:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1208348 [2/2] - in /directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server: core/partition/impl/btree/ xdbm/ xdbm/impl/avl/ xdbm/search/impl/ Date: Wed, 30 Nov 2011 09:41:36 -0000 To: commits@directory.apache.org From: saya@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111130094136.9D9D623889FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java?rev=1208348&r1=1208347&r2=1208348&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java (original) +++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java Wed Nov 30 09:41:34 2011 @@ -25,8 +25,10 @@ import java.util.UUID; import org.apache.directory.server.core.partition.impl.btree.LongComparator; import org.apache.directory.server.i18n.I18n; +import org.apache.directory.server.core.api.partition.index.ForwardIndexComparator; import org.apache.directory.server.core.api.partition.index.ParentIdAndRdn; import org.apache.directory.server.core.api.partition.index.ParentIdAndRdnComparator; +import org.apache.directory.server.core.api.partition.index.ReverseIndexComparator; import org.apache.directory.server.core.api.partition.index.UUIDComparator; import org.apache.directory.shared.ldap.model.schema.AttributeType; import org.apache.directory.shared.ldap.model.schema.MatchingRule; @@ -88,6 +90,9 @@ public class AvlRdnIndex extends AvlInde false ); reverse = new AvlTable( attributeType.getName(), UUIDComparator.INSTANCE, comp, false ); + + fIndexEntryComparator = new ForwardIndexComparator( comp ); + rIndexEntryComparator = new ReverseIndexComparator( comp ); } Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=1208348&r1=1208347&r2=1208348&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java (original) +++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java Wed Nov 30 09:41:34 2011 @@ -147,7 +147,7 @@ public class DefaultSearchEngine impleme // -------------------------------------------------------------------- // Determine the effective base with aliases // -------------------------------------------------------------------- - + /* * If the base is not an alias or if alias dereferencing does not * occur on finding the base then we set the effective base to the @@ -156,6 +156,9 @@ public class DefaultSearchEngine impleme if ( ( null == aliasedBase ) || !aliasDerefMode.isDerefFindingBase() ) { effectiveBase = base; + + // We depend on the provided base with the given scope + txnLogManager.addRead( base, SearchScope.values()[ searchCtls.getSearchScope() ] ); } /* @@ -166,6 +169,13 @@ public class DefaultSearchEngine impleme else { effectiveBase = new Dn( aliasedBase ); + + // Add dependency on the effective base with the given scope + txnLogManager.addRead( effectiveBase, SearchScope.values()[ searchCtls.getSearchScope() ] ); + + // We also depend on the base as we are routed through it. + txnLogManager.addRead( base, SearchScope.OBJECT ); + } // -------------------------------------------------------------------- Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java?rev=1208348&r1=1208347&r2=1208348&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java (original) +++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java Wed Nov 30 09:41:34 2011 @@ -30,11 +30,14 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.api.partition.index.IndexCursor; import org.apache.directory.server.core.api.partition.index.IndexEntry; import org.apache.directory.server.core.api.txn.TxnLogManager; +import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory; import org.apache.directory.server.core.shared.txn.TxnManagerFactory; import org.apache.directory.server.xdbm.Store; import org.apache.directory.shared.ldap.model.cursor.Cursor; import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException; import org.apache.directory.shared.ldap.model.entry.Entry; +import org.apache.directory.shared.ldap.model.message.SearchScope; +import org.apache.directory.shared.ldap.model.name.Dn; /** @@ -66,7 +69,7 @@ public class OneLevelScopeCursor extends /** Alias idx set if dereferencing aliases */ private Index aliasIdx; - + /** * Creates a Cursor over entries satisfying one level scope criteria. @@ -291,7 +294,20 @@ public class OneLevelScopeCursor extends if ( available() ) { - return cursor.get(); + IndexEntry indexEntry = cursor.get(); + + /* + * If the entry is coming from the alias index, then search scope is enlarged + * to include the returned entry. + */ + + if ( cursor == dereferencedCursor ) + { + Dn aliasTargetDn = OperationExecutionManagerFactory.instance().buildEntryDn( db, indexEntry.getId() ); + TxnManagerFactory.txnLogManagerInstance().addRead( aliasTargetDn, SearchScope.OBJECT ); + } + + return indexEntry; } throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) ); Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java?rev=1208348&r1=1208347&r2=1208348&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java (original) +++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java Wed Nov 30 09:41:34 2011 @@ -36,6 +36,8 @@ import org.apache.directory.server.core. import org.apache.directory.server.xdbm.Store; import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException; import org.apache.directory.shared.ldap.model.entry.Entry; +import org.apache.directory.shared.ldap.model.message.SearchScope; +import org.apache.directory.shared.ldap.model.name.Dn; /** @@ -326,7 +328,20 @@ public class SubtreeScopeCursor extends if ( available() ) { - return cursor.get(); + IndexEntry indexEntry = cursor.get(); + + /* + * If the entry is coming from the alias index, then search scope is enlarged + * to include the returned entry. + */ + + if ( cursor == dereferencedCursor ) + { + Dn aliasTargetDn = OperationExecutionManagerFactory.instance().buildEntryDn( db, indexEntry.getId() ); + TxnManagerFactory.txnLogManagerInstance().addRead( aliasTargetDn, SearchScope.OBJECT ); + } + + return indexEntry; } throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );