You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2008/02/17 12:41:03 UTC
svn commit: r628476 - in /directory/apacheds/branches/bigbang:
core-entry/src/main/java/org/apache/directory/server/core/entry/
core/src/main/java/org/apache/directory/server/core/partition/
core/src/main/java/org/apache/directory/server/core/partition...
Author: elecharny
Date: Sun Feb 17 03:40:57 2008
New Revision: 628476
URL: http://svn.apache.org/viewvc?rev=628476&view=rev
Log:
Some more speed improvement : The ServerSearchResult stores a DN, so no need to parse a String very time when we create the SearchEnumeration. It cost extra time for nothing.
Modified:
directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java?rev=628476&r1=628475&r2=628476&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java Sun Feb 17 03:40:57 2008
@@ -48,12 +48,13 @@
/** The bound object */
private Object object;
+
/**
* @see javax.naming.directory.SearchResult#SearchResult(String, Object, ServerEntry)
*/
- public ServerSearchResult( String name, Object obj, ServerEntry serverEntry ) throws InvalidNameException
+ public ServerSearchResult( LdapDN dn, Object obj, ServerEntry serverEntry ) throws InvalidNameException
{
- dn = new LdapDN( name );
+ this.dn = dn;
this.serverEntry = serverEntry;
this.serverEntry.setDn( dn );
}
@@ -62,9 +63,9 @@
/**
* @see javax.naming.directory.SearchResult#SearchResult(String, Object, ServerEntry)
*/
- public ServerSearchResult( String name, Object obj, ServerEntry serverEntry, boolean isRelative ) throws InvalidNameException
+ public ServerSearchResult( LdapDN dn, Object obj, ServerEntry serverEntry, boolean isRelative ) throws InvalidNameException
{
- dn = new LdapDN( name );
+ this.dn = dn;
this.serverEntry = serverEntry;
this.serverEntry.setDn( dn );
this.isRelative = isRelative;
@@ -74,9 +75,9 @@
/**
* @see javax.naming.directory.SearchResult#SearchResult(String, Object, ServerEntry)
*/
- public ServerSearchResult( String name, String className, Object obj, ServerEntry serverEntry ) throws InvalidNameException
+ public ServerSearchResult( LdapDN dn, String className, Object obj, ServerEntry serverEntry ) throws InvalidNameException
{
- dn = new LdapDN( name );
+ this.dn = dn;
this.serverEntry = serverEntry;
this.serverEntry.setDn( dn );
}
@@ -85,9 +86,9 @@
/**
* @see javax.naming.directory.SearchResult#SearchResult(String, String, Object, ServerEntry, boolean)
*/
- public ServerSearchResult( String name, String className, Object obj, ServerEntry serverEntry, boolean isRelative ) throws InvalidNameException
+ public ServerSearchResult( LdapDN dn, String className, Object obj, ServerEntry serverEntry, boolean isRelative ) throws InvalidNameException
{
- dn = new LdapDN( name );
+ this.dn = dn;
this.serverEntry = serverEntry;
this.serverEntry.setDn( dn );
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=628476&r1=628475&r2=628476&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Sun Feb 17 03:40:57 2008
@@ -927,7 +927,7 @@
if ( ( ids == null ) || ( ids.length == 0 ) )
{
ServerEntry rootDSE = (ServerEntry)getRootDSE( null ).clone();
- ServerSearchResult result = new ServerSearchResult( "", null, rootDSE, false );
+ ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, rootDSE, false );
return new SingletonEnumeration<ServerSearchResult>( result );
}
@@ -974,7 +974,7 @@
if ( containsOneDotOne )
{
ServerEntry serverEntry = new DefaultServerEntry( registries, base );
- ServerSearchResult result = new ServerSearchResult( "", null, serverEntry, false );
+ ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, serverEntry, false );
return new SingletonEnumeration<ServerSearchResult>( result );
}
@@ -982,7 +982,7 @@
if ( containsAsterisk && containsPlus )
{
ServerEntry rootDSE = (ServerEntry)getRootDSE( null ).clone();
- ServerSearchResult result = new ServerSearchResult( "", null, rootDSE, false );
+ ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, rootDSE, false );
return new SingletonEnumeration<ServerSearchResult>( result );
}
@@ -1008,7 +1008,7 @@
}
}
- ServerSearchResult result = new ServerSearchResult( "", null, serverEntry, false );
+ ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, serverEntry, false );
return new SingletonEnumeration<ServerSearchResult>( result );
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java?rev=628476&r1=628475&r2=628476&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java Sun Feb 17 03:40:57 2008
@@ -24,6 +24,7 @@
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.core.entry.ServerSearchResult;
+import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -54,9 +55,9 @@
* @param obj the object if any
* @param attrs the entry
*/
- public BTreeSearchResult(Long id, String name, Object obj, ServerEntry attrs) throws InvalidNameException
+ public BTreeSearchResult( Long id, LdapDN dn, Object obj, ServerEntry attrs ) throws InvalidNameException
{
- super( name, obj, attrs );
+ super( dn, obj, attrs );
this.id = id;
}
@@ -70,9 +71,9 @@
* @param attrs the entry
* @param isRelative whether or not the name is relative to the base
*/
- public BTreeSearchResult(Long id, String name, Object obj, ServerEntry attrs, boolean isRelative) throws InvalidNameException
+ public BTreeSearchResult( Long id, LdapDN dn, Object obj, ServerEntry attrs, boolean isRelative ) throws InvalidNameException
{
- super( name, obj, attrs, isRelative );
+ super( dn, obj, attrs, isRelative );
this.id = id;
}
@@ -86,9 +87,9 @@
* @param obj the object if any
* @param attrs the entry
*/
- public BTreeSearchResult(Long id, String name, String className, Object obj, ServerEntry attrs) throws InvalidNameException
+ public BTreeSearchResult( Long id, LdapDN dn, String className, Object obj, ServerEntry attrs ) throws InvalidNameException
{
- super( name, className, obj, attrs );
+ super( dn, className, obj, attrs );
this.id = id;
}
@@ -103,10 +104,10 @@
* @param attrs the entry
* @param isRelative whether or not the name is relative to the base
*/
- public BTreeSearchResult(Long id, String name, String className, Object obj, ServerEntry attrs,
- boolean isRelative) throws InvalidNameException
+ public BTreeSearchResult( Long id, LdapDN dn, String className, Object obj, ServerEntry attrs,
+ boolean isRelative ) throws InvalidNameException
{
- super( name, className, obj, attrs, isRelative );
+ super( dn, className, obj, attrs, isRelative );
this.id = id;
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?rev=628476&r1=628475&r2=628476&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java Sun Feb 17 03:40:57 2008
@@ -249,7 +249,7 @@
}
}
- BTreeSearchResult result = new BTreeSearchResult( (Long)rec.getEntryId(), name, null, entry );
+ BTreeSearchResult result = new BTreeSearchResult( (Long)rec.getEntryId(), dn, null, entry );
result.setRelative( false );
return result;
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=628476&r1=628475&r2=628476&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Sun Feb 17 03:40:57 2008
@@ -733,7 +733,7 @@
{
// call.setBypass( true );
ServerEntry serverEntry = schemaService.getSubschemaEntry( searchCtls.getReturningAttributes() );
- ServerSearchResult result = new ServerSearchResult( base.toString(), null, serverEntry );
+ ServerSearchResult result = new ServerSearchResult( base, null, serverEntry );
return new SingletonEnumeration<ServerSearchResult>( result );
}
else
@@ -750,7 +750,7 @@
{
// call.setBypass( true );
ServerEntry serverEntry = schemaService.getSubschemaEntry( searchCtls.getReturningAttributes() );
- ServerSearchResult result = new ServerSearchResult( base.toString(), null, serverEntry, false );
+ ServerSearchResult result = new ServerSearchResult( base, null, serverEntry, false );
return new SingletonEnumeration<ServerSearchResult>( result );
}
}
Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java?rev=628476&r1=628475&r2=628476&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java Sun Feb 17 03:40:57 2008
@@ -112,13 +112,15 @@
*/
Attribute ref = result.getAttributes().get( SchemaConstants.REF_AT );
- if ( !ctx.isReferral( result.getName() )
+ LdapDN dn = new LdapDN( result.getName() );
+
+ if ( !ctx.isReferral( dn )
|| req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
{
SearchResponseEntry respEntry;
respEntry = new SearchResponseEntryImpl( req.getMessageId() );
respEntry.setAttributes( result.getAttributes() );
- respEntry.setObjectName( new LdapDN( result.getName() ) );
+ respEntry.setObjectName( dn );
prefetched = respEntry;
}
else