From ad41085e4ca8a32e29d443591069ec4e94e65067 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 02 Oct 2015 15:34:44 +0000
Subject: [PATCH] AutoRefactor'ed the pluggable and PDB backend

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeImporter.java |   32 ++++++++++++++------------------
 1 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeImporter.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeImporter.java
index 8395792..1a4ce66 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeImporter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeImporter.java
@@ -138,7 +138,6 @@
  */
 final class OnDiskMergeImporter
 {
-
   private static final String DEFAULT_TMP_DIR = "import-tmp";
 
   private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
@@ -190,7 +189,6 @@
       logger.info(NOTE_IMPORT_STARTING, DirectoryServer.getVersionString(), BUILD_ID, REVISION);
       logger.info(NOTE_IMPORT_THREAD_COUNT, threadCount);
 
-
       final long startTime = System.currentTimeMillis();
       final OnDiskMergeImporter importer;
       final ExecutorService sorter = Executors.newFixedThreadPool(
@@ -298,7 +296,7 @@
       logger.info(NOTE_REBUILD_FINAL_STATUS, importer.getImportedCount(), totalTime / 1000, rate);
     }
 
-    private final static Set<String> selectIndexesToRebuild(EntryContainer entryContainer, RebuildConfig rebuildConfig,
+    private static final Set<String> selectIndexesToRebuild(EntryContainer entryContainer, RebuildConfig rebuildConfig,
         long totalEntries)
     {
       final SelectIndexName selector = new SelectIndexName();
@@ -393,7 +391,7 @@
   /** Source of LDAP {@link Entry}s to process. */
   private interface Source
   {
-    /** Process {@link Entry}s extracted from a {@link Source} */
+    /** Process {@link Entry}s extracted from a {@link Source}. */
     interface EntryProcessor
     {
       void processEntry(EntryContainer container, EntryID entryID, Entry entry) throws Exception;
@@ -681,10 +679,9 @@
   private static final int MAX_BUFFER_SIZE = 2 * MB;
   /** Min size of phase one buffer. */
   private static final int MIN_BUFFER_SIZE = 4 * KB;
-  /** DB cache size to use during import */
+  /** DB cache size to use during import. */
   private static final int DB_CACHE_SIZE = 4 * MB;
-  /** DB cache size to use during import */
-  /** Required free memory for this importer */
+  /** Required free memory for this importer. */
   private static final int REQUIRED_FREE_MEMORY = 50 * MB;
   /** LDIF reader. */
   /** Map of DNs to Suffix objects. */
@@ -867,7 +864,7 @@
           id2count, newCollector(entryContainer, id2count.getName()), dn2idAlreadyImported);
     }
 
-    final static Callable<Void> newFlushTask(final Chunk chunk)
+    static final Callable<Void> newFlushTask(final Chunk chunk)
     {
       return new Callable<Void>()
       {
@@ -1486,7 +1483,7 @@
 
           private Integer getOffsetAtPosition(int pos)
           {
-            return (int) buffer.readInt(pos);
+            return buffer.readInt(pos);
           }
 
           @Override
@@ -1533,7 +1530,7 @@
         bufferPool.release(buffer);
       }
 
-      /** Cursor of the in-memory chunk */
+      /** Cursor of the in-memory chunk. */
       private final class InMemorySortedChunkCursor implements MeteredCursor<ByteString, ByteString>
       {
         private ByteString key;
@@ -2445,7 +2442,7 @@
     return results;
   }
 
-  /** Regularly report progress statistics from the registered list of {@link ProgressMetric} */
+  /** Regularly report progress statistics from the registered list of {@link ProgressMetric}. */
   private static final class PhaseTwoProgressReporter implements Runnable, Closeable
   {
     private static final String PHASE2_REPORTER_THREAD_NAME = "PHASE2-REPORTER-%d";
@@ -2515,15 +2512,15 @@
   /** Buffer used by {@link InMemorySortedChunk} to store and sort data. */
   private interface Buffer extends Closeable
   {
-    void writeInt(final int position, final int value);
+    void writeInt(int position, int value);
 
-    int readInt(final int position);
+    int readInt(int position);
 
-    long readCompactUnsignedLong(final int position);
+    long readCompactUnsignedLong(int position);
 
     ByteString readByteString(int position, int length);
 
-    int writeCompactUnsignedLong(final int position, long value);
+    int writeCompactUnsignedLong(int position, long value);
 
     void writeByteSequence(int position, ByteSequence data);
 
@@ -3453,8 +3450,8 @@
     }
   }
 
-  /** Adapter allowing to use an {@link Importer} as a {@link WriteableTransaction} */
-  private final static class ImporterToWriteableTransactionAdapter implements WriteableTransaction
+  /** Adapter allowing to use an {@link Importer} as a {@link WriteableTransaction}. */
+  private static final class ImporterToWriteableTransactionAdapter implements WriteableTransaction
   {
     private final Importer importer;
 
@@ -3527,5 +3524,4 @@
       throw new UnsupportedOperationException();
     }
   }
-
 }

--
Gitblit v1.10.0