From caa38c1354824a2da50a8fbc8fc85ba1b0dfc7fe Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 06 Oct 2015 14:43:56 +0000
Subject: [PATCH] OPENDJ-1719 Consider migrating JE backend to new PluggableBackend framework

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
index 41d57a5..36f5b74 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
@@ -111,11 +111,8 @@
   private static final int IMPORT_DB_CACHE_SIZE = 4 * MB;
 
   private static final double MAX_SLEEP_ON_RETRY_MS = 50.0;
-
   private static final String VOLUME_NAME = "dj";
-
   private static final String JOURNAL_NAME = VOLUME_NAME + "_journal";
-
   /** The buffer / page size used by the PersistIt storage. */
   private static final int BUFFER_SIZE = 16 * 1024;
 
@@ -139,7 +136,8 @@
     }
 
     @Override
-    public boolean isDefined() {
+    public boolean isDefined()
+    {
       return exchange.getValue().isDefined();
     }
 
@@ -255,8 +253,10 @@
       currentValue = null;
     }
 
-    private void throwIfUndefined() {
-      if (!isDefined()) {
+    private void throwIfUndefined()
+    {
+      if (!isDefined())
+      {
         throw new NoSuchElementException();
       }
     }
@@ -413,8 +413,8 @@
   /** PersistIt implementation of the {@link WriteableTransaction} interface. */
   private final class WriteableStorageImpl implements StorageImpl
   {
+    private static final String DUMMY_RECORD = "_DUMMY_RECORD_";
     private final Map<TreeName, Exchange> exchanges = new HashMap<>();
-    private final String DUMMY_RECORD = "_DUMMY_RECORD_";
 
     @Override
     public void put(final TreeName treeName, final ByteSequence key, final ByteSequence value)
@@ -713,7 +713,7 @@
   private Volume volume;
   private PDBBackendCfg config;
   private DiskSpaceMonitor diskMonitor;
-  private PDBMonitor pdbMonitor;
+  private PDBMonitor monitor;
   private MemoryQuota memQuota;
   private StorageStatus storageStatus = StorageStatus.working();
 
@@ -780,8 +780,8 @@
   {
     if (db != null)
     {
-      DirectoryServer.deregisterMonitorProvider(pdbMonitor);
-      pdbMonitor = null;
+      DirectoryServer.deregisterMonitorProvider(monitor);
+      monitor = null;
       try
       {
         db.close();
@@ -834,8 +834,8 @@
 
       db.initialize();
       volume = db.loadVolume(VOLUME_NAME);
-      pdbMonitor = new PDBMonitor(config.getBackendId() + " PDB Database", db);
-      DirectoryServer.registerMonitorProvider(pdbMonitor);
+      monitor = new PDBMonitor(config.getBackendId() + " PDB Database", db);
+      DirectoryServer.registerMonitorProvider(monitor);
     }
     catch(final InUseException e) {
       throw new StorageInUseException(e);

--
Gitblit v1.10.0