You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2008/07/22 17:27:07 UTC

svn commit: r678777 - in /directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm: JdbmIndex.java JdbmMasterTable.java

Author: kayyagari
Date: Tue Jul 22 08:27:07 2008
New Revision: 678777

URL: http://svn.apache.org/viewvc?rev=678777&view=rev
Log:
JdbmIndex and JdbmMasterTable - reduced the access levels of some private variables to protected to use them in changelog implementations through inheritance
JdbmMasterTable - added a new constructor which takes a database name and avoids using registries


Modified:
    directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java

Modified: directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=678777&r1=678776&r2=678777&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Tue Jul 22 08:27:07 2008
@@ -65,38 +65,38 @@
      * the value of the btree is the entry id of the entry containing an attribute with
      * that value
      */
-    private JdbmTable<K, Long> forward;
+    protected JdbmTable<K, Long> forward;
     /**
      * the reverse btree where the btree key is the entry id of the entry containing a
      * value for the indexed attribute, and the btree value is the value of the indexed
      * attribute
      */
-    private JdbmTable<Long,K> reverse;
+    protected JdbmTable<Long,K> reverse;
     /**
      * the JDBM record manager for the file containing this index
      */
-    private RecordManager recMan;
+    protected RecordManager recMan;
     /**
      * the normalized value cache for this index
      * @todo I don't think the keyCache is required anymore since the normalizer
      * will cache values for us.
      */
-    private SynchronizedLRUMap keyCache;
+    protected SynchronizedLRUMap keyCache;
     /** the size (number of index entries) for the cache */
-    private int cacheSize = DEFAULT_INDEX_CACHE_SIZE;
+    protected int cacheSize = DEFAULT_INDEX_CACHE_SIZE;
     /**
      * duplicate limit before duplicate keys switch to using a btree for values
      */
-    private int numDupLimit = DEFAULT_DUPLICATE_LIMIT;
+    protected int numDupLimit = DEFAULT_DUPLICATE_LIMIT;
     /**
      * the attribute identifier set at configuration time for this index which may not
      * be the OID but an alias name for the attributeType associated with this Index
      */
     private String attributeId;
     /** whether or not this index has been initialized */
-    private boolean initialized;
+    protected boolean initialized;
     /** a customm working directory path when specified in configuration */
-    private File wkDirPath;
+    protected File wkDirPath;
 
 
     /*
@@ -159,7 +159,7 @@
         initialized = true;
     }
 
-
+    
     /**
      * Initializes the forward and reverse tables used by this Index.
      * 

Modified: directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?rev=678777&r1=678776&r2=678777&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java (original)
+++ directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java Tue Jul 22 08:27:07 2008
@@ -22,6 +22,7 @@
 
 import jdbm.RecordManager;
 import jdbm.helper.LongSerializer;
+import jdbm.helper.Serializer;
 import jdbm.helper.StringComparator;
 
 import org.apache.directory.server.xdbm.MasterTable;
@@ -104,7 +105,7 @@
     };
 
 
-    private final JdbmTable<String,String> adminTbl;
+    protected final JdbmTable<String,String> adminTbl;
 
 
     /**
@@ -127,6 +128,18 @@
     }
 
 
+    protected JdbmMasterTable( RecordManager recMan, String dbName, Serializer serializer ) throws Exception
+    {
+        super( DBF, recMan, LONG_COMPARATOR, LongSerializer.INSTANCE, serializer );
+        adminTbl = new JdbmTable<String,String>( dbName, recMan, STRING_COMPARATOR, null, null );
+        String seqValue = adminTbl.get( SEQPROP_KEY );
+
+        if ( null == seqValue )
+        {
+            adminTbl.put( SEQPROP_KEY, "0" );
+        }
+    }
+
     /**
      * Gets the ServerEntry from this MasterTable.
      *