directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fel...@apache.org>
Subject Re: svn commit: r947213 - in /directory/apacheds/trunk: jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java jdbm/src/main/java/jdbm/btree/BPage.java jdbm/src/main/java/jdbm/btree/BTree.java
Date Sat, 22 May 2010 04:51:27 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well.... ;-) it was again one of those early morning commits which made
compilation failing.
Fix in 947213

On 05/22/10 01:07, elecharny@apache.org wrote:
> Author: elecharny
> Date: Fri May 21 23:07:42 2010
> New Revision: 947213
> 
> URL: http://svn.apache.org/viewvc?rev=947213&view=rev
> Log:
> o Added some more generics
> o Minor refactoring
> 
> Modified:
>     directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
>     directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
>     directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
> 
> Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=947213&r1=947212&r2=947213&view=diff
> ==============================================================================
> --- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
(original)
> +++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
Fri May 21 23:07:42 2010
> @@ -176,7 +176,7 @@ public class JdbmTable<K,V> implements T
>              // marshallers.
>  
>              bt = new BTree<K, V>( recMan, keyComparator, keySerializer, null );
> -            recId = bt.getRecid();
> +            recId = bt.getRecordId();
>              recMan.setNamedObject( name, recId );
>              recId = recMan.insert( 0 );
>              recMan.setNamedObject( name + SZSUFFIX, recId );
> @@ -244,7 +244,7 @@ public class JdbmTable<K,V> implements T
>          else
>          {
>              bt = new BTree<K, V>( recMan, keyComparator, keySerializer, valueSerializer
);
> -            recId = bt.getRecid();
> +            recId = bt.getRecordId();
>              recMan.setNamedObject( name, recId );
>              recId = recMan.insert( 0 );
>              recMan.setNamedObject( name + SZSUFFIX, recId );
> @@ -648,7 +648,7 @@ public class JdbmTable<K,V> implements T
>                  if ( set.size() > numDupLimit )
>                  {
>                      BTree tree = convertToBTree( set );
> -                    BTreeRedirect redirect = new BTreeRedirect( tree.getRecid() );
> +                    BTreeRedirect redirect = new BTreeRedirect( tree.getRecordId() );
>                      bt.insert( key, (V)BTreeRedirectMarshaller.INSTANCE.serialize( redirect
), true );
>                      
>                      if ( LOG.isDebugEnabled() )
> @@ -780,7 +780,7 @@ public class JdbmTable<K,V> implements T
>                      {
>                          ArrayTree<V> avlTree = convertToArrayTree( tree );
>                          bt.insert( key, (V)marshaller.serialize( avlTree ), true );
> -                        recMan.delete( tree.getRecid() );
> +                        recMan.delete( tree.getRecordId() );
>                      }
>                      
>                      count--;
> @@ -854,8 +854,8 @@ public class JdbmTable<K,V> implements T
>                      LOG.debug( "<--- Remove BTree {} = {}", name, key );
>                  }
>  
> -                recMan.delete( tree.getRecid() );
> -                duplicateBtrees.remove( tree.getRecid() );
> +                recMan.delete( tree.getRecordId() );
> +                duplicateBtrees.remove( tree.getRecordId() );
>                  return;
>              }
>              else
> @@ -1115,17 +1115,17 @@ public class JdbmTable<K,V> implements T
>      }
>      
>  
> -    private BTree convertToBTree( ArrayTree<V> arrayTree ) throws Exception
> +    private BTree<V, K> convertToBTree( ArrayTree<V> arrayTree ) throws
Exception
>      {
> -        BTree bTree;
> +        BTree<V, K> bTree;
>  
>          if ( valueSerializer != null )
>          {
> -            bTree = new BTree<K, V>( recMan, valueComparator, valueSerializer,
null );
> +            bTree = new BTree<V, K>( recMan, valueComparator, valueSerializer,
null );
>          }
>          else
>          {
> -            bTree = new BTree<K, V>( recMan, valueComparator );
> +            bTree = new BTree<V, K>( recMan, valueComparator );
>          }
>  
>          Cursor<V> keys = new ArrayTreeCursor<V>( arrayTree );
> @@ -1133,7 +1133,7 @@ public class JdbmTable<K,V> implements T
>          
>          while ( keys.next() )
>          {
> -            bTree.insert( keys.get(), StringTools.EMPTY_BYTES, true );
> +            bTree.insert( keys.get(), (K)StringTools.EMPTY_BYTES, true );
>          }
>          
>          return bTree;
> 
> Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java?rev=947213&r1=947212&r2=947213&view=diff
> ==============================================================================
> --- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java (original)
> +++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java Fri May 21 23:07:42
2010
> @@ -88,7 +88,7 @@ public final class BPage<K, V> implement
>      final static long serialVersionUID = 1L;
>  
>      /** Parent B+Tree. */
> -    transient BTree btree;
> +    transient BTree<K, V> btree;
>  
>      /** This BPage's record ID in the PageManager. */
>      protected transient long recid;
> @@ -888,7 +888,7 @@ public final class BPage<K, V> implement
>      }
>  
>  
> -    private final int compare( Object value1, Object value2 )
> +    private final int compare( K value1, K value2 )
>      {
>          if ( value1 == value2 )
>          {
> @@ -905,7 +905,7 @@ public final class BPage<K, V> implement
>              return -1;
>          }
>          
> -        return btree.comparator.compare( value1, value2 );
> +        return btree.getComparator().compare( value1, value2 );
>      }
>  
>  
> @@ -998,14 +998,14 @@ public final class BPage<K, V> implement
>  
>  
>      /**
> -     * Assert the ordering of the keys on the BPage.  This is used for testing
> +     * Assert the ordering of the keys on the BPage. This is used for testing
>       * purposes only.
>       */
>      private void assertConsistency()
>      {
>          for ( int i = first; i < btree.pageSize - 1; i++ )
>          {
> -            if ( compare( ( byte[] ) keys[i], ( byte[] ) keys[i + 1] ) >= 0 )
> +            if ( compare( keys[i], keys[i + 1] ) >= 0 )
>              {
>                  dump( 0 );
>                  throw new Error( I18n.err( I18n.ERR_515 ) );
> @@ -1033,7 +1033,7 @@ public final class BPage<K, V> implement
>                  
>                  BPage<K, V> child = childBPage( i );
>                  
> -                if ( compare( ( byte[] ) keys[i], child.getLargestKey() ) != 0 )
> +                if ( compare( keys[i], child.getLargestKey() ) != 0 )
>                  {
>                      dump( 0 );
>                      child.dump( 0 );
> 
> Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java?rev=947213&r1=947212&r2=947213&view=diff
> ==============================================================================
> --- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java (original)
> +++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java Fri May 21 23:07:42
2010
> @@ -107,7 +107,7 @@ public class BTree<K, V> implements Exte
>      private transient long recordId;
>  
>      /** Comparator used to index entries. */
> -    protected Comparator comparator;
> +    private Comparator<K> comparator;
>  
>      /** Serializer used to serialize index keys (optional) */
>      protected Serializer keySerializer;
> @@ -149,7 +149,7 @@ public class BTree<K, V> implements Exte
>       * @param recman Record manager used for persistence.
>       * @param comparator Comparator used to order index entries
>       */
> -    public BTree( RecordManager recman, Comparator<?> comparator ) throws IOException
> +    public BTree( RecordManager recman, Comparator<K> comparator ) throws IOException
>      {
>          createInstance( recman, comparator, null, null, DEFAULT_SIZE );
>      }
> @@ -163,7 +163,7 @@ public class BTree<K, V> implements Exte
>       * @param valueSerializer Serializer used to serialize index values (optional)
>       * @param comparator Comparator used to order index entries
>       */
> -    public BTree( RecordManager recman, Comparator<?> comparator, Serializer keySerializer,
> +    public BTree( RecordManager recman, Comparator<K> comparator, Serializer keySerializer,
>          Serializer valueSerializer ) throws IOException
>      {
>          createInstance( recman, comparator, keySerializer, valueSerializer, DEFAULT_SIZE
);
> @@ -179,7 +179,7 @@ public class BTree<K, V> implements Exte
>       * @param valueSerializer Serializer used to serialize index values (optional)
>       * @param pageSize Number of entries per page (must be even).
>       */
> -    public BTree( RecordManager recman, Comparator<?> comparator, Serializer keySerializer,
> +    public BTree( RecordManager recman, Comparator<K> comparator, Serializer keySerializer,
>          Serializer valueSerializer, int pageSize ) throws IOException
>      {
>          createInstance( recman, comparator, keySerializer, valueSerializer, pageSize
);
> @@ -189,7 +189,7 @@ public class BTree<K, V> implements Exte
>      /**
>       * The real BTree constructor.
>       */
> -    private void createInstance(RecordManager recman, Comparator<?> comparator,
Serializer keySerializer,
> +    private void createInstance(RecordManager recman, Comparator<K> comparator,
Serializer keySerializer,
>          Serializer valueSerializer, int pageSize) throws IOException
>      {
>          if ( recman == null )
> @@ -528,7 +528,7 @@ public class BTree<K, V> implements Exte
>      /**
>       * Return the persistent record identifier of the BTree.
>       */
> -    public long getRecid()
> +    public long getRecordId()
>      {
>          return recordId;
>      }
> @@ -557,7 +557,7 @@ public class BTree<K, V> implements Exte
>       */
>      public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
>      {
> -        comparator = ( Comparator<?> ) in.readObject();
> +        comparator = ( Comparator<K> ) in.readObject();
>          keySerializer = ( Serializer ) in.readObject();
>          valueSerializer = ( Serializer ) in.readObject();
>          bTreeHeight = in.readInt();
> @@ -608,7 +608,7 @@ public class BTree<K, V> implements Exte
>      /**
>       * @return the comparator
>       */
> -    public Comparator<?> getComparator()
> +    public Comparator<K> getComparator()
>      {
>          return comparator;
>      }
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkv3Ys8ACgkQ2lZVCB08qHHAzwCg29KXmAqtFdJJSCwtCoUpFoiK
S9AAoKQbsQLAaYe5A5p16eEFxqaOTB+W
=CGKP
-----END PGP SIGNATURE-----

Mime
View raw message