Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff ============================================================================== --- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java (original) +++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java Wed Apr 11 05:30:46 2012 @@ -34,6 +34,8 @@ import org.apache.directory.shared.ldap. 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.filter.ExprNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -43,6 +45,9 @@ import org.apache.directory.shared.ldap. */ public class OrCursor extends AbstractIndexCursor { + /** A dedicated log for cursors */ + private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" ); + private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_722 ); private final List> cursors; private final List> evaluators; @@ -54,6 +59,8 @@ public class OrCursor extends Abs public OrCursor( List> cursors, List> evaluators ) { + LOG_CURSOR.debug( "Creating OrCursor {}", this ); + if ( cursors.size() <= 1 ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_723 ) ); @@ -63,10 +70,11 @@ public class OrCursor extends Abs this.evaluators = evaluators; this.blacklists = new ArrayList>(); - for ( int ii = 0; ii < cursors.size(); ii++ ) + for ( int i = 0; i < cursors.size(); i++ ) { this.blacklists.add( new HashSet() ); } + this.cursorIndex = 0; } @@ -235,10 +243,24 @@ public class OrCursor extends Abs public void close() throws Exception { + LOG_CURSOR.debug( "Closing OrCursor {}", this ); super.close(); + for ( Cursor cursor : cursors ) { cursor.close(); } } + + + public void close( Exception cause ) throws Exception + { + LOG_CURSOR.debug( "Closing OrCursor {}", this ); + super.close( cause ); + + for ( Cursor cursor : cursors ) + { + cursor.close( cause ); + } + } } \ No newline at end of file Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff ============================================================================== --- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java (original) +++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java Wed Apr 11 05:30:46 2012 @@ -28,6 +28,8 @@ import org.apache.directory.server.xdbm. 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.schema.AttributeType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -37,6 +39,9 @@ import org.apache.directory.shared.ldap. */ public class PresenceCursor> extends AbstractIndexCursor { + /** A dedicated log for cursors */ + private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" ); + private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_724 ); private final IndexCursor uuidCursor; private final IndexCursor presenceCursor; @@ -45,6 +50,7 @@ public class PresenceCursor store, PresenceEvaluator presenceEvaluator ) throws Exception { + LOG_CURSOR.debug( "Creating PresenceCursor {}", this ); this.presenceEvaluator = presenceEvaluator; AttributeType type = presenceEvaluator.getAttributeType(); @@ -295,6 +301,7 @@ public class PresenceCursor> extends AbstractIndexCursor { + /** A dedicated log for cursors */ + private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" ); + private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_725 ); private final boolean hasIndex; private final IndexCursor wrapped; @@ -49,6 +54,7 @@ public class SubstringCursor store, final SubstringEvaluator substringEvaluator ) throws Exception { + LOG_CURSOR.debug( "Creating SubstringCursor {}", this ); evaluator = substringEvaluator; hasIndex = store.hasIndexOn( evaluator.getExpression().getAttributeType() ); @@ -207,10 +213,26 @@ public class SubstringCursor> extends AbstractIndexCursor { + /** A dedicated log for cursors */ + private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" ); + private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 ); /** The Entry database/store */ @@ -68,6 +73,7 @@ public class SubtreeScopeCursor db, SubtreeScopeEvaluator evaluator ) throws Exception { + LOG_CURSOR.debug( "Creating SubtreeScopeCursor {}", this ); this.db = db; this.evaluator = evaluator; @@ -312,8 +318,13 @@ public class SubtreeScopeCursor