directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1029216 - in /directory/apacheds/trunk: core-annotations/src/main/java/org/apache/directory/server/core/factory/ jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ xdbm-partition/src/main/java/org/apac...
Date Sat, 30 Oct 2010 22:43:23 GMT
Author: elecharny
Date: Sat Oct 30 22:43:22 2010
New Revision: 1029216

URL: http://svn.apache.org/viewvc?rev=1029216&view=rev
Log:
o Fixed a pb when the schema has already been extracted in the DS factory
o Used defined type instead of ? in JdbmIndex creation
o Added some missing javadoc

Modified:
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?rev=1029216&r1=1029215&r2=1029216&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
(original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
Sat Oct 30 22:43:22 2010
@@ -20,6 +20,7 @@ package org.apache.directory.server.core
 
 
 import java.io.File;
+import java.io.IOException;
 import java.util.List;
 
 import org.apache.directory.server.constants.ServerDNConstants;
@@ -149,7 +150,15 @@ public class DefaultDirectoryServiceFact
         // Extract the schema on disk (a brand new one) and load the registries
         File schemaRepository = new File( workingDirectory, "schema" );
         SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory
) );
-        extractor.extractOrCopy();
+        
+        try
+        {
+            extractor.extractOrCopy();
+        }
+        catch ( IOException ioe )
+        {
+            // The schema has already been extracted, bypass
+        }
 
         schemaPartition.setWrappedPartition( ldifPartition );
 

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1029216&r1=1029215&r2=1029216&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
Sat Oct 30 22:43:22 2010
@@ -24,8 +24,6 @@ import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 
-import javax.naming.NamingException;
-
 import jdbm.RecordManager;
 import jdbm.helper.MRU;
 import jdbm.recman.BaseRecordManager;
@@ -164,15 +162,12 @@ public class JdbmIndex<K, O> implements 
      * 
      * @param schemaManager The schemaManager to use to get back the Attribute
      * @param attributeType The attributeType this index is created for
-     * @param wkDirPath The bas directory where the index files will be created
      * @throws IOException If the initialization failed
      */
     public void init( SchemaManager schemaManager, AttributeType attributeType ) throws IOException
     {
         LOG.debug( "Initializing an Index for attribute '{}'", attributeType.getName() );
         
-        //.out.println( "IDX Initializing index for AT " + attributeType.getOid() + ", wkDirPath
: " + wkDirPath + ", base dir : " + this.wkDirPath );
-
         keyCache = new SynchronizedLRUMap( cacheSize );
         attribute = attributeType;
 
@@ -190,7 +185,6 @@ public class JdbmIndex<K, O> implements 
         }
 
         String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();
-        //.out.println( "IDX Created index " + path );
 
         BaseRecordManager base = new BaseRecordManager( path );
         base.disableTransactions();
@@ -223,7 +217,6 @@ public class JdbmIndex<K, O> implements 
      * @param schemaManager The server schemaManager
      * @throws IOException if we cannot initialize the forward and reverse
      * tables
-     * @throws NamingException 
      */
     private void initTables( SchemaManager schemaManager ) throws IOException
     {

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1029216&r1=1029215&r2=1029216&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Sat Oct 30 22:43:22 2010
@@ -303,70 +303,70 @@ public abstract class AbstractStore<E, I
         // add missing system indices
         if ( getPresenceIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID
) ;
+            Index<String, E, ID> index = new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID
) ;
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getOneLevelIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
+            Index<ID, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getSubLevelIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID
);
+            Index<ID, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getRdnIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<ParentIdAndRdn<ID>, E,
ID>( ApacheSchemaConstants.APACHE_RDN_AT_OID );
+            Index<ParentIdAndRdn<ID>, E, ID> index = new GenericIndex<ParentIdAndRdn<ID>,
E, ID>( ApacheSchemaConstants.APACHE_RDN_AT_OID );
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getAliasIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID
);
+            Index<String, E, ID> index = new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getOneAliasIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID
);
+            Index<ID, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getSubAliasIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID
);
+            Index<ID, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getObjectClassIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.OBJECT_CLASS_AT_OID
);
+            Index<String, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.OBJECT_CLASS_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getEntryUuidIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_UUID_AT_OID
);
+            Index<String, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_UUID_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }
 
         if ( getEntryCsnIndex() == null )
         {
-            Index<?, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_CSN_AT_OID
);
+            Index<String, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_CSN_AT_OID
);
             index.setWkDirPath( partitionDir );
             addIndex( index );
         }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java?rev=1029216&r1=1029215&r2=1029216&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
Sat Oct 30 22:43:22 2010
@@ -33,6 +33,9 @@ import org.apache.directory.shared.ldap.
  * values of the index.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @param <K> The Index key type
+ * @param <O> The indexed value type
+ * @param <ID> The unisuqe identifier type
  */
 public interface Index<K, O, ID>
 {



Mime
View raw message