directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1540823 - /directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/
Date Mon, 11 Nov 2013 19:54:30 GMT
Author: elecharny
Date: Mon Nov 11 19:54:29 2013
New Revision: 1540823

URL: http://svn.apache.org/r1540823
Log:
Passes the cache size down to the Mavibot BTree

Modified:
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotMasterTable.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotPartition.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java?rev=1540823&r1=1540822&r2=1540823&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
Mon Nov 11 19:54:29 2013
@@ -39,6 +39,7 @@ import org.apache.directory.mavibot.btre
 import org.apache.directory.mavibot.btree.serializer.ByteArraySerializer;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
+import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
 import org.apache.directory.server.core.partition.impl.btree.IndexCursorAdaptor;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.AbstractIndex;
@@ -191,7 +192,7 @@ public class MavibotIndex<K> extends Abs
 
         String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
         forward = new MavibotTable<K, String>( recordMan, schemaManager, forwardTableName,
forwardKeySerializer,
-            new StringSerializer(), forwardDups );
+            new StringSerializer(), forwardDups, AbstractBTreePartition.DEFAULT_CACHE_SIZE
);
 
         /*
          * Now the reverse map stores the primary key into the master table as

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotMasterTable.java?rev=1540823&r1=1540822&r2=1540823&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotMasterTable.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotMasterTable.java
Mon Nov 11 19:54:29 2013
@@ -37,6 +37,11 @@ import org.apache.directory.server.xdbm.
  */
 public class MavibotMasterTable extends MavibotTable<String, Entry> implements MasterTable
 {
+    public MavibotMasterTable( RecordManager recordMan, SchemaManager schemaManager, String
name, int cacheSize )
+        throws IOException
+    {
+        super( recordMan, schemaManager, name, new StringSerializer(), new MavibotEntrySerializer(),
false, cacheSize );
+    }
 
     public MavibotMasterTable( RecordManager recordMan, SchemaManager schemaManager, String
name )
         throws IOException

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java?rev=1540823&r1=1540822&r2=1540823&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java
Mon Nov 11 19:54:29 2013
@@ -108,7 +108,7 @@ public class MavibotParentIdAndRdnSerial
 
                 try
                 {
-                    // The current position. Start at 4, as we will add the length at pos
0
+                    // The current position.
                     int pos = 0;
 
                     // First, the Dn
@@ -157,6 +157,7 @@ public class MavibotParentIdAndRdnSerial
                     }
 
 
+                    // Copy the serialized data
                     byte[] result = new byte[pos];
                     System.arraycopy( buffer, 0, result, 0, pos );
 
@@ -195,12 +196,8 @@ public class MavibotParentIdAndRdnSerial
     @Override
     public ParentIdAndRdn deserialize( ByteBuffer buffer ) throws IOException
     {
-        int len = buffer.getInt();
-
         ParentIdAndRdn parentIdAndRdn = fromBytes( buffer.array(), buffer.position() );
 
-        buffer.position( buffer.position() + len );
-
         return parentIdAndRdn;
     }
 

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotPartition.java?rev=1540823&r1=1540822&r2=1540823&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotPartition.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotPartition.java
Mon Nov 11 19:54:29 2013
@@ -159,7 +159,7 @@ public class MavibotPartition extends Ab
             // First, check if the file storing the data exists
 
             // Create the master table (the table containing all the entries)
-            master = new MavibotMasterTable( recordMan, schemaManager, "master" );
+            master = new MavibotMasterTable( recordMan, schemaManager, "master", cacheSize
);
 
             // get all index db files first
             File[] allIndexDbFiles = partitionDir.listFiles( DB_FILTER );

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java?rev=1540823&r1=1540822&r2=1540823&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
Mon Nov 11 19:54:29 2013
@@ -34,10 +34,10 @@ import org.apache.directory.mavibot.btre
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.managed.BTree;
 import org.apache.directory.mavibot.btree.managed.RecordManager;
-import org.apache.directory.mavibot.btree.managed.ValueHolder;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 import org.apache.directory.server.core.avltree.ArrayMarshaller;
 import org.apache.directory.server.core.avltree.ArrayTree;
+import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.AbstractTable;
 import org.slf4j.Logger;
@@ -65,6 +65,14 @@ public class MavibotTable<K, V> extends 
         ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer,
boolean allowDuplicates )
         throws IOException
     {
+        this( recordMan, schemaManager, name, keySerializer, valueSerializer, allowDuplicates,
AbstractBTreePartition.DEFAULT_CACHE_SIZE );
+    }
+
+
+    public MavibotTable( RecordManager recordMan, SchemaManager schemaManager, String name,
+        ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer,
boolean allowDuplicates, int cacheSize )
+        throws IOException
+    {
         super( schemaManager, name, keySerializer.getComparator(), valueSerializer.getComparator()
);
         this.recordMan = recordMan;
 
@@ -72,7 +80,7 @@ public class MavibotTable<K, V> extends 
 
         if ( bt == null )
         {
-            bt = new BTree<K, V>( name, keySerializer, valueSerializer, allowDuplicates
);
+            bt = new BTree<K, V>( name, keySerializer, valueSerializer, allowDuplicates,
cacheSize );
 
             try
             {



Mime
View raw message