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/IndexBuilder.java |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/IndexBuilder.java b/opends/src/server/org/opends/server/backends/jeb/IndexBuilder.java
index 33b596e..50e00e5 100644
--- a/opends/src/server/org/opends/server/backends/jeb/IndexBuilder.java
+++ b/opends/src/server/org/opends/server/backends/jeb/IndexBuilder.java
@@ -28,6 +28,7 @@
 
 import org.opends.server.protocols.asn1.ASN1OctetString;
 import org.opends.server.types.Entry;
+import static org.opends.server.util.StaticUtils.getFileForPath;
 
 import com.sleepycat.je.DatabaseException;
 import com.sleepycat.je.Transaction;
@@ -139,8 +140,7 @@
     this.entryLimit = entryLimit;
     this.bufferSize = (int)bufferSize/100;
     long tid = Thread.currentThread().getId();
-    fileNamePrefix = importContext.getContainerName() + "_" +
-         indexer.toString() + "_" + tid + "_";
+    fileNamePrefix = index.getName() + "_" + tid + "_";
     replaceExisting =
          importContext.getLDIFImportConfig().appendToExistingData() &&
          importContext.getLDIFImportConfig().replaceExistingEntries();
@@ -156,7 +156,8 @@
   public void startProcessing()
   {
     // Clean up any work files left over from a previous run.
-    File tempDir = new File(importContext.getConfig().getImportTempDirectory());
+    File tempDir = getFileForPath(
+        importContext.getConfig().getBackendImportTempDirectory());
     File[] files = tempDir.listFiles(filter);
     if (files != null)
     {
@@ -314,7 +315,8 @@
     // Start a new file.
     fileNumber++;
     String fileName = fileNamePrefix + String.valueOf(fileNumber);
-    File file = new File(importContext.getConfig().getImportTempDirectory(),
+    File file = new File(getFileForPath(
+        importContext.getConfig().getBackendImportTempDirectory()),
                          fileName);
     BufferedOutputStream bufferedStream =
          new BufferedOutputStream(new FileOutputStream(file));

--
Gitblit v1.10.0