directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1303405 - in /directory/apacheds/trunk: ldap-client-test/src/test/java/org/apache/directory/shared/client/api/perf/ xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/
Date Wed, 21 Mar 2012 14:25:40 GMT
Author: elecharny
Date: Wed Mar 21 14:25:39 2012
New Revision: 1303405

URL: http://svn.apache.org/viewvc?rev=1303405&view=rev
Log:
o Fix for DIRSERVER-1702 : we now inject the added index in the system or user indexes
o Some refactoring of a test

Modified:
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/perf/TestClientApiPerf.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/perf/TestClientApiPerf.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/perf/TestClientApiPerf.java?rev=1303405&r1=1303404&r2=1303405&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/perf/TestClientApiPerf.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/perf/TestClientApiPerf.java
Wed Mar 21 14:25:39 2012
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.client.api.perf;
 
@@ -50,17 +50,34 @@ import org.junit.runner.RunWith;
  * Tests for comparing performance of client API against various other LDAP client APIs
  *  (currently only compared against JNDI )
  * 
- * TODO print the performance results in a neat tabular fashion 
+ * TODO print the performance results in a neat tabular fashion
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
 @CreateDS(name = "ClientApiPerfTestDS", partitions =
-    { @CreatePartition(name = "example", suffix = "dc=example,dc=com", contextEntry = @ContextEntry(entryLdif
= "dn: dc=example,dc=com\n"
-        + "dc: example\n" + "objectClass: top\n" + "objectClass: domain\n\n"), indexes =
-        { @CreateIndex(attribute = "objectClass"), @CreateIndex(attribute = "dc"), @CreateIndex(attribute
= "ou") }) })
+    {
+    @CreatePartition(
+        name = "example",
+        suffix = "dc=example,dc=com",
+        contextEntry = @ContextEntry(
+            entryLdif =
+                "dn: dc=example,dc=com\n" +
+                "dc: example\n" +
+                "objectClass: top\n" +
+                "objectClass: domain\n\n"),
+        indexes =
+        {
+            @CreateIndex(attribute = "objectClass"),
+            @CreateIndex(attribute = "dc"),
+            @CreateIndex(attribute = "ou")
+        })
+    })
 @CreateLdapServer(transports =
-    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") })
+    {
+        @CreateTransport(protocol = "LDAP"),
+        @CreateTransport(protocol = "LDAPS")
+    })
 public class TestClientApiPerf extends AbstractLdapTestUnit
 {
 
@@ -119,7 +136,7 @@ public class TestClientApiPerf extends A
         NamingEnumeration<SearchResult> ne = ctx.search( "dc=example,dc=com", "objectClass=*",
searchControls );
         while ( ne.hasMoreElements() )
         {
-            SearchResult searchResult = ( SearchResult ) ne.nextElement();
+            SearchResult searchResult = ne.nextElement();
         }
         ne.close();
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1303405&r1=1303404&r2=1303405&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Wed Mar 21 14:25:39 2012
@@ -514,8 +514,19 @@ public abstract class AbstractBTreeParti
      */
     protected void doInit() throws Exception
     {
+        // First, inject the indexed attributes if any
+        if ( ( indexedAttributes != null ) && ( indexedAttributes.size() > 0 )
)
+        {
+            for ( Index index : indexedAttributes )
+            {
+                addIndex( index );
+            }
+        }
+
+        // Now, initialize the configured index
         setupSystemIndices();
         setupUserIndices();
+        
     }
 
 



Mime
View raw message