From 60b9d6cf6a4cffecb338c2f65538094461aa3c0d Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Sat, 25 Aug 2007 22:32:55 +0000
Subject: [PATCH] - [Issue 2030] new configuration attribute to enforce entry compression:   allow for backend-compact-encoding property, enabled by default.

---
 opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java b/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
index 380c4f5..a75f5c7 100644
--- a/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
+++ b/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
@@ -212,9 +212,8 @@
   private long persistentEntriesRestored = 0;
 
   // The configuration to use when encoding entries in the database.
-  // TODO: make compression feature configurable.
-  private static EntryEncodeConfig encodeConfig =
-      new EntryEncodeConfig(true, false, false);
+  private EntryEncodeConfig encodeConfig =
+    new EntryEncodeConfig(true, false, false);
 
   /**
    * Creates a new instance of this entry cache.
@@ -1212,6 +1211,7 @@
     int                   newJECachePercent;
     long                  newJECacheSize;
     boolean               newPersistentCache;
+    boolean               newCompactEncoding;
     String                newCacheType = DEFAULT_FSCACHE_TYPE;
     String                newCacheHome = DEFAULT_FSCACHE_HOME;
 
@@ -1238,6 +1238,9 @@
     // Check if this cache is persistent.
     newPersistentCache = configuration.isPersistentCache();
 
+    // Check if this cache should use compact encoding.
+    newCompactEncoding = configuration.isBackendCompactEncoding();
+
     switch (errorHandler.getConfigPhase())
     {
     case PHASE_INIT:
@@ -1331,6 +1334,9 @@
       maxAllowedMemory = newMaxAllowedMemory;
       persistentCache  = newPersistentCache;
 
+      encodeConfig     = new EntryEncodeConfig(true,
+        newCompactEncoding, newCompactEncoding);
+
       setLockTimeout(newLockTimeout);
       setIncludeFilters(newIncludeFilters);
       setExcludeFilters(newExcludeFilters);

--
Gitblit v1.10.0