directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1395589 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/ apacheds/trunk/core-avl/src/main/java/org/apache/dir...
Date Mon, 08 Oct 2012 14:45:32 GMT
Author: elecharny
Date: Mon Oct  8 14:45:31 2012
New Revision: 1395589

URL: http://svn.apache.org/viewvc?rev=1395589&view=rev
Log:
Speed up the log by using a static variable 

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/KeyTupleArrayCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/EmptyCursor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/ListCursor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SetCursor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SingletonCursor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java Mon Oct  8 14:45:31 2012
@@ -52,6 +52,9 @@ public class EntryToResponseCursor exten
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** the underlying cursor */
     private Cursor<Entry> wrapped;
 
@@ -65,7 +68,11 @@ public class EntryToResponseCursor exten
 
     public EntryToResponseCursor( int messageId, Cursor<Entry> wrapped )
     {
-        LOG_CURSOR.debug( "Creating EntryToResponseCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating EntryToResponseCursor {}", this );
+    	}
+    	
         this.wrapped = wrapped;
         this.messageId = messageId;
     }
@@ -109,14 +116,22 @@ public class EntryToResponseCursor exten
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryToResponseCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryToResponseCursor {}", this );
+    	}
+    	
         wrapped.close();
     }
 
 
     public void close( Exception e ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryToResponseCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryToResponseCursor {}", this );
+    	}
+    	
         wrapped.close( e );
     }
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java Mon Oct  8 14:45:31 2012
@@ -57,6 +57,9 @@ public class BaseEntryFilteringCursor ex
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** the underlying wrapped search results Cursor */
     private final Cursor<Entry> wrapped;
 
@@ -101,7 +104,11 @@ public class BaseEntryFilteringCursor ex
      */
     public BaseEntryFilteringCursor( Cursor<Entry> wrapped, SearchingOperationContext operationContext )
     {
-        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor {}", this );
+    	}
+    	
         this.wrapped = wrapped;
         this.operationContext = operationContext;
         this.filters = new ArrayList<EntryFilter>();
@@ -120,7 +127,11 @@ public class BaseEntryFilteringCursor ex
     public BaseEntryFilteringCursor( Cursor<Entry> wrapped,
         SearchingOperationContext operationContext, List<EntryFilter> filters )
     {
-        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor {}", this );
+    	}
+    	
         this.wrapped = wrapped;
         this.operationContext = operationContext;
         this.filters = new ArrayList<EntryFilter>();
@@ -252,7 +263,11 @@ public class BaseEntryFilteringCursor ex
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor {}", this );
+    	}
+    	
         wrapped.close();
         prefetched = null;
     }
@@ -263,7 +278,11 @@ public class BaseEntryFilteringCursor ex
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor {}", this );
+    	}
+    	
         wrapped.close( reason );
         prefetched = null;
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java Mon Oct  8 14:45:31 2012
@@ -50,6 +50,9 @@ public class CursorList extends Abstract
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The inner List */
     private final List<EntryFilteringCursor> list;
 
@@ -92,7 +95,10 @@ public class CursorList extends Abstract
      */
     public CursorList( int start, List<EntryFilteringCursor> list, int end, SearchingOperationContext searchContext )
     {
-        LOG_CURSOR.debug( "Creating CursorList {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating CursorList {}", this );
+    	}
 
         if ( list != null )
         {
@@ -452,14 +458,22 @@ public class CursorList extends Abstract
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing CursorList {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing CursorList {}", this );
+    	}
+    	
         close( null );
     }
 
 
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing CursorList {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing CursorList {}", this );
+    	}
+    	
         closed = true;
 
         for ( EntryFilteringCursor cursor : list )

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java Mon Oct  8 14:45:31 2012
@@ -36,6 +36,9 @@ public class ArrayTreeCursor<E> extends 
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The underlying ArrayTree */
     private ArrayTree<E> array;
 
@@ -52,7 +55,11 @@ public class ArrayTreeCursor<E> extends 
      */
     public ArrayTreeCursor( ArrayTree<E> array )
     {
-        LOG_CURSOR.debug( "Creating ArrayTreeCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating ArrayTreeCursor {}", this );
+    	}
+    	
         this.array = array;
         position = Position.BEFORE_FIRST;
     }
@@ -305,7 +312,11 @@ public class ArrayTreeCursor<E> extends 
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ArrayTreeCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ArrayTreeCursor {}", this );
+    	}
+    	
         super.close();
     }
 
@@ -315,7 +326,11 @@ public class ArrayTreeCursor<E> extends 
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ArrayTreeCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ArrayTreeCursor {}", this );
+    	}
+    	
         super.close( reason );
     }
 

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java Mon Oct  8 14:45:31 2012
@@ -39,6 +39,9 @@ public class AvlSingletonOrOrderedSetCur
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The underlying AVL tree map */
     private AvlTreeMap<K, V> tree;
 
@@ -53,7 +56,11 @@ public class AvlSingletonOrOrderedSetCur
 
     public AvlSingletonOrOrderedSetCursor( AvlTreeMap<K, V> tree )
     {
-        LOG_CURSOR.debug( "Creating AvlSingletonOrOrderedSetCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating AvlSingletonOrOrderedSetCursor {}", this );
+    	}
+    	
         this.tree = tree;
     }
 
@@ -300,7 +307,11 @@ public class AvlSingletonOrOrderedSetCur
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor {}", this );
+    	}
+    	
         super.close();
     }
 
@@ -310,7 +321,11 @@ public class AvlSingletonOrOrderedSetCur
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor {}", this );
+    	}
+    	
         super.close( reason );
     }
 }

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java Mon Oct  8 14:45:31 2012
@@ -36,6 +36,9 @@ public class AvlTreeCursor<E> extends Ab
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The underlying AVL tree */
     private AvlTree<E> tree;
 
@@ -48,7 +51,11 @@ public class AvlTreeCursor<E> extends Ab
 
     public AvlTreeCursor( AvlTree<E> tree )
     {
-        LOG_CURSOR.debug( "Creating AvlTreeCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating AvlTreeCursor {}", this );
+    	}
+    	
         this.tree = tree;
     }
 
@@ -255,7 +262,11 @@ public class AvlTreeCursor<E> extends Ab
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlTreeCursor {}", this );
+    	}
+    	
         super.close();
     }
 
@@ -265,7 +276,11 @@ public class AvlTreeCursor<E> extends Ab
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlTreeCursor {}", this );
+    	}
+    	
         super.close( reason );
     }
 }

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java Mon Oct  8 14:45:31 2012
@@ -39,12 +39,19 @@ public class AvlTreeMapNoDupsWrapperCurs
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private final AvlSingletonOrOrderedSetCursor<K, V> wrapped;
     private final Tuple<K, V> returnedTuple = new Tuple<K, V>();
 
     public AvlTreeMapNoDupsWrapperCursor( AvlSingletonOrOrderedSetCursor<K, V> wrapped )
     {
-        LOG_CURSOR.debug( "Creating AvlTreeMapNoDupsWrapperCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating AvlTreeMapNoDupsWrapperCursor {}", this );
+    	}
+    	
         this.wrapped = wrapped;
     }
 
@@ -148,14 +155,22 @@ public class AvlTreeMapNoDupsWrapperCurs
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor {}", this );
+    	}
+    	
         wrapped.close();
     }
 
 
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor {}", this );
+    	}
+    	
         wrapped.close( reason );
     }
 }

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java Mon Oct  8 14:45:31 2012
@@ -39,6 +39,9 @@ public class KeyTupleAvlCursor<K, V> ext
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private final AvlTreeCursor<V> wrapped;
     private final K key;
 
@@ -54,7 +57,11 @@ public class KeyTupleAvlCursor<K, V> ext
      */
     public KeyTupleAvlCursor( AvlTree<V> avlTree, K key )
     {
-        LOG_CURSOR.debug( "Creating KeyTupleAvlCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating KeyTupleAvlCursor {}", this );
+    	}
+    	
         this.key = key;
         this.wrapped = new AvlTreeCursor<V>( avlTree );
     }
@@ -217,7 +224,11 @@ public class KeyTupleAvlCursor<K, V> ext
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing KeyTupleAvlCursor {}", this );
+    	}
+    	
         super.close();
 
         if ( wrapped != null )
@@ -232,7 +243,11 @@ public class KeyTupleAvlCursor<K, V> ext
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing KeyTupleAvlCursor {}", this );
+    	}
+    	
         super.close( cause );
 
         if ( wrapped != null )

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java Mon Oct  8 14:45:31 2012
@@ -46,6 +46,9 @@ public class DupsContainerCursor<K, V> e
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The JDBM table we are building a cursor over */
     private final JdbmTable<K, V> table;
 
@@ -73,7 +76,10 @@ public class DupsContainerCursor<K, V> e
      */
     public DupsContainerCursor( JdbmTable<K, V> table ) throws IOException
     {
-        LOG_CURSOR.debug( "Creating DupsContainerCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Creating DupsContainerCursor {}", this );
+        }
 
         if ( !table.isDupsEnabled() )
         {
@@ -383,7 +389,11 @@ public class DupsContainerCursor<K, V> e
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing DupsContainerCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing DupsContainerCursor {}", this );
+        }
+        
         super.close();
         closeBrowser( browser );
     }
@@ -395,7 +405,11 @@ public class DupsContainerCursor<K, V> e
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing DupsContainerCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing DupsContainerCursor {}", this );
+        }
+        
         super.close( cause );
         closeBrowser( browser );
     }

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java Mon Oct  8 14:45:31 2012
@@ -44,6 +44,9 @@ class DupsCursor<K, V> extends AbstractC
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /**
      * The JDBM backed table this Cursor traverses over.
      */
@@ -86,7 +89,11 @@ class DupsCursor<K, V> extends AbstractC
 
     public DupsCursor( JdbmTable<K, V> table ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating DupsCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Creating DupsCursor {}", this );
+        }
+        
         this.table = table;
         this.containerCursor = new DupsContainerCursor<K, V>( table );
         LOG.debug( "Created on table {}", table );
@@ -481,7 +488,11 @@ class DupsCursor<K, V> extends AbstractC
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing DupsCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing DupsCursor {}", this );
+        }
+        
         super.close();
         containerCursor.close();
         
@@ -498,7 +509,11 @@ class DupsCursor<K, V> extends AbstractC
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing DupsCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing DupsCursor {}", this );
+        }
+        
         super.close( cause );
         containerCursor.close( cause );
         

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java Mon Oct  8 14:45:31 2012
@@ -42,6 +42,9 @@ public class KeyBTreeCursor<E> extends A
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private final Tuple tuple = new Tuple();
 
     private final BTree btree;
@@ -59,7 +62,11 @@ public class KeyBTreeCursor<E> extends A
      */
     public KeyBTreeCursor( BTree btree, Comparator<E> comparator ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating KeyBTreeCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Creating KeyBTreeCursor {}", this );
+        }
+        
         this.btree = btree;
         this.comparator = comparator;
     }
@@ -224,7 +231,11 @@ public class KeyBTreeCursor<E> extends A
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyBTreeCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing KeyBTreeCursor {}", this );
+        }
+        
         super.close();
         this.closeBrowser( browser );
     }
@@ -236,7 +247,11 @@ public class KeyBTreeCursor<E> extends A
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyBTreeCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing KeyBTreeCursor {}", this );
+        }
+        
         super.close( cause );
         this.closeBrowser( browser );
     }

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java Mon Oct  8 14:45:31 2012
@@ -44,6 +44,9 @@ public class KeyTupleBTreeCursor<K, V> e
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private final Comparator<V> comparator;
     private final BTree btree;
     private final K key;
@@ -64,7 +67,11 @@ public class KeyTupleBTreeCursor<K, V> e
      */
     public KeyTupleBTreeCursor( BTree btree, K key, Comparator<V> comparator ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating KeyTupleBTreeCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Creating KeyTupleBTreeCursor {}", this );
+        }
+        
         this.key = key;
         this.btree = btree;
         this.comparator = comparator;
@@ -327,7 +334,11 @@ public class KeyTupleBTreeCursor<K, V> e
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleBTreeCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing KeyTupleBTreeCursor {}", this );
+        }
+        
         super.close();
         closeBrowser( browser );
     }
@@ -339,7 +350,11 @@ public class KeyTupleBTreeCursor<K, V> e
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleBTreeCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing KeyTupleBTreeCursor {}", this );
+        }
+        
         super.close( cause );
         closeBrowser( browser );
     }

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java Mon Oct  8 14:45:31 2012
@@ -44,6 +44,9 @@ class NoDupsCursor<K, V> extends Abstrac
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private final JdbmTable<K, V> table;
 
     private jdbm.helper.Tuple jdbmTuple = new jdbm.helper.Tuple();
@@ -60,7 +63,11 @@ class NoDupsCursor<K, V> extends Abstrac
      */
     public NoDupsCursor( JdbmTable<K, V> table ) throws IOException
     {
-        LOG_CURSOR.debug( "Creating NoDupsCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Creating NoDupsCursor {}", this );
+        }
+        
         this.table = table;
     }
 
@@ -261,7 +268,11 @@ class NoDupsCursor<K, V> extends Abstrac
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing NoDupsCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing NoDupsCursor {}", this );
+        }
+        
         super.close();
         closeBrowser( browser );
     }
@@ -273,7 +284,11 @@ class NoDupsCursor<K, V> extends Abstrac
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing NoDupsCursor {}", this );
+        if ( IS_DEBUG )
+        {
+            LOG_CURSOR.debug( "Closing NoDupsCursor {}", this );
+        }
+        
         super.close( cause );
         closeBrowser( browser );
     }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java Mon Oct  8 14:45:31 2012
@@ -46,6 +46,9 @@ public class ReplicaJournalCursor extend
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** the underlying journal's cursor */
     private Cursor<Tuple<String, ReplicaEventMessage>> tupleCursor;
 
@@ -66,7 +69,11 @@ public class ReplicaJournalCursor extend
      */
     public ReplicaJournalCursor( JdbmTable<String, ReplicaEventMessage> journal, String consumerCsn ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating ReplicaJournalCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Creating ReplicaJournalCursor {}", this );
+        }
+        
         this.journal = journal;
         this.tupleCursor = journal.cursor();
         this.consumerCsn = consumerCsn;
@@ -216,7 +223,11 @@ public class ReplicaJournalCursor extend
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ReplicaJournalCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing ReplicaJournalCursor {}", this );
+        }
+        
         tupleCursor.close();
         super.close();
     }
@@ -228,7 +239,11 @@ public class ReplicaJournalCursor extend
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ReplicaJournalCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing ReplicaJournalCursor {}", this );
+        }
+        
         tupleCursor.close();
         super.close( cause );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java Mon Oct  8 14:45:31 2012
@@ -42,6 +42,9 @@ public class EntryCursorAdaptor extends 
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private final AbstractBTreePartition db;
     private final Cursor<IndexEntry<String, String>> indexCursor;
     private final Evaluator<? extends ExprNode> evaluator;
@@ -49,7 +52,11 @@ public class EntryCursorAdaptor extends 
 
     public EntryCursorAdaptor( AbstractBTreePartition db, PartitionSearchResult searchResult )
     {
-        LOG_CURSOR.debug( "Creating EntryCursorAdaptor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating EntryCursorAdaptor {}", this );
+    	}
+    	
         this.db = db;
         indexCursor = searchResult.getResultSet();
         evaluator = searchResult.getEvaluator();
@@ -112,7 +119,11 @@ public class EntryCursorAdaptor extends 
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryCursorAdaptor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryCursorAdaptor {}", this );
+    	}
+    	
         indexCursor.close();
     }
 
@@ -122,7 +133,11 @@ public class EntryCursorAdaptor extends 
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryCursorAdaptor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryCursorAdaptor {}", this );
+    	}
+    	
         indexCursor.close( cause );
     }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java Mon Oct  8 14:45:31 2012
@@ -44,6 +44,9 @@ public class IndexCursorAdaptor<K> exten
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     @SuppressWarnings("unchecked")
     final Cursor<Tuple> wrappedCursor;
     final IndexEntry<K, String> forwardEntry;
@@ -64,7 +67,10 @@ public class IndexCursorAdaptor<K> exten
 
         forwardEntry = new IndexEntry<K, String>();
 
-        LOG_CURSOR.debug( "Creating IndexCursorAdaptor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating IndexCursorAdaptor {}", this );
+    	}
     }
 
 
@@ -146,14 +152,22 @@ public class IndexCursorAdaptor<K> exten
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing IndexCursorAdaptor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing IndexCursorAdaptor {}", this );
+    	}
+    	
         wrappedCursor.close();
     }
 
 
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing IndexCursorAdaptor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing IndexCursorAdaptor {}", this );
+    	}
+    	
         wrappedCursor.close( reason );
     }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java Mon Oct  8 14:45:31 2012
@@ -35,10 +35,15 @@ public class EmptyIndexCursor<K> extends
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
 
     public EmptyIndexCursor()
     {
-        LOG_CURSOR.debug( "Creating EmptyIndexCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating EmptyIndexCursor {}", this );
+    	}
     }
 
 
@@ -139,7 +144,11 @@ public class EmptyIndexCursor<K> extends
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this );
+    	}
+    	
         super.close();
     }
 
@@ -149,7 +158,11 @@ public class EmptyIndexCursor<K> extends
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this );
+    	}
+    	
         super.close( cause );
     }
 }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/KeyTupleArrayCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/KeyTupleArrayCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/KeyTupleArrayCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/KeyTupleArrayCursor.java Mon Oct  8 14:45:31 2012
@@ -41,6 +41,9 @@ public class KeyTupleArrayCursor<K, V> e
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private final ArrayTreeCursor<V> wrapped;
     private final K key;
 
@@ -58,7 +61,11 @@ public class KeyTupleArrayCursor<K, V> e
     {
         this.key = key;
         this.wrapped = new ArrayTreeCursor<V>( arrayTree );
-        LOG_CURSOR.debug( "Creating KeyTupleArrayCursor {}", this );
+
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating KeyTupleArrayCursor {}", this );
+    	}
     }
 
 
@@ -219,7 +226,10 @@ public class KeyTupleArrayCursor<K, V> e
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleArrayCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing KeyTupleArrayCursor {}", this );
+    	}
 
         if ( wrapped != null )
         {
@@ -235,7 +245,10 @@ public class KeyTupleArrayCursor<K, V> e
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleArrayCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing KeyTupleArrayCursor {}", this );
+    	}
 
         if ( wrapped != null )
         {

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java Mon Oct  8 14:45:31 2012
@@ -35,6 +35,9 @@ public class SingletonIndexCursor<V> ext
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private boolean beforeFirst = true;
     private boolean afterLast;
     private boolean onSingleton;
@@ -43,7 +46,11 @@ public class SingletonIndexCursor<V> ext
 
     public SingletonIndexCursor( IndexEntry<V, String> singleton )
     {
-        LOG_CURSOR.debug( "Creating SingletonIndexCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating SingletonIndexCursor {}", this );
+    	}
+    	
         this.singleton = singleton;
     }
 
@@ -199,14 +206,22 @@ public class SingletonIndexCursor<V> ext
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing SingletonIndexCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing SingletonIndexCursor {}", this );
+    	}
+    	
         super.close();
     }
 
 
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing SingletonIndexCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing SingletonIndexCursor {}", this );
+    	}
+    	
         super.close( cause );
     }
 }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java Mon Oct  8 14:45:31 2012
@@ -47,6 +47,9 @@ public class AvlTableDupsCursor<K, V> ex
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The AVL backed table this Cursor traverses over. */
     private final AvlTable<K, V> table;
 
@@ -86,7 +89,11 @@ public class AvlTableDupsCursor<K, V> ex
      */
     public AvlTableDupsCursor( AvlTable<K, V> table )
     {
-        LOG_CURSOR.debug( "Creating AvlTableDupsCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating AvlTableDupsCursor {}", this );
+    	}
+    	
         this.table = table;
         this.wrappedCursor = new AvlSingletonOrOrderedSetCursor<K, V>( table.getAvlTreeMap() );
         LOG.debug( "Created on table {}", table.getName() );
@@ -548,7 +555,10 @@ public class AvlTableDupsCursor<K, V> ex
     
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTableDupsCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlTableDupsCursor {}", this );
+    	}
         
         if ( dupsCursor != null )
         {
@@ -561,7 +571,10 @@ public class AvlTableDupsCursor<K, V> ex
 
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTableDupsCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AvlTableDupsCursor {}", this );
+    	}
 
         if ( dupsCursor != null )
         {

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java Mon Oct  8 14:45:31 2012
@@ -39,6 +39,9 @@ public class AllEntriesCursor extends Ab
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The index entry we use to return entries one by one.  */
     private IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
 
@@ -62,7 +65,11 @@ public class AllEntriesCursor extends Ab
      */
     public AllEntriesCursor( Store store ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating AllEntriesCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating AllEntriesCursor {}", this );
+    	}
+    	
         // Uses the MasterTable 
         wrapped = new IndexCursorAdaptor( store.getMasterTable().cursor(), true );
     }
@@ -186,7 +193,11 @@ public class AllEntriesCursor extends Ab
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AllEntriesCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AllEntriesCursor {}", this );
+    	}
+    	
         wrapped.close();
     }
 
@@ -197,7 +208,11 @@ public class AllEntriesCursor extends Ab
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AllEntriesCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AllEntriesCursor {}", this );
+    	}
+    	
         wrapped.close( cause );
     }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java Mon Oct  8 14:45:31 2012
@@ -46,6 +46,9 @@ public class AndCursor<V> extends Abstra
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 );
 
@@ -66,7 +69,11 @@ public class AndCursor<V> extends Abstra
     public AndCursor( Cursor<IndexEntry<V, String>> wrapped,
         List<Evaluator<? extends ExprNode>> evaluators )
     {
-        LOG_CURSOR.debug( "Creating AndCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating AndCursor {}", this );
+    	}
+    	
         this.wrapped = wrapped;
         this.evaluators = optimize( evaluators );
     }
@@ -187,7 +194,11 @@ public class AndCursor<V> extends Abstra
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AndCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AndCursor {}", this );
+    	}
+    	
         super.close();
         wrapped.close();
     }
@@ -198,7 +209,11 @@ public class AndCursor<V> extends Abstra
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AndCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing AndCursor {}", this );
+    	}
+    	
         super.close( cause );
         wrapped.close( cause );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java Mon Oct  8 14:45:31 2012
@@ -51,6 +51,9 @@ public class ApproximateCursor<V> extend
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = "ApproximateCursors only support positioning by element when a user index exists on the asserted attribute.";
 
@@ -73,7 +76,11 @@ public class ApproximateCursor<V> extend
     @SuppressWarnings("unchecked")
     public ApproximateCursor( Store store, ApproximateEvaluator<V> approximateEvaluator ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating ApproximateCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating ApproximateCursor {}", this );
+    	}
+    	
         this.approximateEvaluator = approximateEvaluator;
 
         AttributeType attributeType = approximateEvaluator.getExpression().getAttributeType();
@@ -289,7 +296,11 @@ public class ApproximateCursor<V> extend
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ApproximateCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ApproximateCursor {}", this );
+    	}
+    	
         super.close();
 
         if ( userIdxCursor != null )
@@ -308,7 +319,11 @@ public class ApproximateCursor<V> extend
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ApproximateCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ApproximateCursor {}", this );
+    	}
+    	
         super.close( cause );
 
         if ( userIdxCursor != null )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java Mon Oct  8 14:45:31 2012
@@ -41,6 +41,9 @@ public class ChildrenCursor extends Abst
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** Error message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 );
 
@@ -66,7 +69,11 @@ public class ChildrenCursor extends Abst
     {
         this.parentId = parentId;
         this.cursor = cursor;
-        LOG_CURSOR.debug( "Creating ChildrenCursor {}", this );
+        
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating ChildrenCursor {}", this );
+    	}
     }
 
 
@@ -165,7 +172,11 @@ public class ChildrenCursor extends Abst
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	}
+    	
         cursor.close();
 
         super.close();
@@ -175,7 +186,11 @@ public class ChildrenCursor extends Abst
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	}
+    	
         cursor.close( cause );
 
         super.close( cause );

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java Mon Oct  8 14:45:31 2012
@@ -44,6 +44,9 @@ public class DescendantCursor extends Ab
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** Error message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 );
 
@@ -109,7 +112,11 @@ public class DescendantCursor extends Ab
         parentIdStack = new ArrayStack();
         this.baseId = baseId;
         this.topLevel = topLevel;
-        LOG_CURSOR.debug( "Creating ChildrenCursor {}", this );
+
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating ChildrenCursor {}", this );
+    	}
     }
 
 
@@ -272,7 +279,10 @@ public class DescendantCursor extends Ab
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	}
 
         // Close the cursors stored in the stack, if we have some
         for ( Object cursor : cursorStack )
@@ -290,7 +300,10 @@ public class DescendantCursor extends Ab
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
+    	}
 
         // Close the cursors stored in the stack, if we have some
         for ( Object cursor : cursorStack )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java Mon Oct  8 14:45:31 2012
@@ -49,6 +49,9 @@ public class EqualityCursor<V> extends A
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_714 );
 
@@ -71,7 +74,11 @@ public class EqualityCursor<V> extends A
     @SuppressWarnings("unchecked")
     public EqualityCursor( Store store, EqualityEvaluator<V> equalityEvaluator ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating EqualityCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating EqualityCursor {}", this );
+    	}
+    	
         this.equalityEvaluator = equalityEvaluator;
 
         AttributeType attributeType = equalityEvaluator.getExpression().getAttributeType();
@@ -289,7 +296,11 @@ public class EqualityCursor<V> extends A
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EqualityCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EqualityCursor {}", this );
+    	}
+    	
         super.close();
 
         if ( userIdxCursor != null )
@@ -308,7 +319,11 @@ public class EqualityCursor<V> extends A
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EqualityCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EqualityCursor {}", this );
+    	}
+    	
         super.close( cause );
 
         if ( userIdxCursor != null )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java Mon Oct  8 14:45:31 2012
@@ -48,6 +48,9 @@ public class GreaterEqCursor<V> extends 
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private static final String UNSUPPORTED_MSG = "GreaterEqCursors only support positioning by element when a user index exists on the asserted attribute.";
 
     /** An greater eq evaluator for candidates */
@@ -76,7 +79,11 @@ public class GreaterEqCursor<V> extends 
     @SuppressWarnings("unchecked")
     public GreaterEqCursor( Store store, GreaterEqEvaluator<V> greaterEqEvaluator ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating GreaterEqCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating GreaterEqCursor {}", this );
+    	}
+    	
         this.greaterEqEvaluator = greaterEqEvaluator;
 
         AttributeType attributeType = greaterEqEvaluator.getExpression().getAttributeType();
@@ -356,7 +363,11 @@ public class GreaterEqCursor<V> extends 
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing GreaterEqCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing GreaterEqCursor {}", this );
+    	}
+    	
         super.close();
 
         if ( userIdxCursor != null )
@@ -376,7 +387,11 @@ public class GreaterEqCursor<V> extends 
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing GreaterEqCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing GreaterEqCursor {}", this );
+    	}
+    	
         super.close( cause );
 
         if ( userIdxCursor != null )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java Mon Oct  8 14:45:31 2012
@@ -48,6 +48,9 @@ public class LessEqCursor<V> extends Abs
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_716 );
 
     /** An less eq evaluator for candidates */
@@ -70,7 +73,11 @@ public class LessEqCursor<V> extends Abs
     @SuppressWarnings("unchecked")
     public LessEqCursor( Store store, LessEqEvaluator<V> lessEqEvaluator ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating LessEqCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating LessEqCursor {}", this );
+    	}
+    	
         this.lessEqEvaluator = lessEqEvaluator;
 
         AttributeType attributeType = lessEqEvaluator.getExpression().getAttributeType();
@@ -340,7 +347,11 @@ public class LessEqCursor<V> extends Abs
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing LessEqCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing LessEqCursor {}", this );
+    	}
+    	
         super.close();
 
         if ( userIdxCursor != null )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java Mon Oct  8 14:45:31 2012
@@ -41,6 +41,9 @@ public class NotCursor<V> extends Abstra
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_718 );
     private final AllEntriesCursor uuidCursor;
     private final Evaluator<? extends ExprNode> childEvaluator;
@@ -50,7 +53,11 @@ public class NotCursor<V> extends Abstra
     public NotCursor( Store store, Evaluator<? extends ExprNode> childEvaluator )
         throws Exception
     {
-        LOG_CURSOR.debug( "Creating NotCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating NotCursor {}", this );
+    	}
+    	
         this.childEvaluator = childEvaluator;
         this.uuidCursor = new AllEntriesCursor( store );
 
@@ -147,7 +154,11 @@ public class NotCursor<V> extends Abstra
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing NotCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing NotCursor {}", this );
+    	}
+    	
         super.close();
         uuidCursor.close();
     }
@@ -155,7 +166,11 @@ public class NotCursor<V> extends Abstra
 
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing NotCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing NotCursor {}", this );
+    	}
+    	
         super.close( cause );
         uuidCursor.close( cause );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java Mon Oct  8 14:45:31 2012
@@ -46,6 +46,9 @@ public class OrCursor<V> extends Abstrac
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_722 );
     private final List<Cursor<IndexEntry<V, String>>> cursors;
     private final List<Evaluator<? extends ExprNode>> evaluators;
@@ -60,7 +63,10 @@ public class OrCursor<V> extends Abstrac
     public OrCursor( List<Cursor<IndexEntry<V, String>>> cursors,
         List<Evaluator<? extends ExprNode>> evaluators )
     {
-        LOG_CURSOR.debug( "Creating OrCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating OrCursor {}", this );
+    	}
 
         if ( cursors.size() <= 1 )
         {
@@ -258,7 +264,11 @@ public class OrCursor<V> extends Abstrac
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing OrCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing OrCursor {}", this );
+    	}
+    	
         super.close();
 
         for ( Cursor<?> cursor : cursors )
@@ -270,7 +280,11 @@ public class OrCursor<V> extends Abstrac
 
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing OrCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing OrCursor {}", this );
+    	}
+    	
         super.close( cause );
 
         for ( Cursor<?> cursor : cursors )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java Mon Oct  8 14:45:31 2012
@@ -42,6 +42,9 @@ public class PresenceCursor extends Abst
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_724 );
     private final Cursor<IndexEntry<String, String>> uuidCursor;
     private final Cursor<IndexEntry<String, String>> presenceCursor;
@@ -53,7 +56,11 @@ public class PresenceCursor extends Abst
 
     public PresenceCursor( Store store, PresenceEvaluator presenceEvaluator ) throws Exception
     {
-        LOG_CURSOR.debug( "Creating PresenceCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating PresenceCursor {}", this );
+    	}
+    	
         this.presenceEvaluator = presenceEvaluator;
         AttributeType type = presenceEvaluator.getAttributeType();
 
@@ -275,7 +282,11 @@ public class PresenceCursor extends Abst
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing PresenceCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing PresenceCursor {}", this );
+    	}
+    	
         super.close();
 
         if ( presenceCursor != null )
@@ -291,7 +302,11 @@ public class PresenceCursor extends Abst
 
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing PresenceCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing PresenceCursor {}", this );
+    	}
+    	
         super.close( cause );
 
         if ( presenceCursor != null )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java Mon Oct  8 14:45:31 2012
@@ -43,6 +43,9 @@ public class SubstringCursor extends Abs
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_725 );
     private final boolean hasIndex;
     private final Cursor<IndexEntry<String, String>> wrapped;
@@ -54,7 +57,11 @@ public class SubstringCursor extends Abs
     public SubstringCursor( Store store, final SubstringEvaluator substringEvaluator )
         throws Exception
     {
-        LOG_CURSOR.debug( "Creating SubstringCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating SubstringCursor {}", this );
+    	}
+    	
         evaluator = substringEvaluator;
         hasIndex = store.hasIndexOn( evaluator.getExpression().getAttributeType() );
 
@@ -220,7 +227,11 @@ public class SubstringCursor extends Abs
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing SubstringCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing SubstringCursor {}", this );
+    	}
+    	
         super.close();
         wrapped.close();
         clear();
@@ -232,7 +243,11 @@ public class SubstringCursor extends Abs
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing SubstringCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing SubstringCursor {}", this );
+    	}
+    	
         super.close( cause );
         wrapped.close( cause );
         clear();

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java (original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java Mon Oct  8 14:45:31 2012
@@ -52,6 +52,9 @@ public class SearchCursorImpl extends Ab
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** the search future */
     private SearchFuture future;
 
@@ -80,7 +83,11 @@ public class SearchCursorImpl extends Ab
      */
     public SearchCursorImpl( SearchFuture future, long timeout, TimeUnit timeUnit )
     {
-        LOG_CURSOR.debug( "Creating SearchCursorImpl {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Creating SearchCursorImpl {}", this );
+        }
+        
         this.future = future;
         this.timeout = timeout;
         this.timeUnit = timeUnit;
@@ -181,7 +188,11 @@ public class SearchCursorImpl extends Ab
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing SearchCursorImpl {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing SearchCursorImpl {}", this );
+        }
+        
         close( null );
     }
 
@@ -192,7 +203,10 @@ public class SearchCursorImpl extends Ab
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing SearchCursorImpl {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing SearchCursorImpl {}", this );
+        }
         
         if ( done )
         {

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/EmptyCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/EmptyCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/EmptyCursor.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/EmptyCursor.java Mon Oct  8 14:45:31 2012
@@ -35,9 +35,15 @@ public class EmptyCursor<E> extends Abst
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     public EmptyCursor()
     {
-        LOG_CURSOR.debug( "Creating EmptyCursor : {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating EmptyCursor : {}", this );
+    	}
     }
     
     /**
@@ -141,7 +147,11 @@ public class EmptyCursor<E> extends Abst
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EmptyCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EmptyCursor {}", this );
+    	}
+    	
         super.close();
     }
 
@@ -152,7 +162,11 @@ public class EmptyCursor<E> extends Abst
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EmptyCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EmptyCursor {}", this );
+    	}
+    	
         super.close( cause );
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/ListCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/ListCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/ListCursor.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/ListCursor.java Mon Oct  8 14:45:31 2012
@@ -41,6 +41,9 @@ public class ListCursor<E> extends Abstr
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The inner List */
     private final List<E> list;
 
@@ -94,7 +97,11 @@ public class ListCursor<E> extends Abstr
             throw new IllegalArgumentException( I18n.err( I18n.ERR_02007_START_INDEX_ABOVE_END_INDEX, start, end ) );
         }
 
-        LOG_CURSOR.debug( "Creating ListCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Creating ListCursor {}", this );
+        }
+        
         this.comparator = comparator;
         this.list = list;
         this.start = start;
@@ -503,7 +510,11 @@ public class ListCursor<E> extends Abstr
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ListCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing ListCursor {}", this );
+        }
+        
         super.close();
     }
 
@@ -514,7 +525,11 @@ public class ListCursor<E> extends Abstr
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ListCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing ListCursor {}", this );
+        }
+        
         super.close( cause );
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SetCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SetCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SetCursor.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SetCursor.java Mon Oct  8 14:45:31 2012
@@ -41,6 +41,9 @@ public class SetCursor<E> extends Abstra
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** The inner Set */
     private final E[] set;
 
@@ -68,7 +71,11 @@ public class SetCursor<E> extends Abstra
             set = Collections.EMPTY_SET;
         }
 
-        LOG_CURSOR.debug( "Creating SetCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating SetCursor {}", this );
+    	}
+    	
         this.comparator = comparator;
         this.set = ( E[] ) set.toArray();
     }
@@ -388,7 +395,11 @@ public class SetCursor<E> extends Abstra
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ListCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ListCursor {}", this );
+    	}
+    	
         super.close();
     }
 
@@ -399,7 +410,11 @@ public class SetCursor<E> extends Abstra
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ListCursor {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing ListCursor {}", this );
+    	}
+    	
         super.close( cause );
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SingletonCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SingletonCursor.java?rev=1395589&r1=1395588&r2=1395589&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SingletonCursor.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/cursor/SingletonCursor.java Mon Oct  8 14:45:31 2012
@@ -37,6 +37,9 @@ public class SingletonCursor<E> extends 
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** A flag to tell if the cursor is set before the first element */
     private boolean beforeFirst = true;
 
@@ -73,7 +76,11 @@ public class SingletonCursor<E> extends 
      */
     public SingletonCursor( E singleton, Comparator<E> comparator )
     {
-        LOG_CURSOR.debug( "Creating SingletonCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Creating SingletonCursor {}", this );
+        }
+        
         this.singleton = singleton;
         this.comparator = comparator;
     }
@@ -327,7 +334,11 @@ public class SingletonCursor<E> extends 
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing SingletonCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing SingletonCursor {}", this );
+        }
+        
         super.close();
     }
 
@@ -338,7 +349,11 @@ public class SingletonCursor<E> extends 
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing SingletonCursor {}", this );
+        if ( IS_DEBUG )
+        {
+        	LOG_CURSOR.debug( "Closing SingletonCursor {}", this );
+        }
+        
         super.close( cause );
     }
 }



Mime
View raw message