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/BackupManager.java |   38 ++------------------------------------
 1 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/BackupManager.java b/opends/src/server/org/opends/server/backends/jeb/BackupManager.java
index 345cdaf..7567e94 100644
--- a/opends/src/server/org/opends/server/backends/jeb/BackupManager.java
+++ b/opends/src/server/org/opends/server/backends/jeb/BackupManager.java
@@ -151,23 +151,6 @@
   public void createBackup(JEBackendCfg cfg, BackupConfig backupConfig)
        throws DirectoryException
   {
-    // Parse our backend configuration.
-    Config config = new Config();
-    try
-    {
-      config.initializeConfig(cfg);
-    }
-    catch (ConfigException e)
-    {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
-      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
-                                   e.getMessage(),
-                                   e.getMessageID());
-    }
-
     // Get the properties to use for the backup.
     String          backupID        = backupConfig.getBackupID();
     BackupDirectory backupDir       = backupConfig.getBackupDirectory();
@@ -249,7 +232,7 @@
     // If this is an incremental, determine the base backup for this backup.
     HashSet<String> dependencies = new HashSet<String>();
     BackupInfo baseBackup = null;
-    File backendDir = config.getBackendDirectory();
+    File backendDir = getFileForPath(cfg.getBackendDirectory());
 /*
     FilenameFilter backupTagFilter = new FilenameFilter()
     {
@@ -764,26 +747,9 @@
 
     BackupInfo backupInfo = getBackupInfo(backupDir, backupID);
 
-    // Parse our backend configuration.
-    Config config = new Config();
-    try
-    {
-      config.initializeConfig(cfg);
-    }
-    catch (ConfigException e)
-    {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
-      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
-                                   e.getMessage(),
-                                   e.getMessageID());
-    }
-
     // Create a restore directory with a different name to the backend
     // directory.
-    File currentDir = config.getBackendDirectory();
+    File currentDir = getFileForPath(cfg.getBackendDirectory());
     File restoreDir = new File(currentDir.getPath() + "-restore-" + backupID);
     if (!verifyOnly)
     {

--
Gitblit v1.10.0