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 2014/03/16 10:19:59 UTC
svn commit: r1578010 - in
/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot:
MavibotDnIndex.java MavibotIndex.java MavibotMasterTable.java
MavibotRdnIndex.java
Author: elecharny
Date: Sun Mar 16 09:19:58 2014
New Revision: 1578010
URL: http://svn.apache.org/r1578010
Log:
Used the static serializers instead of creating a new instance everytime
Modified:
directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotDnIndex.java
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/MavibotRdnIndex.java
Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotDnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotDnIndex.java?rev=1578010&r1=1578009&r2=1578010&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotDnIndex.java (original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotDnIndex.java Sun Mar 16 09:19:58 2014
@@ -106,10 +106,10 @@ public class MavibotDnIndex extends Mavi
String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
forward = new MavibotTable<Dn, String>( recordMan, schemaManager, forwardTableName, dnSerializer,
- new StringSerializer(), true );
+ StringSerializer.INSTANCE, true );
String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
- reverse = new MavibotTable<String, Dn>( recordMan, schemaManager, reverseTableName, new StringSerializer(),
+ reverse = new MavibotTable<String, Dn>( recordMan, schemaManager, reverseTableName, StringSerializer.INSTANCE,
dnSerializer, !attributeType.isSingleValued() );
String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();
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=1578010&r1=1578009&r2=1578010&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 Sun Mar 16 09:19:58 2014
@@ -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.
- *
+ *
*/
package org.apache.directory.server.core.partition.impl.btree.mavibot;
@@ -102,7 +102,7 @@ public class MavibotIndex<K> extends Abs
/**
* Initialize the index for an Attribute, with a specific working directory (may be null).
- *
+ *
* @param schemaManager The schemaManager to use to get back the Attribute
* @param attributeType The attributeType this index is created for
* @throws IOException If the initialization failed
@@ -147,7 +147,7 @@ public class MavibotIndex<K> extends Abs
/**
* Initializes the forward and reverse tables used by this Index.
- *
+ *
* @param schemaManager The server schemaManager
* @throws IOException if we cannot initialize the forward and reverse
* tables
@@ -192,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, AbstractBTreePartition.DEFAULT_CACHE_SIZE );
+ StringSerializer.INSTANCE, forwardDups, AbstractBTreePartition.DEFAULT_CACHE_SIZE );
/*
* Now the reverse map stores the primary key into the master table as
@@ -203,7 +203,7 @@ public class MavibotIndex<K> extends Abs
if ( withReverse )
{
String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
- reverse = new MavibotTable<String, K>( recordMan, schemaManager, reverseTableName, new StringSerializer(),
+ reverse = new MavibotTable<String, K>( recordMan, schemaManager, reverseTableName, StringSerializer.INSTANCE,
forwardKeySerializer, !attributeType.isSingleValued() );
}
@@ -218,7 +218,7 @@ public class MavibotIndex<K> extends Abs
/**
* Sets the RecordManager
- *
+ *
* @param rm the RecordManager instance
*/
public void setRecordManager( RecordManager rm )
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=1578010&r1=1578009&r2=1578010&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 Sun Mar 16 09:19:58 2014
@@ -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.
- *
+ *
*/
package org.apache.directory.server.core.partition.impl.btree.mavibot;
@@ -40,13 +40,13 @@ public class MavibotMasterTable extends
public MavibotMasterTable( RecordManager recordMan, SchemaManager schemaManager, String name, int cacheSize )
throws IOException
{
- super( recordMan, schemaManager, name, new StringSerializer(), new MavibotEntrySerializer(), false, cacheSize );
+ super( recordMan, schemaManager, name, StringSerializer.INSTANCE, new MavibotEntrySerializer(), false, cacheSize );
}
public MavibotMasterTable( RecordManager recordMan, SchemaManager schemaManager, String name )
throws IOException
{
- super( recordMan, schemaManager, name, new StringSerializer(), new MavibotEntrySerializer(), false );
+ super( recordMan, schemaManager, name, StringSerializer.INSTANCE, new MavibotEntrySerializer(), false );
}
Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotRdnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotRdnIndex.java?rev=1578010&r1=1578009&r2=1578010&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotRdnIndex.java (original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotRdnIndex.java Sun Mar 16 09:19:58 2014
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
/**
* A special index which stores Rdn objects.
- *
+ *
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class MavibotRdnIndex extends MavibotIndex<ParentIdAndRdn>
@@ -99,7 +99,7 @@ public class MavibotRdnIndex extends Mav
/**
* Initializes the forward and reverse tables used by this Index.
- *
+ *
* @param schemaManager The server schemaManager
* @throws IOException if we cannot initialize the forward and reverse
* tables
@@ -119,10 +119,10 @@ public class MavibotRdnIndex extends Mav
String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
forward = new MavibotTable<ParentIdAndRdn, String>( recordMan, schemaManager, forwardTableName,
- parentIdAndSerializer, new StringSerializer(), false );
+ parentIdAndSerializer, StringSerializer.INSTANCE, false );
String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
reverse = new MavibotTable<String, ParentIdAndRdn>( recordMan, schemaManager, reverseTableName,
- new StringSerializer(), parentIdAndSerializer, false );
+ StringSerializer.INSTANCE, parentIdAndSerializer, false );
}
}