From 7eda83737e5c2a09bef758ac2bcd3b7ea8b32ce3 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Wed, 20 Jun 2007 18:27:41 +0000
Subject: [PATCH] This refactoring includes the following changes to the JE backend: - Extracted common interface DatabaseContainer from DN2ID, ID2Entry, etc... classes. - Moved database read and write methods from EntryContainer to DatabaseContainer. - Added index configuration to the XML based admin framework. - Removed redundant configuration objects (Config, IndexConfig). - Added exclusive/shared lock to EntryContainer. All access to an EntryContainer must acquire a lock before using the internal  DatabaseContainers or making configuration changes. - Added the ability to add/remove/modify indexes with the backend online. Server will issue rebuild required warning when adding new indexes  or sub-indexes (equality, substring, presence...). - Added the ability to change the index entry limit for both the backend and each index with the backend online. Server will issue rebuild  required warning if the previous limit has been exceeded. - Added the ability to change entry compression and index substring length setting while the backend is online. - Added a persistent state database to each EntryContainer to persist backend configuration between server restarts. Server will issue  rebuild required warning if a new index is added when the backend is offline. - Added a trusted flag to indexes so that non existent keys will not be interpreted as an empty entry ID set when an index is untrusted. An  index is untrusted when it is added to an non-empty EntryContainer or an inconsistency is detected. Server will issue warning on startup to  rebuild the index.  - Fixed a issue where the LDIF import process stops responding if the temporary import dir is full or unwritable. 

---
 opends/src/server/org/opends/server/backends/jeb/DbPreloadComparator.java |   37 ++++++++++++-------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/DbPreloadComparator.java b/opends/src/server/org/opends/server/backends/jeb/DbPreloadComparator.java
index bd65016..1808d5e 100644
--- a/opends/src/server/org/opends/server/backends/jeb/DbPreloadComparator.java
+++ b/opends/src/server/org/opends/server/backends/jeb/DbPreloadComparator.java
@@ -26,11 +26,8 @@
  */
 package org.opends.server.backends.jeb;
 
-import com.sleepycat.je.Database;
-import com.sleepycat.je.DatabaseException;
 import static org.opends.server.loggers.debug.DebugLogger.*;
 import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.types.DebugLogLevel;
 
 import java.util.Comparator;
 
@@ -38,7 +35,8 @@
  * This comparator is used to sort databases in order of priority
  * for preloading into the cache.
  */
-public class DbPreloadComparator implements Comparator<Database>
+public class DbPreloadComparator
+    implements Comparator<DatabaseContainer>
 {
   /**
    * The tracer object for the debug logger.
@@ -52,30 +50,19 @@
    * @param database A handle to the database.
    * @return 1 for id2entry database, 2 for dn2id database, 3 for all others.
    */
-  static private int priority(Database database)
+  static private int priority(DatabaseContainer database)
   {
-    try
+    String name = database.getName();
+    if (name.endsWith(EntryContainer.ID2ENTRY_DATABASE_NAME))
     {
-      String name = database.getDatabaseName();
-      if (name.endsWith(EntryContainer.ID2ENTRY_DATABASE_NAME))
-      {
-        return 1;
-      }
-      else if (name.endsWith(EntryContainer.DN2ID_DATABASE_NAME))
-      {
-        return 2;
-      }
-      else
-      {
-        return 3;
-      }
+      return 1;
     }
-    catch (DatabaseException e)
+    else if (name.endsWith(EntryContainer.DN2ID_DATABASE_NAME))
     {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
+      return 2;
+    }
+    else
+    {
       return 3;
     }
   }
@@ -91,7 +78,7 @@
    *         first argument is less than, equal to, or greater than the
    *         second.
    **/
-  public int compare(Database database1, Database database2)
+  public int compare(DatabaseContainer database1, DatabaseContainer database2)
   {
     return priority(database1) - priority(database2);
   }

--
Gitblit v1.10.0