bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhai...@apache.org
Subject [bookkeeper] branch master updated: ISSUE #230: Add Checkstyle to the build process (Part 2)
Date Tue, 18 Jul 2017 03:02:23 GMT
This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 086537b  ISSUE #230: Add Checkstyle to the build process (Part 2)
086537b is described below

commit 086537beda9427c057a286ad6c4614659da6ed7f
Author: sigee <sigee15@gmail.com>
AuthorDate: Tue Jul 18 11:02:03 2017 +0800

    ISSUE #230: Add Checkstyle to the build process (Part 2)
    
    Fix issues checkstyle reported in
      - org.apache.bookkeeper.auth
      - org.apache.bookkeeper.bookie
    
    Checkstyle is not added to the bookkeeper-server yet.
    
    ---
    Be sure to do all of the following to help us incorporate your contribution
    quickly and easily:
    
    - [X] Make sure the PR title is formatted like:
        `<Issue # or BOOKKEEPER-#>: Description of pull request`
        `e.g. Issue 123: Description ...`
        `e.g. BOOKKEEPER-1234: Description ...`
    - [ ] Make sure tests pass via `mvn clean apache-rat:check install findbugs:check`.
    - [X] Replace `<Issue # or BOOKKEEPER-#>` in the title with the actual Issue/JIRA number.
    
    ---
    
    Author: sigee <sigee15@gmail.com>
    
    Reviewers: Jia Zhai <None>, Sijie Guo <None>
    
    This closes #234 from sigee/checkstyle2, closes #230
---
 .../org/apache/bookkeeper/auth/AuthCallbacks.java  |   5 +-
 .../auth/AuthProviderFactoryFactory.java           |  13 +-
 .../java/org/apache/bookkeeper/auth/AuthToken.java |   2 +-
 .../bookkeeper/auth/BookKeeperPrincipal.java       |   2 +-
 .../apache/bookkeeper/auth/BookieAuthProvider.java |   7 +-
 .../apache/bookkeeper/auth/ClientAuthProvider.java |   7 +-
 .../auth/{AuthCallbacks.java => package-info.java} |  14 +-
 .../bookkeeper/bookie/BookKeeperServerStats.java   |   3 +
 .../java/org/apache/bookkeeper/bookie/Bookie.java  | 113 ++++++-------
 .../bookkeeper/bookie/BookieConnectionPeer.java    |   2 +-
 .../apache/bookkeeper/bookie/BookieException.java  |  24 ++-
 .../org/apache/bookkeeper/bookie/BookieShell.java  | 183 +++++++++-----------
 .../org/apache/bookkeeper/bookie/BookieThread.java |  12 +-
 .../apache/bookkeeper/bookie/BufferedChannel.java  |  38 ++---
 .../bookkeeper/bookie/BufferedChannelBase.java     |   3 +
 .../bookkeeper/bookie/BufferedReadChannel.java     |  21 ++-
 .../apache/bookkeeper/bookie/CacheCallback.java    |   4 +-
 .../apache/bookkeeper/bookie/CheckpointSource.java |  10 +-
 .../bookkeeper/bookie/CheckpointSourceList.java    |   3 +
 .../bookie/CompactableLedgerStorage.java           |   9 +-
 .../java/org/apache/bookkeeper/bookie/Cookie.java  | 100 +++++------
 .../org/apache/bookkeeper/bookie/EntryKey.java     |  14 +-
 .../apache/bookkeeper/bookie/EntryKeyValue.java    |   6 +-
 .../apache/bookkeeper/bookie/EntryLocation.java    |   3 +
 .../org/apache/bookkeeper/bookie/EntryLogger.java  | 106 ++++++------
 .../apache/bookkeeper/bookie/EntryMemTable.java    |  42 +++--
 .../org/apache/bookkeeper/bookie/ExitCode.java     |  14 +-
 .../org/apache/bookkeeper/bookie/FileInfo.java     |  62 +++----
 .../bookkeeper/bookie/FileSystemUpgrade.java       |  31 ++--
 .../apache/bookkeeper/bookie/GarbageCollector.java |  18 +-
 .../bookkeeper/bookie/GarbageCollectorThread.java  |  41 ++---
 .../bookkeeper/bookie/IndexInMemPageMgr.java       | 105 +++++-------
 .../bookkeeper/bookie/IndexPersistenceMgr.java     |  10 +-
 .../bookie/InterleavedLedgerStorage.java           |  18 +-
 .../java/org/apache/bookkeeper/bookie/Journal.java | 187 ++++++++++-----------
 .../apache/bookkeeper/bookie/JournalChannel.java   |  18 +-
 .../bookkeeper/bookie/LEPStateChangeCallback.java  |   8 +-
 .../bookie/LastAddConfirmedUpdateNotification.java |   3 +
 .../apache/bookkeeper/bookie/LedgerCacheImpl.java  |   5 +-
 .../bookkeeper/bookie/LedgerDescriptorImpl.java    |   3 +-
 .../bookkeeper/bookie/LedgerDirsManager.java       |  70 ++++----
 .../bookkeeper/bookie/LedgerDirsMonitor.java       |  13 +-
 .../apache/bookkeeper/bookie/LedgerEntryPage.java  |  18 +-
 .../apache/bookkeeper/bookie/LedgerStorage.java    |  49 +++---
 .../bookkeeper/bookie/LedgerStorageFactory.java    |   3 +
 .../bookie/LocalBookieEnsemblePlacementPolicy.java |  25 ++-
 .../java/org/apache/bookkeeper/bookie/LogMark.java |   4 +-
 .../bookkeeper/bookie/MarkerFileChannel.java       |   3 +-
 .../apache/bookkeeper/bookie/ReadOnlyBookie.java   |   6 +-
 .../bookkeeper/bookie/ReadOnlyEntryLogger.java     |   2 +-
 .../bookie/ScanAndCompareGarbageCollector.java     |   8 +-
 .../apache/bookkeeper/bookie/SkipListArena.java    |  27 +--
 .../apache/bookkeeper/bookie/SkipListFlusher.java  |  13 +-
 .../bookkeeper/bookie/SortedLedgerStorage.java     |   7 +-
 .../org/apache/bookkeeper/bookie/SyncThread.java   |   6 +-
 ...BookieConnectionPeer.java => package-info.java} |  14 +-
 .../org/apache/bookkeeper/proto/AuthHandler.java   |   2 +-
 .../bookkeeper/proto/BookieRequestProcessor.java   |   2 +-
 58 files changed, 758 insertions(+), 783 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthCallbacks.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthCallbacks.java
index 200420a..27f9ac5 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthCallbacks.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthCallbacks.java
@@ -17,10 +17,13 @@
 package org.apache.bookkeeper.auth;
 
 /**
- * Callbacks for AuthProviders
+ * Callbacks for AuthProviders.
  */
 public abstract class AuthCallbacks {
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public interface GenericCallback<T> {
 
         void operationComplete(int rc, T result);
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthProviderFactoryFactory.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthProviderFactoryFactory.java
index 7254903..f84dfb3 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthProviderFactoryFactory.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthProviderFactoryFactory.java
@@ -26,14 +26,13 @@ import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.conf.ServerConfiguration;
 import org.apache.bookkeeper.util.ReflectionUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.bookkeeper.client.ClientConnectionPeer;
 import org.apache.bookkeeper.bookie.BookieConnectionPeer;
 
-
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class AuthProviderFactoryFactory {
-    static Logger LOG = LoggerFactory.getLogger(AuthProviderFactoryFactory.class);
 
     public static BookieAuthProvider.Factory newBookieAuthProviderFactory(ServerConfiguration conf) throws IOException {
         String factoryClassName = conf.getBookieAuthProviderFactoryClass();
@@ -61,12 +60,12 @@ public class AuthProviderFactoryFactory {
         return factory;
     }
 
-    public final static String authenticationDisabledPluginName = "AuthDisabledPlugin";
+    public static final String AUTHENTICATION_DISABLED_PLUGIN_NAME = "AuthDisabledPlugin";
 
     private static class AuthenticationDisabledAuthProviderFactory implements BookieAuthProvider.Factory {
         @Override
         public String getPluginName() {
-            return authenticationDisabledPluginName;
+            return AUTHENTICATION_DISABLED_PLUGIN_NAME;
         }
 
         @Override
@@ -90,7 +89,7 @@ public class AuthProviderFactoryFactory {
     private static class NullClientAuthProviderFactory implements ClientAuthProvider.Factory {
         @Override
         public String getPluginName() {
-            return authenticationDisabledPluginName;
+            return AUTHENTICATION_DISABLED_PLUGIN_NAME;
         }
 
         @Override
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthToken.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthToken.java
index f4d0fab..918d910 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthToken.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthToken.java
@@ -21,7 +21,7 @@
 package org.apache.bookkeeper.auth;
 
 /**
- * A generic payload for Authentication Messages
+ * A generic payload for Authentication Messages.
  */
 public class AuthToken {
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookKeeperPrincipal.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookKeeperPrincipal.java
index 7f6e582..41eade5 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookKeeperPrincipal.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookKeeperPrincipal.java
@@ -23,7 +23,7 @@ package org.apache.bookkeeper.auth;
 import java.util.Objects;
 
 /**
- * A Principal is the user bound to the connection
+ * A Principal is the user bound to the connection.
  */
 public class BookKeeperPrincipal {
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookieAuthProvider.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookieAuthProvider.java
index 84577c7..cd0a0bb 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookieAuthProvider.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/BookieAuthProvider.java
@@ -32,6 +32,9 @@ import org.apache.bookkeeper.bookie.BookieConnectionPeer;
  * an authentication mechanism for bookkeeper connections.
  */
 public interface BookieAuthProvider {
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     interface Factory {
         /**
          * Initialize the factory with the server configuration
@@ -69,7 +72,7 @@ public interface BookieAuthProvider {
         String getPluginName();
 
         /**
-        * Release resources
+        * Release resources.
         */
         default void close() {}
     }
@@ -83,7 +86,7 @@ public interface BookieAuthProvider {
     void process(AuthToken m, AuthCallbacks.GenericCallback<AuthToken> cb);
 
     /**
-     * Release resources
+     * Release resources.
      */
     default void close() {}
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/ClientAuthProvider.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/ClientAuthProvider.java
index b24b1b4..043cea2 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/ClientAuthProvider.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/ClientAuthProvider.java
@@ -31,6 +31,9 @@ import org.apache.bookkeeper.client.ClientConnectionPeer;
  * an authentication mechanism for bookkeeper connections.
  */
 public interface ClientAuthProvider {
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     interface Factory {
         /**
          * Initialize the factory with the client configuration
@@ -66,7 +69,7 @@ public interface ClientAuthProvider {
         String getPluginName();
 
         /**
-        * Release resources
+        * Release resources.
         */
         default void close() {}
     }
@@ -88,7 +91,7 @@ public interface ClientAuthProvider {
     void process(AuthToken m, AuthCallbacks.GenericCallback<AuthToken> cb);
 
     /**
-     * Release resources
+     * Release resources.
      */
     default void close() {}
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthCallbacks.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/package-info.java
similarity index 79%
copy from bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthCallbacks.java
copy to bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/package-info.java
index 200420a..5c86fab 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/AuthCallbacks.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/auth/package-info.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements. See the NOTICE file distributed with this
  * work for additional information regarding copyright ownership. The ASF
@@ -14,15 +14,7 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.apache.bookkeeper.auth;
-
 /**
- * Callbacks for AuthProviders
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
  */
-public abstract class AuthCallbacks {
-
-    public interface GenericCallback<T> {
-
-        void operationComplete(int rc, T result);
-    }
-}
+package org.apache.bookkeeper.auth;
\ No newline at end of file
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookKeeperServerStats.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookKeeperServerStats.java
index e0690fb..eae8f1a 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookKeeperServerStats.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookKeeperServerStats.java
@@ -20,6 +20,9 @@
  */
 package org.apache.bookkeeper.bookie;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public interface BookKeeperServerStats {
 
     String SERVER_SCOPE = "bookkeeper_server";
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
index 3375204..15bd634 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
@@ -116,7 +116,7 @@ import io.netty.buffer.Unpooled;
  */
 public class Bookie extends BookieCriticalThread {
 
-    private final static Logger LOG = LoggerFactory.getLogger(Bookie.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Bookie.class);
 
     final List<File> journalDirectories;
     final ServerConfiguration conf;
@@ -138,7 +138,7 @@ public class Bookie extends BookieCriticalThread {
 
     private final LedgerDirsManager ledgerDirsManager;
     private LedgerDirsManager indexDirsManager;
-    
+
     LedgerDirsMonitor ledgerMonitor;
     LedgerDirsMonitor idxMonitor;
 
@@ -154,12 +154,12 @@ public class Bookie extends BookieCriticalThread {
 
     private final ConcurrentLongHashMap<byte[]> masterKeyCache = new ConcurrentLongHashMap<>();
 
-    final protected String zkBookieRegPath;
-    final protected String zkBookieReadOnlyPath;
-    final protected List<ACL> zkAcls;
+    protected final String zkBookieRegPath;
+    protected final String zkBookieReadOnlyPath;
+    protected final List<ACL> zkAcls;
 
-    final private AtomicBoolean zkRegistered = new AtomicBoolean(false);
-    final protected AtomicBoolean readOnly = new AtomicBoolean(false);
+    private final AtomicBoolean zkRegistered = new AtomicBoolean(false);
+    protected final AtomicBoolean readOnly = new AtomicBoolean(false);
     // executor to manage the state changes for a bookie.
     final ExecutorService stateService = Executors.newSingleThreadExecutor(
             new ThreadFactoryBuilder().setNameFormat("BookieStateService-%d").build());
@@ -175,6 +175,9 @@ public class Bookie extends BookieCriticalThread {
     private final OpStatsLogger addBytesStats;
     private final OpStatsLogger readBytesStats;
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public static class NoLedgerException extends IOException {
         private static final long serialVersionUID = 1L;
         private final long ledgerId;
@@ -186,6 +189,10 @@ public class Bookie extends BookieCriticalThread {
             return ledgerId;
         }
     }
+
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public static class NoEntryException extends IOException {
         private static final long serialVersionUID = 1L;
         private final long ledgerId;
@@ -319,8 +326,8 @@ public class Bookie extends BookieCriticalThread {
             for (File journalDirectory : journalDirectories) {
                 checkDirectoryStructure(journalDirectory);
             }
-            if(!newEnv){
-                for(Cookie journalCookie: journalCookies) {
+            if (!newEnv) {
+                for (Cookie journalCookie: journalCookies) {
                     masterCookie.verify(journalCookie);
                 }
             }
@@ -342,7 +349,7 @@ public class Bookie extends BookieCriticalThread {
                 // Also, if a new ledger dir is being added, we make sure that
                 // that dir is empty. Else, we reject the request
                 Set<String> existingLedgerDirs = Sets.newHashSet();
-                for(Cookie journalCookie : journalCookies) {
+                for (Cookie journalCookie : journalCookies) {
                     Collections.addAll(existingLedgerDirs, journalCookie.getLedgerDirPathsFromCookie());
                 }
                 List<File> dirsMissingData = new ArrayList<File>();
@@ -378,7 +385,7 @@ public class Bookie extends BookieCriticalThread {
                 }
                 masterCookie.writeToZooKeeper(zk, conf, zkCookie != null ? zkCookie.getVersion() : Version.NEW);
             }
-            
+
             List<File> ledgerDirs = ledgerDirsManager.getAllLedgerDirs();
             checkIfDirsOnSameDiskPartition(ledgerDirs);
             List<File> indexDirs = indexDirsManager.getAllLedgerDirs();
@@ -404,9 +411,9 @@ public class Bookie extends BookieCriticalThread {
      * If ALLOW_MULTIPLEDIRS_UNDER_SAME_DISKPARTITION config parameter is not enabled, and
      * if it is found that there are multiple directories in the same DiskPartition then
      * it will throw DiskPartitionDuplicationException.
-     * 
+     *
      * @param dirs dirs to validate
-     * 
+     *
      * @throws IOException
      */
     private void checkIfDirsOnSameDiskPartition(List<File> dirs) throws DiskPartitionDuplicationException {
@@ -444,7 +451,7 @@ public class Bookie extends BookieCriticalThread {
             throw new BookieException.DiskPartitionDuplicationException();
         }
     }
-    
+
     public static void checkEnvironmentWithStorageExpansion(ServerConfiguration conf,
             ZooKeeper zk, List<File> journalDirectories, List<File> allLedgerDirs) throws BookieException, IOException {
         try {
@@ -488,8 +495,8 @@ public class Bookie extends BookieCriticalThread {
             for (File journalDirectory : journalDirectories) {
                 checkDirectoryStructure(journalDirectory);
             }
-            if(!newEnv){
-                for(Cookie journalCookie: journalCookies) {
+            if (!newEnv) {
+                for (Cookie journalCookie: journalCookies) {
                     masterCookie.verifyIsSuperSet(journalCookie);
                 }
             }
@@ -511,7 +518,7 @@ public class Bookie extends BookieCriticalThread {
                 // Also, if a new ledger dir is being added, we make sure that
                 // that dir is empty. Else, we reject the request
                 Set<String> existingLedgerDirs = Sets.newHashSet();
-                for(Cookie journalCookie : journalCookies) {
+                for (Cookie journalCookie : journalCookies) {
                     Collections.addAll(existingLedgerDirs, journalCookie.getLedgerDirPathsFromCookie());
                 }
                 List<File> dirsMissingData = new ArrayList<File>();
@@ -678,7 +685,7 @@ public class Bookie extends BookieCriticalThread {
             this.ledgerMonitor.init();
         } catch (NoWritableLedgerDirException nle) {
             // start in read-only mode if no writable dirs and read-only allowed
-            if(!conf.isReadOnlyModeEnabled()) {
+            if (!conf.isReadOnlyModeEnabled()) {
                 throw nle;
             } else {
                 this.transitionToReadOnlyMode();
@@ -693,7 +700,7 @@ public class Bookie extends BookieCriticalThread {
                 this.idxMonitor.init();
             } catch (NoWritableLedgerDirException nle) {
                 // start in read-only mode if no writable dirs and read-only allowed
-                if(!conf.isReadOnlyModeEnabled()) {
+                if (!conf.isReadOnlyModeEnabled()) {
                     throw nle;
                 } else {
                     this.transitionToReadOnlyMode();
@@ -708,7 +715,7 @@ public class Bookie extends BookieCriticalThread {
 
         // instantiate the journals
         journals = Lists.newArrayList();
-        for(int i=0 ;i<journalDirectories.size();i++) {
+        for (int i = 0; i < journalDirectories.size(); i++) {
             journals.add(new Journal(journalDirectories.get(i),
                          conf, ledgerDirsManager, statsLogger.scope(JOURNAL_SCOPE + "_" + i)));
         }
@@ -719,9 +726,9 @@ public class Bookie extends BookieCriticalThread {
         String ledgerStorageClass = conf.getLedgerStorageClass();
         LOG.info("Using ledger storage: {}", ledgerStorageClass);
         ledgerStorage = LedgerStorageFactory.createLedgerStorage(ledgerStorageClass);
-        ledgerStorage.initialize(conf, ledgerManager, ledgerDirsManager, indexDirsManager, checkpointSource, statsLogger);
-        syncThread = new SyncThread(conf, getLedgerDirsListener(),
-                                    ledgerStorage, checkpointSource);
+        ledgerStorage.initialize(conf, ledgerManager, ledgerDirsManager, indexDirsManager, checkpointSource,
+                                 statsLogger);
+        syncThread = new SyncThread(conf, getLedgerDirsListener(), ledgerStorage, checkpointSource);
         handles = new HandleFactoryImpl(ledgerStorage);
 
         // Expose Stats
@@ -814,7 +821,7 @@ public class Bookie extends BookieCriticalThread {
     }
 
     @Override
-    synchronized public void start() {
+    public synchronized void start() {
         setDaemon(true);
         if (LOG.isDebugEnabled()) {
             LOG.debug("I'm starting a bookie with journal directories {}",
@@ -926,10 +933,9 @@ public class Bookie extends BookieCriticalThread {
     }
 
     /**
-     * Check existence of <i>regPath</i> and wait it expired if possible
+     * Check existence of <i>regPath</i> and wait it expired if possible.
      *
-     * @param regPath
-     *          reg node path.
+     * @param regPath reg node path.
      * @return true if regPath exists, otherwise return false
      * @throws IOException if can't create reg path
      */
@@ -976,7 +982,7 @@ public class Bookie extends BookieCriticalThread {
     }
 
     /**
-     * Register as an available bookie
+     * Register as an available bookie.
      */
     protected Future<Void> registerBookie(final boolean throwException) {
         return stateService.submit(new Callable<Void>() {
@@ -992,7 +998,7 @@ public class Bookie extends BookieCriticalThread {
                         triggerBookieShutdown(ExitCode.ZK_REG_FAIL);
                     }
                 }
-                return (Void)null;
+                return (Void) null;
             }
         });
     }
@@ -1010,11 +1016,10 @@ public class Bookie extends BookieCriticalThread {
         zkRegistered.set(false);
 
         // ZK ephemeral node for this Bookie.
-        try{
+        try {
             if (!checkRegNodeAndWaitExpired(regPath)) {
                 // Create the ZK ephemeral node for this Bookie.
-                zk.create(regPath, new byte[0], zkAcls,
-                        CreateMode.EPHEMERAL);
+                zk.create(regPath, new byte[0], zkAcls, CreateMode.EPHEMERAL);
                 LOG.info("Registered myself in ZooKeeper at {}.", regPath);
             }
             zkRegistered.set(true);
@@ -1025,8 +1030,7 @@ public class Bookie extends BookieCriticalThread {
             // exit here as this is a fatal error.
             throw new IOException(ke);
         } catch (InterruptedException ie) {
-            LOG.error("Interrupted exception registering ephemeral Znode for Bookie!",
-                    ie);
+            LOG.error("Interrupted exception registering ephemeral Znode for Bookie!", ie);
             // Throw an IOException back up. This will cause the Bookie
             // constructor to error out. Alternatively, we could do a System
             // exit here as this is a fatal error.
@@ -1035,7 +1039,7 @@ public class Bookie extends BookieCriticalThread {
     }
 
     /**
-     * Transition the bookie from readOnly mode to writable
+     * Transition the bookie from readOnly mode to writable.
      */
     private Future<Void> transitionToWritableMode() {
         return stateService.submit(new Callable<Void>() {
@@ -1083,14 +1087,14 @@ public class Bookie extends BookieCriticalThread {
     }
 
     /**
-     * Transition the bookie to readOnly mode
+     * Transition the bookie to readOnly mode.
      */
     private Future<Void> transitionToReadOnlyMode() {
         return stateService.submit(new Callable<Void>() {
             @Override
             public Void call() {
                 doTransitionToReadOnlyMode();
-                return (Void)null;
+                return (Void) null;
             }
         });
     }
@@ -1188,8 +1192,7 @@ public class Bookie extends BookieCriticalThread {
                     return;
                 }
                 // Check for expired connection.
-                if (event.getType().equals(EventType.None) &&
-                    event.getState().equals(KeeperState.Expired)) {
+                if (event.getType().equals(EventType.None) && event.getState().equals(KeeperState.Expired)) {
                     zkRegistered.set(false);
                     // schedule a re-register operation
                     registerBookie(false);
@@ -1431,7 +1434,7 @@ public class Bookie extends BookieCriticalThread {
      * @throws BookieException.LedgerFencedException if the ledger is fenced
      */
     public void addEntry(ByteBuf entry, WriteCallback cb, Object ctx, byte[] masterKey)
-            throws IOException, BookieException {
+            throws IOException, BookieException.LedgerFencedException, BookieException {
         long requestNanos = MathUtils.nowInNano();
         boolean success = false;
         int entrySize = 0;
@@ -1462,7 +1465,7 @@ public class Bookie extends BookieCriticalThread {
             entry.release();
         }
     }
-    
+
     static class FutureWriteCallback implements WriteCallback {
 
         SettableFuture<Boolean> result = SettableFuture.create();
@@ -1525,8 +1528,9 @@ public class Bookie extends BookieCriticalThread {
         LedgerDescriptor handle = handles.getReadOnlyHandle(ledgerId);
         return handle.getLastAddConfirmed();
     }
-    
-    public Observable waitForLastAddConfirmedUpdate(long ledgerId, long previoisLAC, Observer observer) throws IOException {
+
+    public Observable waitForLastAddConfirmedUpdate(long ledgerId, long previoisLAC, Observer observer)
+            throws IOException {
         LedgerDescriptor handle = handles.getReadOnlyHandle(ledgerId);
         return handle.waitForLastAddConfirmedUpdate(previoisLAC, observer);
     }
@@ -1536,18 +1540,18 @@ public class Bookie extends BookieCriticalThread {
         int count;
 
         @Override
-        synchronized public void writeComplete(int rc, long l, long e, BookieSocketAddress addr, Object ctx) {
+        public synchronized void writeComplete(int rc, long l, long e, BookieSocketAddress addr, Object ctx) {
             count--;
             if (count == 0) {
                 notifyAll();
             }
         }
 
-        synchronized public void incCount() {
+        public synchronized void incCount() {
             count++;
         }
 
-        synchronized public void waitZero() throws InterruptedException {
+        public synchronized void waitZero() throws InterruptedException {
             while (count > 0) {
                 wait();
             }
@@ -1555,16 +1559,11 @@ public class Bookie extends BookieCriticalThread {
     }
 
     /**
-     * Format the bookie server data
+     * Format the bookie server data.
      *
-     * @param conf
-     *            ServerConfiguration
-     * @param isInteractive
-     *            Whether format should ask prompt for confirmation if old data
-     *            exists or not.
-     * @param force
-     *            If non interactive and force is true, then old data will be
-     *            removed without confirm prompt.
+     * @param conf ServerConfiguration
+     * @param isInteractive Whether format should ask prompt for confirmation if old data exists or not.
+     * @param force If non interactive and force is true, then old data will be removed without confirm prompt.
      * @return Returns true if the format is success else returns false
      */
     public static boolean format(ServerConfiguration conf,
@@ -1665,11 +1664,11 @@ public class Bookie extends BookieCriticalThread {
         }
         cb.waitZero();
         long end = MathUtils.now();
-        System.out.println("Took " + (end-start) + "ms");
+        System.out.println("Took " + (end - start) + "ms");
     }
 
     /**
-     * Returns exit code - cause of failure
+     * Returns exit code - cause of failure.
      *
      * @return {@link ExitCode}
      */
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieConnectionPeer.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieConnectionPeer.java
index f7b917d..63a5e7d 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieConnectionPeer.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieConnectionPeer.java
@@ -23,7 +23,7 @@ package org.apache.bookkeeper.bookie;
 import org.apache.bookkeeper.proto.ConnectionPeer;
 
 /**
- * Represents the connection to a BookKeeper client, from the Bookie side 
+ * Represents the connection to a BookKeeper client, from the Bookie side.
  */
 public interface BookieConnectionPeer extends ConnectionPeer {
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieException.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieException.java
index a7793a3..c62d611 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieException.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieException.java
@@ -21,9 +21,9 @@ package org.apache.bookkeeper.bookie;
  *
  */
 
-
-import java.lang.Exception;
-
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 @SuppressWarnings("serial")
 public abstract class BookieException extends Exception {
 
@@ -57,6 +57,9 @@ public abstract class BookieException extends Exception {
         }
     }
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public interface Code {
         int OK = 0;
         int UnauthorizedAccessException = -1;
@@ -115,24 +118,36 @@ public abstract class BookieException extends Exception {
         }
     }
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public static class BookieUnauthorizedAccessException extends BookieException {
         public BookieUnauthorizedAccessException() {
             super(Code.UnauthorizedAccessException);
         }
     }
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public static class BookieIllegalOpException extends BookieException {
         public BookieIllegalOpException() {
             super(Code.UnauthorizedAccessException);
         }
     }
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public static class LedgerFencedException extends BookieException {
         public LedgerFencedException() {
             super(Code.LedgerFencedException);
         }
     }
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public static class InvalidCookieException extends BookieException {
         public InvalidCookieException() {
             this("");
@@ -147,6 +162,9 @@ public abstract class BookieException extends Exception {
         }
     }
 
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
     public static class UpgradeException extends BookieException {
         public UpgradeException() {
             super(Code.UpgradeException);
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
index 3469593..fc4d5e8 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
@@ -131,7 +131,7 @@ public class BookieShell implements Tool {
     static final String CMD_DELETELEDGER = "deleteledger";
     static final String CMD_BOOKIEINFO = "bookieinfo";
     static final String CMD_DECOMMISSIONBOOKIE = "decommissionbookie";
-    static final String CMD_LOSTBOOKIERECOVERYDELAY = "lostbookierecoverydelay"; 
+    static final String CMD_LOSTBOOKIERECOVERYDELAY = "lostbookierecoverydelay";
     static final String CMD_TRIGGERAUDIT = "triggeraudit";
     static final String CMD_HELP = "help";
 
@@ -148,8 +148,8 @@ public class BookieShell implements Tool {
     int entriesPerPage;
 
     interface Command {
-        public int runCmd(String[] args) throws Exception;
-        public void printUsage();
+        int runCmd(String[] args) throws Exception;
+        void printUsage();
     }
 
     abstract class MyCommand implements Command {
@@ -186,7 +186,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Format the bookkeeper metadata present in zookeeper
+     * Format the bookkeeper metadata present in zookeeper.
      */
     class MetaFormatCmd extends MyCommand {
         Options opts = new Options();
@@ -228,7 +228,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Formats the local data present in current bookie server
+     * Formats the local data present in current bookie server.
      */
     class BookieFormatCmd extends MyCommand {
         Options opts = new Options();
@@ -286,7 +286,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Recover command for ledger data recovery for failed bookie
+     * Recover command for ledger data recovery for failed bookie.
      */
     class RecoverCmd extends MyCommand {
         Options opts = new Options();
@@ -365,7 +365,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Ledger Command Handles ledger related operations
+     * Ledger Command Handles ledger related operations.
      */
     class LedgerCmd extends MyCommand {
         Options lOpts = new Options();
@@ -422,7 +422,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Command for reading ledger entries
+     * Command for reading ledger entries.
      */
     class ReadLedgerEntriesCmd extends MyCommand {
         Options lOpts = new Options();
@@ -498,7 +498,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Command for listing underreplicated ledgers
+     * Command for listing underreplicated ledgers.
      */
     class ListUnderreplicatedCmd extends MyCommand {
         Options opts = new Options();
@@ -562,9 +562,9 @@ public class BookieShell implements Tool {
         }
     }
 
-    final static int LIST_BATCH_SIZE = 1000;
+    static final int LIST_BATCH_SIZE = 1000;
     /**
-     * Command to list all ledgers in the cluster
+     * Command to list all ledgers in the cluster.
      */
     class ListLedgersCmd extends MyCommand {
         Options lOpts = new Options();
@@ -589,8 +589,7 @@ public class BookieShell implements Tool {
                 m = mFactory.newLedgerManager();
                 LedgerRangeIterator iter = m.getLedgerRanges();
                 if (cmdLine.hasOption("m")) {
-                    List<ReadMetadataCallback> futures
-                        = new ArrayList<ReadMetadataCallback>(LIST_BATCH_SIZE);
+                    List<ReadMetadataCallback> futures = new ArrayList<ReadMetadataCallback>(LIST_BATCH_SIZE);
                     while (iter.hasNext()) {
                         LedgerRange r = iter.next();
                         for (Long lid : r.getLedgers()) {
@@ -678,7 +677,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Print the metadata for a ledger
+     * Print the metadata for a ledger.
      */
     class LedgerMetadataCmd extends MyCommand {
         Options lOpts = new Options();
@@ -743,7 +742,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Simple test to create a ledger and write to it
+     * Simple test to create a ledger and write to it.
      */
     class SimpleTestCmd extends MyCommand {
         Options lOpts = new Options();
@@ -805,7 +804,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Command to run a bookie sanity test
+     * Command to run a bookie sanity test.
      */
     class BookieSanityTestCmd extends MyCommand {
         Options lOpts = new Options();
@@ -834,7 +833,7 @@ public class BookieShell implements Tool {
         @Override
         int runCmd(CommandLine cmdLine) throws Exception {
             int numberOfEntries = getOptionIntValue(cmdLine, "entries", 10);
-            int timeoutSecs= getOptionIntValue(cmdLine, "timeout", 1);
+            int timeoutSecs = getOptionIntValue(cmdLine, "timeout", 1);
 
             ClientConfiguration conf = new ClientConfiguration();
             conf.addConfiguration(bkConf);
@@ -966,8 +965,8 @@ public class BookieShell implements Tool {
 
         @Override
         String getUsage() {
-            return "readlog      [-msg] <entry_log_id | entry_log_file_name> [-ledgerid <ledgerid> [-entryid <entryid>]] "
-                    + "[-startpos <startEntryLogBytePos> [-endpos <endEntryLogBytePos>]]";
+            return "readlog      [-msg] <entry_log_id | entry_log_file_name> [-ledgerid <ledgerid> "
+                    + "[-entryid <entryid>]] [-startpos <startEntryLogBytePos> [-endpos <endEntryLogBytePos>]]";
         }
 
         @Override
@@ -977,7 +976,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Command to read journal files
+     * Command to read journal files.
      */
     class ReadJournalCmd extends MyCommand {
         Options rjOpts = new Options();
@@ -1065,7 +1064,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Command to print last log mark
+     * Command to print last log mark.
      */
     class LastMarkCmd extends MyCommand {
         LastMarkCmd() {
@@ -1095,7 +1094,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * List available bookies
+     * List available bookies.
      */
     class ListBookiesCmd extends MyCommand {
         Options opts = new Options();
@@ -1233,7 +1232,7 @@ public class BookieShell implements Tool {
 
 
     /**
-     * Command to print help message
+     * Command to print help message.
      */
     class HelpCmd extends MyCommand {
         HelpCmd() {
@@ -1275,7 +1274,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Command for administration of autorecovery
+     * Command for administration of autorecovery.
      */
     class AutoRecoveryCmd extends MyCommand {
         Options opts = new Options();
@@ -1406,10 +1405,10 @@ public class BookieShell implements Tool {
             return 0;
         }
     }
-    
-    
+
+
     /**
-     * Print which node has the auditor lock
+     * Print which node has the auditor lock.
      */
     class WhoIsAuditorCmd extends MyCommand {
         Options opts = new Options();
@@ -1462,7 +1461,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Update cookie command
+     * Update cookie command.
      */
     class UpdateCookieCmd extends MyCommand {
         Options opts = new Options();
@@ -1605,7 +1604,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Expand the storage directories owned by a bookie
+     * Expand the storage directories owned by a bookie.
      */
     class ExpandStorageCmd extends MyCommand {
         Options opts = new Options();
@@ -1662,7 +1661,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Update ledger command
+     * Update ledger command.
      */
     class UpdateLedgerCmd extends MyCommand {
         private final Options opts = new Options();
@@ -1689,7 +1688,8 @@ public class BookieShell implements Tool {
 
         @Override
         String getUsage() {
-            return "updateledger -bookieId <hostname|ip> [-updatespersec N] [-limit N] [-verbose true/false] [-printprogress N]";
+            return "updateledger -bookieId <hostname|ip> [-updatespersec N] [-limit N] [-verbose true/false] "
+                   + "[-printprogress N]";
         }
 
         @Override
@@ -1868,8 +1868,8 @@ public class BookieShell implements Tool {
             String unit[] = {"", "KB", "MB", "GB", "TB" };
             int cnt = 0;
             double d = val;
-            while (d >= 1000 && cnt < unit.length-1) {
-                d = d/1000;
+            while (d >= 1000 && cnt < unit.length - 1) {
+                d = d / 1000;
                 cnt++;
             }
             DecimalFormat df = new DecimalFormat("#.###");
@@ -1891,11 +1891,12 @@ public class BookieShell implements Tool {
             }
 
             System.out.println("Free disk space info:");
-            long totalFree = 0, total=0;
+            long totalFree = 0, total = 0;
             for (Map.Entry<BookieSocketAddress, BookieInfo> e : map.entrySet()) {
                 BookieInfo bInfo = e.getValue();
-                System.out.println(e.getKey() + ":\tFree: " + bInfo.getFreeDiskSpace() +  getReadable(bInfo.getFreeDiskSpace()) +
-                        "\tTotal: " + bInfo.getTotalDiskSpace() +  getReadable(bInfo.getTotalDiskSpace()));
+                System.out.println(e.getKey() + ":\tFree: " + bInfo.getFreeDiskSpace()
+                        + getReadable(bInfo.getFreeDiskSpace()) + "\tTotal: " + bInfo.getTotalDiskSpace()
+                        + getReadable(bInfo.getTotalDiskSpace()));
                 totalFree += bInfo.getFreeDiskSpace();
                 total += bInfo.getTotalDiskSpace();
             }
@@ -1945,14 +1946,14 @@ public class BookieShell implements Tool {
             return 0;
         }
     }
-    
+
     /**
-     * Command to trigger AuditTask by resetting lostBookieRecoveryDelay and then make sure the 
+     * Command to trigger AuditTask by resetting lostBookieRecoveryDelay and then make sure the
      * ledgers stored in the bookie are properly replicated.
      */
     class DecommissionBookieCmd extends MyCommand {
         Options lOpts = new Options();
-        
+
         DecommissionBookieCmd() {
             super(CMD_DECOMMISSIONBOOKIE);
         }
@@ -1990,7 +1991,7 @@ public class BookieShell implements Tool {
             }
         }
     }
-    
+
     /**
      * A facility for reporting update ledger progress.
      */
@@ -2024,7 +2025,7 @@ public class BookieShell implements Tool {
         commands.put(CMD_BOOKIEINFO, new BookieInfoCmd());
         commands.put(CMD_DECOMMISSIONBOOKIE, new DecommissionBookieCmd());
         commands.put(CMD_HELP, new HelpCmd());
-        commands.put(CMD_LOSTBOOKIERECOVERYDELAY, new LostBookieRecoveryDelayCmd());  
+        commands.put(CMD_LOSTBOOKIERECOVERYDELAY, new LostBookieRecoveryDelayCmd());
         commands.put(CMD_TRIGGERAUDIT, new TriggerAuditCmd());
     }
 
@@ -2164,8 +2165,7 @@ public class BookieShell implements Tool {
     /**
      * Get the ledger file of a specified ledger.
      *
-     * @param ledgerId
-     *          Ledger Id
+     * @param ledgerId Ledger Id
      *
      * @return file object.
      */
@@ -2185,14 +2185,14 @@ public class BookieShell implements Tool {
     /**
      * Get FileInfo for a specified ledger.
      *
-     * @param ledgerId
-     *          Ledger Id
+     * @param ledgerId Ledger Id
      * @return read only file info instance
      */
     ReadOnlyFileInfo getFileInfo(long ledgerId) throws IOException {
         File ledgerFile = getLedgerFile(ledgerId);
         if (null == ledgerFile) {
-            throw new FileNotFoundException("No index file found for ledger " + ledgerId + ". It may be not flushed yet.");
+            throw new FileNotFoundException("No index file found for ledger " + ledgerId
+                    + ". It may be not flushed yet.");
         }
         ReadOnlyFileInfo fi = new ReadOnlyFileInfo(ledgerFile, null);
         fi.readHeader();
@@ -2207,12 +2207,10 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * scan over entry log
+     * Scan over entry log.
      *
-     * @param logId
-     *          Entry Log Id
-     * @param scanner
-     *          Entry Log Scanner
+     * @param logId Entry Log Id
+     * @param scanner Entry Log Scanner
      */
     protected void scanEntryLog(long logId, EntryLogScanner scanner) throws IOException {
         initEntryLogger();
@@ -2231,12 +2229,10 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Scan journal file
+     * Scan journal file.
      *
-     * @param journalId
-     *          Journal File Id
-     * @param scanner
-     *          Journal File Scanner
+     * @param journalId Journal File Id
+     * @param scanner Journal File Scanner
      */
     protected void scanJournal(Journal journal, long journalId, JournalScanner scanner) throws IOException {
         journal.scanJournal(journalId, 0L, scanner);
@@ -2247,10 +2243,9 @@ public class BookieShell implements Tool {
     ///
 
     /**
-     * Read ledger meta
+     * Read ledger meta.
      *
-     * @param ledgerId
-     *          Ledger Id
+     * @param ledgerId Ledger Id
      */
     protected void readLedgerMeta(long ledgerId) throws Exception {
         System.out.println("===== LEDGER: " + ledgerId + " =====");
@@ -2272,10 +2267,9 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Read ledger index entires
+     * Read ledger index entires.
      *
-     * @param ledgerId
-     *          Ledger Id
+     * @param ledgerId Ledger Id
      * @throws IOException
      */
     protected void readLedgerIndexEntries(long ledgerId) throws IOException {
@@ -2293,7 +2287,7 @@ public class BookieShell implements Tool {
                 lep.readPage(fi);
 
                 // process a page
-                for (int i=0; i<entriesPerPage; i++) {
+                for (int i = 0; i < entriesPerPage; i++) {
                     long offset = lep.getOffset(i * 8);
                     if (0 == offset) {
                         System.out.println("entry " + curEntry + "\t:\tN/A");
@@ -2310,10 +2304,11 @@ public class BookieShell implements Tool {
         } catch (IOException ie) {
             LOG.error("Failed to read index page : ", ie);
             if (curSize + pageSize < size) {
-                System.out.println("Failed to read index page @ " + curSize + ", the index file may be corrupted : " + ie.getMessage());
+                System.out.println("Failed to read index page @ " + curSize + ", the index file may be corrupted : "
+                        + ie.getMessage());
             } else {
-                System.out.println("Failed to read last index page @ " + curSize
-                                 + ", the index file may be corrupted or last index page is not fully flushed yet : " + ie.getMessage());
+                System.out.println("Failed to read last index page @ " + curSize + ", the index file may be corrupted "
+                        + "or last index page is not fully flushed yet : " + ie.getMessage());
             }
         }
     }
@@ -2341,27 +2336,23 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Scan over an entry log file for a particular entry
+     * Scan over an entry log file for a particular entry.
      *
-     * @param logId
-     *          Entry Log File id.
-     * @param ledgerId
-     *          id of the ledger
-     * @param entryId
-     *          entryId of the ledger we are looking for (-1 for all of the entries of the ledger)
-     * @param printMsg
-     *          Whether printing the entry data.
+     * @param logId Entry Log File id.
+     * @param ledgerId id of the ledger
+     * @param entryId entryId of the ledger we are looking for (-1 for all of the entries of the ledger)
+     * @param printMsg Whether printing the entry data.
      * @throws Exception
      */
-    protected void scanEntryLogForSpecificEntry(long logId, final long lId, final long eId, final boolean printMsg)
-            throws Exception {
-        System.out.println("Scan entry log " + logId + " (" + Long.toHexString(logId) + ".log)" + " for LedgerId " + lId
-                + ((eId == -1) ? "" : " for EntryId " + eId));
+    protected void scanEntryLogForSpecificEntry(long logId, final long ledgerId, final long entryId,
+                                                final boolean printMsg) throws Exception {
+        System.out.println("Scan entry log " + logId + " (" + Long.toHexString(logId) + ".log)" + " for LedgerId "
+                + ledgerId + ((entryId == -1) ? "" : " for EntryId " + entryId));
         final MutableBoolean entryFound = new MutableBoolean(false);
         scanEntryLog(logId, new EntryLogScanner() {
             @Override
             public boolean accept(long ledgerId) {
-                return ((lId == ledgerId) && ((!entryFound.booleanValue()) || (eId == -1)));
+                return (((!entryFound.booleanValue()) || (entryId == -1)));
             }
 
             @Override
@@ -2369,33 +2360,29 @@ public class BookieShell implements Tool {
                 long entrysLedgerId = entry.getLong();
                 long entrysEntryId = entry.getLong();
                 entry.rewind();
-                if ((ledgerId == entrysLedgerId) && (ledgerId == lId) && ((entrysEntryId == eId)) || (eId == -1)) {
+                if ((ledgerId == entrysLedgerId) && ((entrysEntryId == entryId)) || (entryId == -1)) {
                     entryFound.setValue(true);
                     formatEntry(startPos, entry, printMsg);
                 }
             }
         });
         if (!entryFound.booleanValue()) {
-            System.out.println("LedgerId " + lId + ((eId == -1) ? "" : " EntryId " + eId)
+            System.out.println("LedgerId " + ledgerId + ((entryId == -1) ? "" : " EntryId " + entryId)
                     + " is not available in the entry log " + logId + " (" + Long.toHexString(logId) + ".log)");
         }
     }
 
     /**
-     * Scan over an entry log file for entries in the given position range
+     * Scan over an entry log file for entries in the given position range.
      *
-     * @param logId
-     *          Entry Log File id.
-     * @param rangeStartPos
-     *          Start position of the entry we are looking for
-     * @param rangeEndPos
-     *          End position of the entry we are looking for (-1 for till the end of the entrylog)
-     * @param printMsg
-     *          Whether printing the entry data.
+     * @param logId Entry Log File id.
+     * @param rangeStartPos Start position of the entry we are looking for
+     * @param rangeEndPos End position of the entry we are looking for (-1 for till the end of the entrylog)
+     * @param printMsg Whether printing the entry data.
      * @throws Exception
      */
-    protected void scanEntryLogForPositionRange(long logId, final long rangeStartPos, final long rangeEndPos, final boolean printMsg)
- throws Exception {
+    protected void scanEntryLogForPositionRange(long logId, final long rangeStartPos, final long rangeEndPos,
+                                                final boolean printMsg) throws Exception {
         System.out.println("Scan entry log " + logId + " (" + Long.toHexString(logId) + ".log)" + " for PositionRange: "
                 + rangeStartPos + " - " + rangeEndPos);
         final MutableBoolean entryFound = new MutableBoolean(false);
@@ -2440,12 +2427,10 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Scan a journal file
+     * Scan a journal file.
      *
-     * @param journalId
-     *          Journal File Id
-     * @param printMsg
-     *          Whether printing the entry data.
+     * @param journalId Journal File Id
+     * @param printMsg Whether printing the entry data.
      */
     protected void scanJournal(Journal journal, long journalId, final boolean printMsg) throws Exception {
         System.out.println("Scan journal " + journalId + " (" + Long.toHexString(journalId) + ".txn)");
@@ -2463,7 +2448,7 @@ public class BookieShell implements Tool {
     }
 
     /**
-     * Print last log mark
+     * Print last log mark.
      */
     protected void printLastLogMark() throws IOException {
         for (Journal journal : getJournals()) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java
index 8fddc3f..81cae9e 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java
@@ -20,11 +20,11 @@ package org.apache.bookkeeper.bookie;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/*
-* Wrapper that wraps bookie threads
-* Any common handing that we require for all bookie threads
-* should be implemented here
-*/
+/**
+ * Wrapper that wraps bookie threads.
+ * Any common handing that we require for all bookie threads
+ * should be implemented here
+ */
 public class BookieThread extends Thread implements
         Thread.UncaughtExceptionHandler {
 
@@ -47,7 +47,7 @@ public class BookieThread extends Thread implements
     }
 
     /**
-     * Handles uncaught exception occurred in thread
+     * Handles uncaught exception occurred in thread.
      */
     protected void handleException(Thread t, Throwable e) {
         LOG.error("Uncaught exception in thread {}", t.getName(), e);
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java
index cb7d914..3cc9630 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java
@@ -64,17 +64,17 @@ public class BufferedChannel extends BufferedReadChannel {
      * @param src The source ByteBuffer which contains the data to be written.
      * @throws IOException if a write operation fails.
      */
-    synchronized public void write(ByteBuffer src) throws IOException {
+    public synchronized void write(ByteBuffer src) throws IOException {
         int copied = 0;
-        while(src.remaining() > 0) {
+        while (src.remaining() > 0) {
             int truncated = 0;
             if (writeBuffer.remaining() < src.remaining()) {
                 truncated = src.remaining() - writeBuffer.remaining();
-                src.limit(src.limit()-truncated);
+                src.limit(src.limit() - truncated);
             }
             copied += src.remaining();
             writeBuffer.put(src);
-            src.limit(src.limit()+truncated);
+            src.limit(src.limit() + truncated);
             // if we have run out of buffer space, we should flush to the file
             if (writeBuffer.remaining() == 0) {
                 flushInternal();
@@ -107,7 +107,7 @@ public class BufferedChannel extends BufferedReadChannel {
      * @throws IOException if the write or sync operation fails.
      */
     public void flush(boolean shouldForceWrite) throws IOException {
-        synchronized(this) {
+        synchronized (this) {
             flushInternal();
         }
         if (shouldForceWrite) {
@@ -116,7 +116,7 @@ public class BufferedChannel extends BufferedReadChannel {
     }
 
     /**
-     * Write any data in the buffer to the file and advance the writeBufferPosition
+     * Write any data in the buffer to the file and advance the writeBufferPosition.
      * Callers are expected to synchronize appropriately
      * @throws IOException if the write fails.
      */
@@ -140,13 +140,13 @@ public class BufferedChannel extends BufferedReadChannel {
     }
 
     @Override
-    synchronized public int read(ByteBuffer dest, long pos) throws IOException {
+    public synchronized int read(ByteBuffer dest, long pos) throws IOException {
         long prevPos = pos;
-        while(dest.remaining() > 0) {
+        while (dest.remaining() > 0) {
             // check if it is in the write buffer
             if (writeBuffer != null && writeBufferStartPosition.get() <= pos) {
                 long positionInBuffer = pos - writeBufferStartPosition.get();
-                long bytesToCopy = writeBuffer.position()-positionInBuffer;
+                long bytesToCopy = writeBuffer.position() - positionInBuffer;
                 if (bytesToCopy > dest.remaining()) {
                     bytesToCopy = dest.remaining();
                 }
@@ -155,22 +155,22 @@ public class BufferedChannel extends BufferedReadChannel {
                 }
                 ByteBuffer src = writeBuffer.duplicate();
                 src.position((int) positionInBuffer);
-                src.limit((int) (positionInBuffer+bytesToCopy));
+                src.limit((int) (positionInBuffer + bytesToCopy));
                 dest.put(src);
-                pos+= bytesToCopy;
+                pos += bytesToCopy;
             } else if (writeBuffer == null && writeBufferStartPosition.get() <= pos) {
                 // here we reach the end
                 break;
                 // first check if there is anything we can grab from the readBuffer
-            } else if (readBufferStartPosition <= pos && pos < readBufferStartPosition+readBuffer.capacity()) {
+            } else if (readBufferStartPosition <= pos && pos < readBufferStartPosition + readBuffer.capacity()) {
                 long positionInBuffer = pos - readBufferStartPosition;
-                long bytesToCopy = readBuffer.capacity()-positionInBuffer;
+                long bytesToCopy = readBuffer.capacity() - positionInBuffer;
                 if (bytesToCopy > dest.remaining()) {
                     bytesToCopy = dest.remaining();
                 }
                 ByteBuffer src = readBuffer.duplicate();
                 src.position((int) positionInBuffer);
-                src.limit((int) (positionInBuffer+bytesToCopy));
+                src.limit((int) (positionInBuffer + bytesToCopy));
                 dest.put(src);
                 pos += bytesToCopy;
                 // let's read it
@@ -181,11 +181,11 @@ public class BufferedChannel extends BufferedReadChannel {
                 if (readBufferStartPosition + readBuffer.capacity() >= writeBufferStartPosition.get()) {
                     readBufferStartPosition = writeBufferStartPosition.get() - readBuffer.capacity();
                     if (readBufferStartPosition < 0) {
-                        ZeroBuffer.put(readBuffer, (int)-readBufferStartPosition);
+                        ZeroBuffer.put(readBuffer, (int) -readBufferStartPosition);
                     }
                 }
-                while(readBuffer.remaining() > 0) {
-                    if (fileChannel.read(readBuffer, readBufferStartPosition+readBuffer.position()) <= 0) {
+                while (readBuffer.remaining() > 0) {
+                    if (fileChannel.read(readBuffer, readBufferStartPosition + readBuffer.position()) <= 0) {
                         throw new IOException("Short read");
                     }
                 }
@@ -193,11 +193,11 @@ public class BufferedChannel extends BufferedReadChannel {
                 readBuffer.clear();
             }
         }
-        return (int)(pos - prevPos);
+        return (int) (pos - prevPos);
     }
 
     @Override
-    synchronized public void clear() {
+    public synchronized void clear() {
         super.clear();
         writeBuffer.clear();
     }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannelBase.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannelBase.java
index 782a398..bd8c843 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannelBase.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannelBase.java
@@ -20,6 +20,9 @@ package org.apache.bookkeeper.bookie;
 import java.io.IOException;
 import java.nio.channels.FileChannel;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public abstract class BufferedChannelBase {
     protected final FileChannel fileChannel;
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java
index 0114043..64557d1 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java
@@ -21,9 +21,6 @@
 
 package org.apache.bookkeeper.bookie;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
@@ -32,7 +29,7 @@ import java.nio.channels.FileChannel;
  * A Buffered channel without a write buffer. Only reads are buffered.
  */
 public class BufferedReadChannel extends BufferedChannelBase {
-    private static Logger LOG = LoggerFactory.getLogger(BufferedReadChannel.class);
+
     // The capacity of the read buffer.
     protected final int readCapacity;
     // The buffer for read operations.
@@ -56,10 +53,11 @@ public class BufferedReadChannel extends BufferedChannelBase {
      * depending on the implementation..
      * @param dest
      * @param pos
-     * @return The total number of bytes read. -1 if the given position is greater than or equal to the file's current size.
+     * @return The total number of bytes read.
+     *         -1 if the given position is greater than or equal to the file's current size.
      * @throws IOException if I/O error occurs
      */
-    synchronized public int read(ByteBuffer dest, long pos) throws IOException {
+    public synchronized int read(ByteBuffer dest, long pos) throws IOException {
         invocationCount++;
         long currentPosition = pos;
         long eof = validateAndGetFileChannel().size();
@@ -69,12 +67,13 @@ public class BufferedReadChannel extends BufferedChannelBase {
         }
         while (dest.remaining() > 0) {
             // Check if the data is in the buffer, if so, copy it.
-            if (readBufferStartPosition <= currentPosition && currentPosition < readBufferStartPosition + readBuffer.limit()) {
+            if (readBufferStartPosition <= currentPosition
+                    && currentPosition < readBufferStartPosition + readBuffer.limit()) {
                 long posInBuffer = currentPosition - readBufferStartPosition;
                 long bytesToCopy = Math.min(dest.remaining(), readBuffer.limit() - posInBuffer);
                 ByteBuffer rbDup = readBuffer.duplicate();
-                rbDup.position((int)posInBuffer);
-                rbDup.limit((int)(posInBuffer + bytesToCopy));
+                rbDup.position((int) posInBuffer);
+                rbDup.limit((int) (posInBuffer + bytesToCopy));
                 dest.put(rbDup);
                 currentPosition += bytesToCopy;
                 cacheHitCount++;
@@ -92,10 +91,10 @@ public class BufferedReadChannel extends BufferedChannelBase {
                 readBuffer.limit(readBytes);
             }
         }
-        return (int)(currentPosition - pos);
+        return (int) (currentPosition - pos);
     }
 
-    synchronized public void clear() {
+    public synchronized void clear() {
         readBuffer.clear();
         readBuffer.limit(0);
     }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CacheCallback.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CacheCallback.java
index 43da72f..df9a848 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CacheCallback.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CacheCallback.java
@@ -24,11 +24,11 @@ package org.apache.bookkeeper.bookie;
 import java.io.IOException;
 
 /**
- * Interface plugged into caching to receive callback notifications
+ * Interface plugged into caching to receive callback notifications.
  */
 public interface CacheCallback {
     /**
      * Process notification that cache size limit reached.
      */
-    public void onSizeLimitReached() throws IOException;
+    void onSizeLimitReached() throws IOException;
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSource.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSource.java
index 911c6f4..e7043bd 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSource.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSource.java
@@ -27,9 +27,9 @@ public interface CheckpointSource {
     /**
      * A checkpoint presented a time point. All entries added before this checkpoint are already persisted.
      */
-    public static interface Checkpoint extends Comparable<Checkpoint> {
+    public interface Checkpoint extends Comparable<Checkpoint> {
 
-        public static final Checkpoint MAX = new Checkpoint() {
+        Checkpoint MAX = new Checkpoint() {
 
             @Override
             public int compareTo(Checkpoint o) {
@@ -46,7 +46,7 @@ public interface CheckpointSource {
 
         };
 
-        public static final Checkpoint MIN = new Checkpoint() {
+        Checkpoint MIN = new Checkpoint() {
             @Override
             public int compareTo(Checkpoint o) {
                 if (o == MIN) {
@@ -67,7 +67,7 @@ public interface CheckpointSource {
      *
      * @return checkpoint.
      */
-    public Checkpoint newCheckpoint();
+    Checkpoint newCheckpoint();
 
     /**
      * Tell checkpoint source that the checkpoint is completed.
@@ -79,5 +79,5 @@ public interface CheckpointSource {
      * @param compact
      *          Flag to compact old checkpoints.
      */
-    public void checkpointComplete(Checkpoint checkpoint, boolean compact) throws IOException;
+    void checkpointComplete(Checkpoint checkpoint, boolean compact) throws IOException;
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSourceList.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSourceList.java
index ca42297..4c61da2 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSourceList.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CheckpointSourceList.java
@@ -25,6 +25,9 @@ import java.util.List;
 import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class CheckpointSourceList implements CheckpointSource {
 
     private final List<? extends CheckpointSource> checkpointSourcesList;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CompactableLedgerStorage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CompactableLedgerStorage.java
index c76a485..242b990 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CompactableLedgerStorage.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/CompactableLedgerStorage.java
@@ -24,7 +24,7 @@ package org.apache.bookkeeper.bookie;
 import java.io.IOException;
 
 /**
- * Interface that identifies LedgerStorage implementations using EntryLogger and running periodic entries compaction
+ * Interface that identifies LedgerStorage implementations using EntryLogger and running periodic entries compaction.
  */
 public interface CompactableLedgerStorage extends LedgerStorage {
 
@@ -44,16 +44,15 @@ public interface CompactableLedgerStorage extends LedgerStorage {
             throws IOException;
 
     /**
-     * Update the location of several entries
+     * Update the location of several entries.
      *
-     * @param locations
-     *            the list of locations to update
+     * @param locations the list of locations to update
      * @throws IOException
      */
     void updateEntriesLocations(Iterable<EntryLocation> locations) throws IOException;
 
     /**
-     * Flush the entries locations index for the compacted entries
+     * Flush the entries locations index for the compacted entries.
      *
      * @throws IOException
      */
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
index c758195..9224ceb 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
@@ -65,14 +65,13 @@ import org.apache.bookkeeper.util.ZkUtils;
  * bookie, its configuration stays the same. If any of the bookie directories
  * becomes unavailable, the bookie becomes unavailable. If the bookie changes
  * port, it must also reset all of its data.
- *
  * This is done to ensure data integrity. Without the cookie a bookie could
  * start with one of its ledger directories missing, so data would be missing,
  * but the bookie would be up, so the client would think that everything is ok
  * with the cluster. It's better to fail early and obviously.
  */
 class Cookie {
-    private final static Logger LOG = LoggerFactory.getLogger(Cookie.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Cookie.class);
 
     static final int CURRENT_COOKIE_LAYOUT_VERSION = 4;
     private final int layoutVersion;
@@ -103,7 +102,7 @@ class Cookie {
         // the first part of the string contains a count of how many
         // directories are present; to skip it, we look for subString
         // from the first '/'
-        return s.substring(s.indexOf(SEPARATOR)+SEPARATOR.length()).split(SEPARATOR);
+        return s.substring(s.indexOf(SEPARATOR) + SEPARATOR.length()).split(SEPARATOR);
     }
 
     String[] getLedgerDirPathsFromCookie() {
@@ -114,13 +113,13 @@ class Cookie {
      * Receives 2 String arrays, that each contain a list of directory paths,
      * and checks if first is a super set of the second.
      *
-     * @param superSet
-     * @param subSet
-     * @return true if s1 is a superSet of s2; false otherwise
+     * @param superS
+     * @param subS
+     * @return true if superS is a superSet of subS; false otherwise
      */
-    private boolean isSuperSet(String[] s1, String[] s2) {
-        Set<String> superSet = Sets.newHashSet(s1);
-        Set<String> subSet = Sets.newHashSet(s2);
+    private boolean isSuperSet(String[] superS, String[] subS) {
+        Set<String> superSet = Sets.newHashSet(superS);
+        Set<String> subSet = Sets.newHashSet(subS);
         return superSet.containsAll(subSet);
     }
 
@@ -236,15 +235,11 @@ class Cookie {
     }
 
     /**
-     * Writes cookie details to ZooKeeper
-     *
-     * @param zk
-     *            ZooKeeper instance
-     * @param conf
-     *            configuration
-     * @param version
-     *            version
+     * Writes cookie details to ZooKeeper.
      *
+     * @param zk ZooKeeper instance
+     * @param conf configuration
+     * @param version version
      * @throws KeeperException
      * @throws InterruptedException
      * @throws UnknownHostException
@@ -277,15 +272,11 @@ class Cookie {
     }
 
     /**
-     * Deletes cookie from ZooKeeper and sets znode version to DEFAULT_COOKIE_ZNODE_VERSION
-     *
-     * @param zk
-     *            ZooKeeper instance
-     * @param conf
-     *            configuration
-     * @param version
-     *            zookeeper version
+     * Deletes cookie from ZooKeeper and sets znode version to DEFAULT_COOKIE_ZNODE_VERSION.
      *
+     * @param zk ZooKeeper instance
+     * @param conf configuration
+     * @param version zookeeper version
      * @throws KeeperException
      * @throws InterruptedException
      * @throws UnknownHostException
@@ -297,7 +288,7 @@ class Cookie {
     }
 
     /**
-     * Delete cookie from zookeeper
+     * Delete cookie from zookeeper.
      *
      * @param zk zookeeper client
      * @param conf configuration instance
@@ -315,18 +306,15 @@ class Cookie {
         }
 
         String zkPath = getZkPath(conf, address);
-        zk.delete(zkPath, ((ZkVersion)version).getZnodeVersion());
+        zk.delete(zkPath, ((ZkVersion) version).getZnodeVersion());
         LOG.info("Removed cookie from {} for bookie {}.", conf.getZkLedgersRootPath(), address);
     }
 
     /**
-     * Generate cookie from the given configuration
-     *
-     * @param conf
-     *            configuration
+     * Generate cookie from the given configuration.
      *
+     * @param conf configuration
      * @return cookie builder object
-     *
      * @throws UnknownHostException
      */
     static Builder generateCookie(ServerConfiguration conf)
@@ -342,13 +330,9 @@ class Cookie {
     /**
      * Read cookie from ZooKeeper.
      *
-     * @param zk
-     *            ZooKeeper instance
-     * @param conf
-     *            configuration
-     *
+     * @param zk ZooKeeper instance
+     * @param conf configuration
      * @return versioned cookie object
-     *
      * @throws KeeperException
      * @throws InterruptedException
      * @throws IOException
@@ -360,7 +344,7 @@ class Cookie {
     }
 
     /**
-     * Read cookie from zookeeper for a given bookie <i>address</i>
+     * Read cookie from zookeeper for a given bookie <i>address</i>.
      *
      * @param zk zookeeper client
      * @param conf configuration instance
@@ -390,18 +374,14 @@ class Cookie {
     }
 
     /**
-     * Returns cookie from the given directory
-     *
-     * @param directory
-     *            directory
+     * Returns cookie from the given directory.
      *
+     * @param directory directory
      * @return cookie object
-     *
      * @throws IOException
      */
     static Cookie readFromDirectory(File directory) throws IOException {
-        File versionFile = new File(directory,
-                BookKeeperConstants.VERSION_FILENAME);
+        File versionFile = new File(directory, BookKeeperConstants.VERSION_FILENAME);
         BufferedReader reader = new BufferedReader(
                 new InputStreamReader(new FileInputStream(versionFile), UTF_8));
         try {
@@ -412,13 +392,10 @@ class Cookie {
     }
 
     /**
-     * Returns cookie path in zookeeper
+     * Returns cookie path in zookeeper.
      *
-     * @param conf
-     *            configuration
-     *          
+     * @param conf configuration
      * @return cookie zk path
-     *
      * @throws UnknownHostException
      */
     static String getZkPath(ServerConfiguration conf)
@@ -427,15 +404,14 @@ class Cookie {
     }
 
     /**
-     * Return cookie path for a given bookie <i>address</i>
+     * Return cookie path for a given bookie <i>address</i>.
      *
      * @param conf configuration
      * @param address bookie address
      * @return cookie path for bookie
      */
     static String getZkPath(AbstractConfiguration conf, BookieSocketAddress address) {
-        String bookieCookiePath = conf.getZkLedgersRootPath() + "/"
-                + BookKeeperConstants.COOKIE_NODE;
+        String bookieCookiePath = conf.getZkLedgersRootPath() + "/" + BookKeeperConstants.COOKIE_NODE;
         return bookieCookiePath + "/" + address;
     }
 
@@ -444,7 +420,7 @@ class Cookie {
      * address. Represent as 'hostname/IPaddress' if the InetSocketAddress was
      * created using hostname. Represent as '/IPaddress' if the
      * InetSocketAddress was created using an IPaddress
-     * 
+     *
      * @return true if the 'bookieHost' was created using an IP address, false
      *         if the 'bookieHost' was created using a hostname
      */
@@ -465,7 +441,7 @@ class Cookie {
     }
 
     /**
-     * Cookie builder
+     * Cookie builder.
      */
     public static class Builder {
         private int layoutVersion = 0;
@@ -477,7 +453,8 @@ class Cookie {
         private Builder() {
         }
 
-        private Builder(int layoutVersion, String bookieHost, String journalDirs, String ledgerDirs, String instanceId) {
+        private Builder(int layoutVersion, String bookieHost, String journalDirs, String ledgerDirs,
+                        String instanceId) {
             this.layoutVersion = layoutVersion;
             this.bookieHost = bookieHost;
             this.journalDirs = journalDirs;
@@ -516,8 +493,8 @@ class Cookie {
     }
 
     /**
-     * Returns Cookie builder
-     * 
+     * Returns Cookie builder.
+     *
      * @return cookie builder
      */
     static Builder newBuilder() {
@@ -525,10 +502,9 @@ class Cookie {
     }
 
     /**
-     * Returns Cookie builder with the copy of given oldCookie
+     * Returns Cookie builder with the copy of given oldCookie.
      *
-     * @param oldCookie
-     *            build new cookie from this cookie
+     * @param oldCookie build new cookie from this cookie
      * @return cookie builder
      */
     static Builder newBuilder(Cookie oldCookie) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKey.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKey.java
index 0107d7a..4169ede 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKey.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKey.java
@@ -22,6 +22,9 @@ package org.apache.bookkeeper.bookie;
 import java.io.Serializable;
 import java.util.Comparator;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class EntryKey {
     long ledgerId;
     long entryId;
@@ -44,7 +47,7 @@ public class EntryKey {
     }
 
     /**
-    * Comparator for the key portion
+    * Comparator for the key portion.
     */
     public static final KeyComparator COMPARATOR = new KeyComparator();
 
@@ -54,14 +57,13 @@ public class EntryKey {
         if (!(other instanceof EntryKey)) {
           return false;
         }
-        EntryKey key = (EntryKey)other;
-        return ledgerId == key.ledgerId &&
-            entryId == key.entryId;
+        EntryKey key = (EntryKey) other;
+        return ledgerId == key.ledgerId && entryId == key.entryId;
     }
 
     @Override
     public int hashCode() {
-        return (int)(ledgerId * 13 ^ entryId * 17);
+        return (int) (ledgerId * 13 ^ entryId * 17);
     }
 }
 
@@ -78,6 +80,6 @@ class KeyComparator implements Comparator<EntryKey>, Serializable {
         if (ret == 0) {
             ret = left.entryId - right.entryId;
         }
-        return (ret < 0)? -1 : ((ret > 0)? 1 : 0);
+        return (ret < 0) ? -1 : ((ret > 0) ? 1 : 0);
     }
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKeyValue.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKeyValue.java
index 42a1f34..43e35fb 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKeyValue.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryKeyValue.java
@@ -30,7 +30,7 @@ import java.nio.ByteBuffer;
  * interpret the content as entry blob.
  */
 public class EntryKeyValue extends EntryKey {
-    final private byte [] bytes;
+    private final byte [] bytes;
     private int offset = 0; // start offset of entry blob
     private int length = 0; // length of entry blob
 
@@ -56,7 +56,6 @@ public class EntryKeyValue extends EntryKey {
     }
 
     /**
-     *
      * Creates a EntryKeyValue from the start of the specified byte array.
      * Presumes <code>bytes</code> content contains the value portion of a EntryKeyValue.
      * @param bytes byte array
@@ -66,7 +65,6 @@ public class EntryKeyValue extends EntryKey {
     }
 
     /**
-     *
      * Creates a EntryKeyValue from the start of the specified byte array.
      * Presumes <code>bytes</code> content contains the value portion of a EntryKeyValue.
      * @param bytes byte array
@@ -109,7 +107,7 @@ public class EntryKeyValue extends EntryKey {
     }
 
     /**
-    * String representation
+    * String representation.
     */
     public String toString() {
         return ledgerId + ":" + entryId;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLocation.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLocation.java
index dbb85a1..df21959 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLocation.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLocation.java
@@ -21,6 +21,9 @@
 
 package org.apache.bookkeeper.bookie;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class EntryLocation {
     public final long ledger;
     public final long entry;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
index ac1ba93..418b7e0 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
@@ -75,25 +75,25 @@ public class EntryLogger {
     private static final Logger LOG = LoggerFactory.getLogger(EntryLogger.class);
 
     private static class BufferedLogChannel extends BufferedChannel {
-        final private long logId;
-        private final EntryLogMetadata entryLogMetada;
+        private final long logId;
+        private final EntryLogMetadata entryLogMetadata;
 
         public BufferedLogChannel(FileChannel fc, int writeCapacity,
                                   int readCapacity, long logId) throws IOException {
             super(fc, writeCapacity, readCapacity);
             this.logId = logId;
-            this.entryLogMetada = new EntryLogMetadata(logId);
+            this.entryLogMetadata = new EntryLogMetadata(logId);
         }
         public long getLogId() {
             return logId;
         }
 
         public void registerWrittenEntry(long ledgerId, long entrySize) {
-            entryLogMetada.addLedgerSize(ledgerId, entrySize);
+            entryLogMetadata.addLedgerSize(ledgerId, entrySize);
         }
 
         public Map<Long, Long> getLedgersMap() {
-            return entryLogMetada.getLedgersMap();
+            return entryLogMetadata.getLedgersMap();
         }
     }
 
@@ -111,8 +111,7 @@ public class EntryLogger {
     private volatile BufferedLogChannel logChannel;
     private final EntryLoggerAllocator entryLoggerAllocator;
     private final boolean entryLogPreAllocationEnabled;
-    private final CopyOnWriteArrayList<EntryLogListener> listeners
-        = new CopyOnWriteArrayList<EntryLogListener>();
+    private final CopyOnWriteArrayList<EntryLogListener> listeners = new CopyOnWriteArrayList<EntryLogListener>();
 
     private static final int HEADER_V0 = 0; // Old log file format (no ledgers map index)
     private static final int HEADER_V1 = 1; // Introduced ledger map index
@@ -134,17 +133,19 @@ public class EntryLogger {
      * The 1K block at the head of the entry logger file
      * that contains the fingerprint and meta-data.
      *
+     * <pre>
      * Header is composed of:
      * Fingerprint: 4 bytes "BKLO"
      * Log file HeaderVersion enum: 4 bytes
      * Ledger map offset: 8 bytes
      * Ledgers Count: 4 bytes
+     * </pre>
      */
-    final static int LOGFILE_HEADER_SIZE = 1024;
-    final ByteBuffer LOGFILE_HEADER = ByteBuffer.allocate(LOGFILE_HEADER_SIZE);
+    static final int LOGFILE_HEADER_SIZE = 1024;
+    final ByteBuffer logfileHeader = ByteBuffer.allocate(LOGFILE_HEADER_SIZE);
 
-    final static int HEADER_VERSION_POSITION = 4;
-    final static int LEDGERS_MAP_OFFSET_POSITION = HEADER_VERSION_POSITION + 4;
+    static final int HEADER_VERSION_POSITION = 4;
+    static final int LEDGERS_MAP_OFFSET_POSITION = HEADER_VERSION_POSITION + 4;
 
     /**
      * Ledgers map is composed of multiple parts that can be split into separated entries. Each of them is composed of:
@@ -157,19 +158,19 @@ public class EntryLogger {
      * ledger entries: sequence of (ledgerid, size) (8 + 8 bytes each) [24..]
      * </pre>
      */
-    final static int LEDGERS_MAP_HEADER_SIZE = 4 + 8 + 8 + 4;
-    final static int LEDGERS_MAP_ENTRY_SIZE = 8 + 8;
+    static final int LEDGERS_MAP_HEADER_SIZE = 4 + 8 + 8 + 4;
+    static final int LEDGERS_MAP_ENTRY_SIZE = 8 + 8;
 
     // Break the ledgers map into multiple batches, each of which can contain up to 10K ledgers
-    final static int LEDGERS_MAP_MAX_BATCH_SIZE = 10000;
+    static final int LEDGERS_MAP_MAX_BATCH_SIZE = 10000;
 
-    final static long INVALID_LID = -1L;
+    static final long INVALID_LID = -1L;
 
     // EntryId used to mark an entry (belonging to INVALID_ID) as a component of the serialized ledgers map
-    final static long LEDGERS_MAP_ENTRY_ID = -2L;
+    static final long LEDGERS_MAP_ENTRY_ID = -2L;
 
-    final static int MIN_SANE_ENTRY_SIZE = 8 + 8;
-    final static long MB = 1024 * 1024;
+    static final int MIN_SANE_ENTRY_SIZE = 8 + 8;
+    static final long MB = 1024 * 1024;
 
     private final long flushIntervalInBytes;
     private final boolean doRegularFlushes;
@@ -180,7 +181,7 @@ public class EntryLogger {
     /**
      * Scan entries in a entry log file.
      */
-    static interface EntryLogScanner {
+    interface EntryLogScanner {
         /**
          * Tests whether or not the entries belongs to the specified ledger
          * should be processed.
@@ -189,7 +190,7 @@ public class EntryLogger {
          *          Ledger ID.
          * @return true if and only the entries of the ledger should be scanned.
          */
-        public boolean accept(long ledgerId);
+        boolean accept(long ledgerId);
 
         /**
          * Process an entry.
@@ -202,22 +203,21 @@ public class EntryLogger {
          *          Entry ByteBuffer
          * @throws IOException
          */
-        public void process(long ledgerId, long offset, ByteBuffer entry) throws IOException;
+        void process(long ledgerId, long offset, ByteBuffer entry) throws IOException;
     }
 
     /**
-     * Entry Log Listener
+     * Entry Log Listener.
      */
-    static interface EntryLogListener {
+    interface EntryLogListener {
         /**
          * Rotate a new entry log to write.
          */
-        public void onRotateEntryLog();
+        void onRotateEntryLog();
     }
 
     /**
-     * Create an EntryLogger that stores it's log files in the given
-     * directories
+     * Create an EntryLogger that stores it's log files in the given directories.
      */
     public EntryLogger(ServerConfiguration conf,
             LedgerDirsManager ledgerDirsManager) throws IOException {
@@ -243,8 +243,8 @@ public class EntryLogger {
         // within the same JVM. All of these Bookie instances access this header
         // so there can be race conditions when entry logs are rolled over and
         // this header buffer is cleared before writing it into the new logChannel.
-        LOGFILE_HEADER.put("BKLO".getBytes(UTF_8));
-        LOGFILE_HEADER.putInt(HEADER_CURRENT_VERSION);
+        logfileHeader.put("BKLO".getBytes(UTF_8));
+        logfileHeader.putInt(HEADER_CURRENT_VERSION);
 
         // Find the largest logId
         long logId = INVALID_LID;
@@ -305,8 +305,8 @@ public class EntryLogger {
      * These channels should be used only for reading. logChannel is the one
      * that is used for writes.
      */
-    private final ThreadLocal<Map<Long, BufferedReadChannel>> logid2Channel
-            = new ThreadLocal<Map<Long, BufferedReadChannel>>() {
+    private final ThreadLocal<Map<Long, BufferedReadChannel>> logid2Channel =
+            new ThreadLocal<Map<Long, BufferedReadChannel>>() {
         @Override
         public Map<Long, BufferedReadChannel> initialValue() {
             // Since this is thread local there only one modifier
@@ -323,8 +323,7 @@ public class EntryLogger {
      * and don't cause a change in the channel's position. We use this map to store the file channels. Each
      * file channel is mapped to a log id which represents an open log file.
      */
-    private final ConcurrentMap<Long, FileChannel> logid2FileChannel
-            = new ConcurrentHashMap<Long, FileChannel>();
+    private final ConcurrentMap<Long, FileChannel> logid2FileChannel = new ConcurrentHashMap<Long, FileChannel>();
 
     /**
      * Put the logId, bc pair in the map responsible for the current thread.
@@ -431,7 +430,7 @@ public class EntryLogger {
     }
 
     /**
-     * Creates a new log file
+     * Creates a new log file.
      */
     void createNewLog() throws IOException {
         // first tried to create a new log channel. add current log channel to ToFlush list only when
@@ -586,7 +585,7 @@ public class EntryLogger {
             FileChannel channel = new RandomAccessFile(newLogFile, "rw").getChannel();
             BufferedLogChannel logChannel = new BufferedLogChannel(channel,
                     conf.getWriteBufferBytes(), conf.getReadBufferBytes(), preallocatedLogId);
-            logChannel.write((ByteBuffer) LOGFILE_HEADER.clear());
+            logChannel.write((ByteBuffer) logfileHeader.clear());
 
             for (File f : list) {
                 setLastLogId(f, preallocatedLogId);
@@ -697,7 +696,7 @@ public class EntryLogger {
             return Long.parseLong(lastIdString, 16);
         } catch (IOException e) {
             return INVALID_LID;
-        } catch(NumberFormatException e) {
+        } catch (NumberFormatException e) {
             return INVALID_LID;
         } finally {
             try {
@@ -820,20 +819,21 @@ public class EntryLogger {
         try {
             fc = getChannelForLogId(entryLogId);
         } catch (FileNotFoundException e) {
-            FileNotFoundException newe = new FileNotFoundException(e.getMessage() + " for " + ledgerId + " with location " + location);
+            FileNotFoundException newe = new FileNotFoundException(e.getMessage() + " for " + ledgerId
+                    + " with location " + location);
             newe.setStackTrace(e.getStackTrace());
             throw newe;
         }
         if (readFromLogChannel(entryLogId, fc, sizeBuff, pos) != sizeBuff.capacity()) {
-            throw new Bookie.NoEntryException("Short read from entrylog " + entryLogId,
-                                              ledgerId, entryId);
+            throw new Bookie.NoEntryException("Short read from entrylog " + entryLogId, ledgerId, entryId);
         }
         pos += 4;
         sizeBuff.flip();
         int entrySize = sizeBuff.getInt();
         // entrySize does not include the ledgerId
         if (entrySize > maxSaneEntrySize) {
-            LOG.warn("Sanity check failed for entry size of " + entrySize + " at location " + pos + " in " + entryLogId);
+            LOG.warn("Sanity check failed for entry size of " + entrySize + " at location " + pos + " in "
+                    + entryLogId);
 
         }
         if (entrySize < MIN_SANE_ENTRY_SIZE) {
@@ -843,7 +843,7 @@ public class EntryLogger {
         byte data[] = new byte[entrySize];
         ByteBuffer buff = ByteBuffer.wrap(data);
         int rc = readFromLogChannel(entryLogId, fc, buff, pos);
-        if ( rc != data.length) {
+        if (rc != data.length) {
             // Note that throwing NoEntryException here instead of IOException is not
             // without risk. If all bookies in a quorum throw this same exception
             // the client will assume that it has reached the end of the ledger.
@@ -853,23 +853,25 @@ public class EntryLogger {
             // returning NoEntryException is mostly safe.
             throw new Bookie.NoEntryException("Short read for " + ledgerId + "@"
                                               + entryId + " in " + entryLogId + "@"
-                                              + pos + "("+rc+"!="+data.length+")", ledgerId, entryId);
+                                              + pos + "(" + rc + "!=" + data.length + ")", ledgerId, entryId);
         }
         buff.flip();
         long thisLedgerId = buff.getLong();
         if (thisLedgerId != ledgerId) {
-            throw new IOException("problem found in " + entryLogId + "@" + entryId + " at position + " + pos + " entry belongs to " + thisLedgerId + " not " + ledgerId);
+            throw new IOException("problem found in " + entryLogId + "@" + entryId + " at position + " + pos
+                    + " entry belongs to " + thisLedgerId + " not " + ledgerId);
         }
         long thisEntryId = buff.getLong();
         if (thisEntryId != entryId) {
-            throw new IOException("problem found in " + entryLogId + "@" + entryId + " at position + " + pos + " entry is " + thisEntryId + " not " + entryId);
+            throw new IOException("problem found in " + entryLogId + "@" + entryId + " at position + " + pos
+                    + " entry is " + thisEntryId + " not " + entryId);
         }
 
         return data;
     }
 
     /**
-     * Read the header of an entry log
+     * Read the header of an entry log.
      */
     private Header getHeaderForLogId(long entryLogId) throws IOException {
         BufferedReadChannel bc = getChannelForLogId(entryLogId);
@@ -928,7 +930,7 @@ public class EntryLogger {
 
     private File findFile(long logId) throws FileNotFoundException {
         for (File d : ledgerDirsManager.getAllLedgerDirs()) {
-            File f = new File(d, Long.toHexString(logId)+".log");
+            File f = new File(d, Long.toHexString(logId) + ".log");
             if (f.exists()) {
                 return f;
             }
@@ -937,12 +939,10 @@ public class EntryLogger {
     }
 
     /**
-     * Scan entry log
+     * Scan entry log.
      *
-     * @param entryLogId
-     *          Entry Log Id
-     * @param scanner
-     *          Entry Log Scanner
+     * @param entryLogId Entry Log Id
+     * @param scanner Entry Log Scanner
      * @throws IOException
      */
     protected void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOException {
@@ -1057,12 +1057,14 @@ public class EntryLogger {
             // Discard ledgerId and entryId
             long lid = ledgersMapBuffer.getLong();
             if (lid != INVALID_LID) {
-                throw new IOException("Cannot deserialize ledgers map from ledger " + lid + " -- entryLogId: " + entryLogId);
+                throw new IOException("Cannot deserialize ledgers map from ledger " + lid + " -- entryLogId: "
+                        + entryLogId);
             }
 
             long entryId = ledgersMapBuffer.getLong();
             if (entryId != LEDGERS_MAP_ENTRY_ID) {
-                throw new IOException("Cannot deserialize ledgers map from ledger " + lid + ":" + entryId + " -- entryLogId: " + entryLogId);
+                throw new IOException("Cannot deserialize ledgers map from ledger " + lid + ":" + entryId
+                        + " -- entryLogId: " + entryLogId);
             }
 
             // Read the number of ledgers in the current entry batch
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java
index 214b286..e88302c 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java
@@ -51,10 +51,10 @@ import static org.apache.bookkeeper.bookie.BookKeeperServerStats.SKIP_LIST_THROT
  * flusher reports in that the flush succeeded. At that point we let the snapshot go.
  */
 public class EntryMemTable {
-    private static Logger Logger = LoggerFactory.getLogger(Journal.class);
+    private static Logger logger = LoggerFactory.getLogger(Journal.class);
 
     /**
-     * Entry skip list
+     * Entry skip list.
      */
     static class EntrySkipList extends ConcurrentSkipListMap<EntryKey, EntryKeyValue> {
         final Checkpoint cp;
@@ -107,7 +107,7 @@ public class EntryMemTable {
     final long skipListSizeLimit;
 
     SkipListArena allocator;
-    
+
     // flag indicating the status of the previous flush call
     private final AtomicBoolean previousFlushSucceeded;
 
@@ -148,10 +148,10 @@ public class EntryMemTable {
 
     void dump() {
         for (EntryKey key: this.kvmap.keySet()) {
-            Logger.info(key.toString());
+            logger.info(key.toString());
         }
         for (EntryKey key: this.snapshot.keySet()) {
-            Logger.info(key.toString());
+            logger.info(key.toString());
         }
     }
 
@@ -171,8 +171,7 @@ public class EntryMemTable {
     Checkpoint snapshot(Checkpoint oldCp) throws IOException {
         Checkpoint cp = null;
         // No-op if snapshot currently has entries
-        if (this.snapshot.isEmpty() &&
-                this.kvmap.compareTo(oldCp) < 0) {
+        if (this.snapshot.isEmpty() && this.kvmap.compareTo(oldCp) < 0) {
             final long startTimeNanos = MathUtils.nowInNano();
             this.lock.writeLock().lock();
             try {
@@ -246,7 +245,7 @@ public class EntryMemTable {
                 EntrySkipList keyValues = this.snapshot;
                 if (keyValues.compareTo(checkpoint) < 0) {
                     for (EntryKey key : keyValues.keySet()) {
-                        EntryKeyValue kv = (EntryKeyValue)key;
+                        EntryKeyValue kv = (EntryKeyValue) key;
                         size += kv.getLength();
                         ledger = kv.getLedgerId();
                         if (ledgerGC != ledger) {
@@ -285,7 +284,7 @@ public class EntryMemTable {
     }
 
     /**
-     * Throttling writer w/ 1 ms delay
+     * Throttling writer w/ 1 ms delay.
      */
     private void throttleWriters() {
         try {
@@ -297,11 +296,12 @@ public class EntryMemTable {
     }
 
     /**
-    * Write an update
-    * @param entry
-    * @return approximate size of the passed key and value.
-     * @throws IOException 
-    */
+     * Write an update.
+     *
+     * @param entry
+     * @return approximate size of the passed key and value.
+     * @throws IOException
+     */
     public long addEntry(long ledgerId, long entryId, final ByteBuffer entry, final CacheCallback cb)
             throws IOException {
         long size = 0;
@@ -338,7 +338,6 @@ public class EntryMemTable {
     /**
     * Internal version of add() that doesn't clone KVs with the
     * allocator, and doesn't take the lock.
-    *
     * Callers should ensure they already have the read lock taken
     */
     private long internalAdd(final EntryKeyValue toAdd) throws IOException {
@@ -358,8 +357,7 @@ public class EntryMemTable {
         if (entry.hasArray()) {
             buf = entry.array();
             offset = entry.arrayOffset();
-        }
-        else {
+        } else {
             buf = new byte[length];
             entry.get(buf);
         }
@@ -381,7 +379,7 @@ public class EntryMemTable {
     }
 
     /**
-     * Find the entry with given key
+     * Find the entry with given key.
      * @param ledgerId
      * @param entryId
      * @return the entry kv or null if none found.
@@ -411,7 +409,7 @@ public class EntryMemTable {
     }
 
     /**
-     * Find the last entry with the given ledger key
+     * Find the last entry with the given ledger key.
      * @param ledgerId
      * @return the entry kv or null if none found.
      */
@@ -439,18 +437,18 @@ public class EntryMemTable {
         if (result == null || result.getLedgerId() != ledgerId) {
             return null;
         }
-        return (EntryKeyValue)result;
+        return (EntryKeyValue) result;
     }
 
     /**
-     * Check if the entire heap usage for this EntryMemTable exceeds limit
+     * Check if the entire heap usage for this EntryMemTable exceeds limit.
      */
     boolean isSizeLimitReached() {
         return size.get() >= skipListSizeLimit;
     }
 
     /**
-     * Check if there is data in the mem-table
+     * Check if there is data in the mem-table.
      * @return
      */
     boolean isEmpty() {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ExitCode.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ExitCode.java
index b683c7b..a2e23a8 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ExitCode.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ExitCode.java
@@ -22,19 +22,19 @@
 package org.apache.bookkeeper.bookie;
 
 /**
- * Exit code used to exit bookie server
+ * Exit code used to exit bookie server.
  */
 public class ExitCode {
     // normal quit
-    public final static int OK                  = 0;
+    public static final int OK                  = 0;
     // invalid configuration
-    public final static int INVALID_CONF        = 1;
+    public static final int INVALID_CONF        = 1;
     // exception running bookie server
-    public final static int SERVER_EXCEPTION    = 2;
+    public static final int SERVER_EXCEPTION    = 2;
     // zookeeper is expired
-    public final static int ZK_EXPIRED          = 3;
+    public static final int ZK_EXPIRED          = 3;
     // register bookie on zookeeper failed
-    public final static int ZK_REG_FAIL         = 4;
+    public static final int ZK_REG_FAIL         = 4;
     // exception running bookie
-    public final static int BOOKIE_EXCEPTION    = 5;
+    public static final int BOOKIE_EXCEPTION    = 5;
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
index 31c76d5..c14be5f 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
@@ -43,7 +43,8 @@ import org.slf4j.LoggerFactory;
  * It is used by LedgerCache.
  *
  * <p>
- * Ledger index file is made of a header and several fixed-length index pages, which records the offsets of data stored in entry loggers
+ * Ledger index file is made of a header and several fixed-length index pages, which records the offsets of data stored
+ * in entry loggers
  * <pre>&lt;header&gt;&lt;index pages&gt;</pre>
  * <b>Header</b> is formated as below:
  * <pre>&lt;magic bytes&gt;&lt;len of master key&gt;&lt;master key&gt;</pre>
@@ -53,11 +54,12 @@ import org.slf4j.LoggerFactory;
  * <li>master key: master key
  * <li>state: bit map to indicate the state, 32 bits.
  * </ul>
- * <b>Index page</b> is a fixed-length page, which contains serveral entries which point to the offsets of data stored in entry loggers.
+ * <b>Index page</b> is a fixed-length page, which contains serveral entries which point to the offsets of data stored
+ * in entry loggers.
  * </p>
  */
 class FileInfo extends Observable {
-    private final static Logger LOG = LoggerFactory.getLogger(FileInfo.class);
+    private static final Logger LOG = LoggerFactory.getLogger(FileInfo.class);
 
     static final int NO_MASTER_KEY = -1;
     static final int STATE_FENCED_BIT = 0x1;
@@ -69,10 +71,10 @@ class FileInfo extends Observable {
     byte[] masterKey;
 
     /**
-     * The fingerprint of a ledger index file
+     * The fingerprint of a ledger index file.
      */
-    static final public int signature = ByteBuffer.wrap("BKLE".getBytes(UTF_8)).getInt();
-    static final public int headerVersion = 0;
+    public static final int SIGNATURE = ByteBuffer.wrap("BKLE".getBytes(UTF_8)).getInt();
+    public static final int HEADER_VERSION = 0;
 
     static final long START_OF_DATA = 1024;
     private long size;
@@ -142,13 +144,13 @@ class FileInfo extends Observable {
 
     public ByteBuf getExplicitLac() {
         ByteBuf retLac = null;
-        synchronized(this) {
+        synchronized (this) {
             if (LOG.isDebugEnabled()) {
                 LOG.debug("fileInfo:GetLac: {}", explicitLac);
             }
             if (explicitLac != null) {
                 retLac = Unpooled.buffer(explicitLac.capacity());
-                explicitLac.rewind();//copy from the beginning
+                explicitLac.rewind(); //copy from the beginning
                 retLac.writeBytes(explicitLac);
                 explicitLac.rewind();
                 return retLac;
@@ -158,7 +160,7 @@ class FileInfo extends Observable {
     }
 
     public void setExplicitLac(ByteBuf lac) {
-        synchronized(this) {
+        synchronized (this) {
             if (explicitLac == null) {
                 explicitLac = ByteBuffer.allocate(lac.capacity());
             }
@@ -176,7 +178,7 @@ class FileInfo extends Observable {
         }
     }
 
-    synchronized public void readHeader() throws IOException {
+    public synchronized void readHeader() throws IOException {
         if (lf.exists()) {
             if (fc != null) {
                 return;
@@ -187,16 +189,16 @@ class FileInfo extends Observable {
             sizeSinceLastwrite = size;
 
             // avoid hang on reading partial index
-            ByteBuffer bb = ByteBuffer.allocate((int)(Math.min(size, START_OF_DATA)));
-            while(bb.hasRemaining()) {
+            ByteBuffer bb = ByteBuffer.allocate((int) (Math.min(size, START_OF_DATA)));
+            while (bb.hasRemaining()) {
                 fc.read(bb);
             }
             bb.flip();
-            if (bb.getInt() != signature) {
+            if (bb.getInt() != SIGNATURE) {
                 throw new IOException("Missing ledger signature while reading header for " + lf);
             }
             int version = bb.getInt();
-            if (version != headerVersion) {
+            if (version != HEADER_VERSION) {
                 throw new IOException("Incompatible ledger version " + version + " while reading header for " + lf);
             }
             int length = bb.getInt();
@@ -210,7 +212,7 @@ class FileInfo extends Observable {
             stateBits = bb.getInt();
             needFlushHeader = false;
         } else {
-            throw new IOException("Ledger index file " + lf +" does not exist");
+            throw new IOException("Ledger index file " + lf + " does not exist");
         }
     }
 
@@ -259,9 +261,9 @@ class FileInfo extends Observable {
     }
 
     private void writeHeader() throws IOException {
-        ByteBuffer bb = ByteBuffer.allocate((int)START_OF_DATA);
-        bb.putInt(signature);
-        bb.putInt(headerVersion);
+        ByteBuffer bb = ByteBuffer.allocate((int) START_OF_DATA);
+        bb.putInt(SIGNATURE);
+        bb.putInt(HEADER_VERSION);
         bb.putInt(masterKey.length);
         bb.put(masterKey);
         bb.putInt(stateBits);
@@ -270,7 +272,7 @@ class FileInfo extends Observable {
         fc.write(bb);
     }
 
-    synchronized public boolean isFenced() throws IOException {
+    public synchronized boolean isFenced() throws IOException {
         checkOpen(false);
         return (stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT;
     }
@@ -301,7 +303,7 @@ class FileInfo extends Observable {
     }
 
     // flush the header when header is changed
-    synchronized public void flushHeader() throws IOException {
+    public synchronized void flushHeader() throws IOException {
         if (needFlushHeader) {
             checkOpen(true);
             writeHeader();
@@ -309,9 +311,9 @@ class FileInfo extends Observable {
         }
     }
 
-    synchronized public long size() throws IOException {
+    public synchronized long size() throws IOException {
         checkOpen(false);
-        long rc = size-START_OF_DATA;
+        long rc = size - START_OF_DATA;
         if (rc < 0) {
             rc = 0;
         }
@@ -348,7 +350,7 @@ class FileInfo extends Observable {
         }
         int total = 0;
         int rc = 0;
-        while(bb.remaining() > 0) {
+        while (bb.remaining() > 0) {
             synchronized (this) {
                 rc = fc.read(bb, start);
             }
@@ -393,12 +395,12 @@ class FileInfo extends Observable {
         notifyObservers(new LastAddConfirmedUpdateNotification(Long.MAX_VALUE));
     }
 
-    synchronized public long write(ByteBuffer[] buffs, long position) throws IOException {
+    public synchronized long write(ByteBuffer[] buffs, long position) throws IOException {
         checkOpen(true);
         long total = 0;
         try {
-            fc.position(position+START_OF_DATA);
-            while(buffs[buffs.length-1].remaining() > 0) {
+            fc.position(position + START_OF_DATA);
+            while (buffs[buffs.length - 1].remaining() > 0) {
                 long rc = fc.write(buffs);
                 if (rc <= 0) {
                     throw new IOException("Short write");
@@ -407,7 +409,7 @@ class FileInfo extends Observable {
             }
         } finally {
             fc.force(true);
-            long newsize = position+START_OF_DATA+total;
+            long newsize = position + START_OF_DATA + total;
             if (newsize > size) {
                 size = newsize;
             }
@@ -471,7 +473,7 @@ class FileInfo extends Observable {
         lf = newFile;
     }
 
-    synchronized public byte[] getMasterKey() throws IOException {
+    public synchronized byte[] getMasterKey() throws IOException {
         checkOpen(false);
         return masterKey;
     }
@@ -485,7 +487,7 @@ class FileInfo extends Observable {
         return useCount.get();
     }
 
-    synchronized public void release() {
+    public synchronized void release() {
         int count = useCount.decrementAndGet();
         if (isClosed && (count == 0) && fc != null) {
             try {
@@ -500,7 +502,7 @@ class FileInfo extends Observable {
         return lf.delete();
     }
 
-    static final private void checkParents(File f) throws IOException {
+    private static void checkParents(File f) throws IOException {
         File parent = f.getParentFile();
         if (parent.exists()) {
             return;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java
index bd8837c..4d290a5 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java
@@ -44,18 +44,23 @@ import java.net.MalformedURLException;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Scanner;
 
 import static com.google.common.base.Charsets.UTF_8;
 
 /**
- * Application for upgrading the bookkeeper filesystem
- * between versions
+ * Application for upgrading the bookkeeper filesystem between versions.
  */
 public class FileSystemUpgrade {
-    private final static Logger LOG = LoggerFactory.getLogger(FileSystemUpgrade.class);
+    private static final Logger LOG = LoggerFactory.getLogger(FileSystemUpgrade.class);
 
-    static FilenameFilter BOOKIE_FILES_FILTER = new FilenameFilter() {
+    static FilenameFilter bookieFilesFilter = new FilenameFilter() {
             private boolean containsIndexFiles(File dir, String name) {
                 if (name.endsWith(".idx")) {
                     return true;
@@ -93,14 +98,14 @@ public class FileSystemUpgrade {
         };
 
     private static List<File> getAllDirectories(ServerConfiguration conf) {
-        List<File> dirs = new ArrayList<File>();
+        List<File> dirs = new ArrayList<>();
         dirs.addAll(Lists.newArrayList(conf.getJournalDirs()));
         Collections.addAll(dirs, conf.getLedgerDirs());
         return dirs;
     }
 
     private static int detectPreviousVersion(File directory) throws IOException {
-        String[] files = directory.list(BOOKIE_FILES_FILTER);
+        String[] files = directory.list(bookieFilesFilter);
         File v2versionFile = new File(directory,
                 BookKeeperConstants.VERSION_FILENAME);
         if ((files == null || files.length == 0) && !v2versionFile.exists()) { // no old data, so we're ok
@@ -151,7 +156,7 @@ public class FileSystemUpgrade {
         for (String f : files) {
             if (f.endsWith(".idx")) { // this is an index dir, create the links
                 if (!targetPath.mkdirs()) {
-                    throw new IOException("Could not create target path ["+targetPath+"]");
+                    throw new IOException("Could not create target path [" + targetPath + "]");
                 }
                 HardLink.createHardLinkMult(srcPath, files, targetPath);
                 return;
@@ -175,7 +180,7 @@ public class FileSystemUpgrade {
 
         ZooKeeper zk = newZookeeper(conf);
         try {
-            Map<File,File> deferredMoves = new HashMap<File, File>();
+            Map<File, File> deferredMoves = new HashMap<File, File>();
             Cookie.Builder cookieBuilder = Cookie.generateCookie(conf);
             Cookie c = cookieBuilder.build();
             for (File d : getAllDirectories(conf)) {
@@ -196,7 +201,7 @@ public class FileSystemUpgrade {
 
                     String[] files = d.list(new FilenameFilter() {
                             public boolean accept(File dir, String name) {
-                                return BOOKIE_FILES_FILTER.accept(dir, name)
+                                return bookieFilesFilter.accept(dir, name)
                                     && !(new File(dir, name).isDirectory());
                             }
                         });
@@ -209,7 +214,7 @@ public class FileSystemUpgrade {
                 }
             }
 
-            for (Map.Entry<File,File> e : deferredMoves.entrySet()) {
+            for (Map.Entry<File, File> e : deferredMoves.entrySet()) {
                 try {
                     FileUtils.moveDirectory(e.getValue(), e.getKey());
                 } catch (IOException ioe) {
@@ -254,12 +259,12 @@ public class FileSystemUpgrade {
                             LOG.warn("Could not delete old version file {}", v2versionFile);
                         }
                     }
-                    File[] files = d.listFiles(BOOKIE_FILES_FILTER);
+                    File[] files = d.listFiles(bookieFilesFilter);
                     if (files != null) {
                         for (File f : files) {
                             if (f.isDirectory()) {
                                 FileUtils.deleteDirectory(f);
-                            } else{
+                            } else {
                                 if (!f.delete()) {
                                     LOG.warn("Could not delete {}", f);
                                 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollector.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollector.java
index bfe69a4..87116de 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollector.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollector.java
@@ -27,25 +27,23 @@ package org.apache.bookkeeper.bookie;
  */
 public interface GarbageCollector {
     /**
-     * Do the garbage collector work
+     * Do the garbage collector work.
      *
-     * @param garbageCleaner
-     *          cleaner used to clean selected garbages
+     * @param garbageCleaner cleaner used to clean selected garbages
      */
-    public abstract void gc(GarbageCleaner garbageCleaner);
+    void gc(GarbageCleaner garbageCleaner);
 
     /**
-     * A interface used to define customised garbage cleaner
+     * A interface used to define customised garbage cleaner.
      */
-    public interface GarbageCleaner {
+    interface GarbageCleaner {
 
         /**
-         * Clean a specific ledger
+         * Clean a specific ledger.
          *
-         * @param ledgerId
-         *          Ledger ID to be cleaned
+         * @param ledgerId Ledger ID to be cleaned
          */
-        public void clean(final long ledgerId) ;
+        void clean(final long ledgerId);
     }
 
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
index ed1cf45..c43fb51 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
@@ -121,9 +121,8 @@ public class GarbageCollectorThread extends SafeRunnable {
             this.isThrottleByBytes  = isThrottleByBytes;
             this.compactionRateByBytes = compactionRateByBytes;
             this.compactionRateByEntries = compactionRateByEntries;
-            this.rateLimiter = RateLimiter.create(this.isThrottleByBytes ?
-                                                  this.compactionRateByBytes :
-                                                  this.compactionRateByEntries);
+            this.rateLimiter = RateLimiter.create(this.isThrottleByBytes
+                    ? this.compactionRateByBytes : this.compactionRateByEntries);
         }
 
         // acquire. if bybytes: bytes of this entry; if byentries: 1.
@@ -133,7 +132,7 @@ public class GarbageCollectorThread extends SafeRunnable {
     }
 
     /**
-     * A scanner wrapper to check whether a ledger is alive in an entry log file
+     * A scanner wrapper to check whether a ledger is alive in an entry log file.
      */
     class CompactionScannerFactory {
         List<EntryLocation> offsets = new ArrayList<EntryLocation>();
@@ -262,8 +261,8 @@ public class GarbageCollectorThread extends SafeRunnable {
         }
 
         if (enableMinorCompaction && enableMajorCompaction) {
-            if (minorCompactionInterval >= majorCompactionInterval ||
-                minorCompactionThreshold >= majorCompactionThreshold) {
+            if (minorCompactionInterval >= majorCompactionInterval
+                || minorCompactionThreshold >= majorCompactionThreshold) {
                 throw new IOException("Invalid minor/major compaction settings : minor ("
                                     + minorCompactionThreshold + ", " + minorCompactionInterval
                                     + "), major (" + majorCompactionThreshold + ", "
@@ -294,7 +293,7 @@ public class GarbageCollectorThread extends SafeRunnable {
     }
 
     /**
-     * Manually trigger GC (for testing)
+     * Manually trigger GC (for testing).
      */
     Future<?> triggerGC() {
         return gcExecutor.submit(this);
@@ -308,7 +307,8 @@ public class GarbageCollectorThread extends SafeRunnable {
 
     public void resumeMajorGC() {
         if (suspendMajorCompaction.compareAndSet(true, false)) {
-            LOG.info("{} Major Compaction back to normal since bookie has enough space now.", Thread.currentThread().getName());
+            LOG.info("{} Major Compaction back to normal since bookie has enough space now.",
+                    Thread.currentThread().getName());
         }
     }
 
@@ -320,7 +320,8 @@ public class GarbageCollectorThread extends SafeRunnable {
 
     public void resumeMinorGC() {
         if (suspendMinorCompaction.compareAndSet(true, false)) {
-            LOG.info("{} Minor Compaction back to normal since bookie has enough space now.", Thread.currentThread().getName());
+            LOG.info("{} Minor Compaction back to normal since bookie has enough space now.",
+                    Thread.currentThread().getName());
         }
     }
 
@@ -358,8 +359,8 @@ public class GarbageCollectorThread extends SafeRunnable {
         }
 
         long curTime = MathUtils.now();
-        if (enableMajorCompaction && (!suspendMajor) &&
-            (force || curTime - lastMajorCompactionTime > majorCompactionInterval)) {
+        if (enableMajorCompaction && (!suspendMajor)
+            && (force || curTime - lastMajorCompactionTime > majorCompactionInterval)) {
             // enter major compaction
             LOG.info("Enter major compaction, suspendMajor {}", suspendMajor);
             doCompactEntryLogs(majorCompactionThreshold);
@@ -370,8 +371,8 @@ public class GarbageCollectorThread extends SafeRunnable {
             return;
         }
 
-        if (enableMinorCompaction && (!suspendMinor) &&
-            (force || curTime - lastMinorCompactionTime > minorCompactionInterval)) {
+        if (enableMinorCompaction && (!suspendMinor)
+            && (force || curTime - lastMinorCompactionTime > minorCompactionInterval)) {
             // enter minor compaction
             LOG.info("Enter minor compaction, suspendMinor {}", suspendMinor);
             doCompactEntryLogs(minorCompactionThreshold);
@@ -381,18 +382,18 @@ public class GarbageCollectorThread extends SafeRunnable {
     }
 
     /**
-     * Do garbage collection ledger index files
+     * Do garbage collection ledger index files.
      */
     private void doGcLedgers() {
         garbageCollector.gc(garbageCleaner);
     }
 
     /**
-     * Garbage collect those entry loggers which are not associated with any active ledgers
+     * Garbage collect those entry loggers which are not associated with any active ledgers.
      */
     private void doGcEntryLogs() {
         // Loop through all of the entry logs and remove the non-active ledgers.
-        for (Map.Entry<Long,EntryLogMetadata> entry :  entryLogMetaMap.entrySet()) {
+        for (Map.Entry<Long, EntryLogMetadata> entry :  entryLogMetaMap.entrySet()) {
             long entryLogId = entry.getKey();
             EntryLogMetadata meta = entry.getValue();
             for (Long entryLogLedger : meta.getLedgersMap().keySet()) {
@@ -510,8 +511,8 @@ public class GarbageCollectorThread extends SafeRunnable {
     /**
      * Compact an entry log.
      *
-     * @param entryLogId
-     *          Entry Log File Id
+     * @param scannerFactory
+     * @param entryLogMeta
      */
     protected void compactEntryLog(CompactionScannerFactory scannerFactory,
                                    EntryLogMetadata entryLogMeta) throws IOException {
@@ -571,8 +572,8 @@ public class GarbageCollectorThread extends SafeRunnable {
                 entryLogMetaMap.put(entryLogId, entryLogMeta);
             } catch (IOException e) {
                 hasExceptionWhenScan = true;
-                LOG.warn("Premature exception when processing " + entryLogId +
-                         " recovery will take care of the problem", e);
+                LOG.warn("Premature exception when processing " + entryLogId
+                         + " recovery will take care of the problem", e);
             }
 
             // if scan failed on some entry log, we don't move 'scannedLogId' to next id
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexInMemPageMgr.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexInMemPageMgr.java
index 361bc6e..0af0304 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexInMemPageMgr.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexInMemPageMgr.java
@@ -54,13 +54,13 @@ import static org.apache.bookkeeper.bookie.BookKeeperServerStats.LEDGER_CACHE_RE
 import static org.apache.bookkeeper.bookie.BookKeeperServerStats.NUM_INDEX_PAGES;
 
 class IndexInMemPageMgr {
-    private final static Logger LOG = LoggerFactory.getLogger(IndexInMemPageMgr.class);
-    private final static ConcurrentHashMap<Long, LedgerEntryPage> EMPTY_PAGE_MAP
-        = new ConcurrentHashMap<Long, LedgerEntryPage>();
+    private static final Logger LOG = LoggerFactory.getLogger(IndexInMemPageMgr.class);
+    private static final ConcurrentHashMap<Long, LedgerEntryPage> EMPTY_PAGE_MAP =
+            new ConcurrentHashMap<Long, LedgerEntryPage>();
 
     private static class InMemPageCollection implements LEPStateChangeCallback {
 
-        final ConcurrentMap<Long, ConcurrentMap<Long,LedgerEntryPage>> pages;
+        final ConcurrentMap<Long, ConcurrentMap<Long, LedgerEntryPage>> pages;
         final Map<EntryKey, LedgerEntryPage> lruCleanPageMap;
         final ConcurrentLinkedQueue<LedgerEntryPage> listOfFreePages;
 
@@ -70,19 +70,18 @@ class IndexInMemPageMgr {
 
         public InMemPageCollection(StatsLogger statsLogger) {
             pages = new ConcurrentHashMap<Long, ConcurrentMap<Long,LedgerEntryPage>>();
-            lruCleanPageMap = Collections.synchronizedMap(new LinkedHashMap<EntryKey, LedgerEntryPage>(16, 0.75f, true));
+            lruCleanPageMap =
+                    Collections.synchronizedMap(new LinkedHashMap<EntryKey, LedgerEntryPage>(16, 0.75f, true));
             listOfFreePages = new ConcurrentLinkedQueue<LedgerEntryPage>();
             illegalStateResetCounter = statsLogger.getCounter(INDEX_INMEM_ILLEGAL_STATE_RESET);
             illegalStateDeleteCounter = statsLogger.getCounter(INDEX_INMEM_ILLEGAL_STATE_DELETE);
         }
 
         /**
-         * Retrieve the LedgerEntryPage corresponding to the ledger and firstEntry
+         * Retrieve the LedgerEntryPage corresponding to the ledger and firstEntry.
          *
-         * @param ledgerId
-         *          Ledger id
-         * @param firstEntry
-         *          Id of the first entry in the page
+         * @param ledgerId Ledger id
+         * @param firstEntry Id of the first entry in the page
          * @returns LedgerEntryPage if present
          */
         private LedgerEntryPage getPage(long ledgerId, long firstEntry) {
@@ -94,10 +93,9 @@ class IndexInMemPageMgr {
         }
 
         /**
-         * Add a LedgerEntryPage to the page map
+         * Add a LedgerEntryPage to the page map.
          *
-         * @param lep
-         *          Ledger Entry Page object
+         * @param lep Ledger Entry Page object
          */
         private LedgerEntryPage putPage(LedgerEntryPage lep) {
             // Do a get here to avoid too many new ConcurrentHashMaps() as putIntoTable is called frequently.
@@ -121,11 +119,9 @@ class IndexInMemPageMgr {
         }
 
         /**
-         * Traverse the pages for a given ledger in memory and find the highest
-         * entry amongst these pages
+         * Traverse the pages for a given ledger in memory and find the highest entry amongst these pages.
          *
-         * @param ledgerId
-         *          Ledger id
+         * @param ledgerId Ledger id
          * @returns last entry in the in memory pages
          */
         private long getLastEntryInMem(long ledgerId) {
@@ -133,7 +129,7 @@ class IndexInMemPageMgr {
             // Find the last entry in the cache
             ConcurrentMap<Long, LedgerEntryPage> map = pages.get(ledgerId);
             if (map != null) {
-                for(LedgerEntryPage lep: map.values()) {
+                for (LedgerEntryPage lep: map.values()) {
                     if (lep.getMaxPossibleEntry() < lastEntry) {
                         continue;
                     }
@@ -149,19 +145,18 @@ class IndexInMemPageMgr {
         }
 
         /**
-         * Removes ledger entry pages for a given ledger
+         * Removes ledger entry pages for a given ledger.
          *
-         * @param ledgerId
-         *          Ledger id
+         * @param ledgerId Ledger id
          * @returns number of pages removed
          */
         private void removeEntriesForALedger(long ledgerId) {
             // remove pages first to avoid page flushed when deleting file info
             ConcurrentMap<Long, LedgerEntryPage> lPages = pages.remove(ledgerId);
             if (null != lPages) {
-                for (Map.Entry<Long, LedgerEntryPage> pageEntry : lPages.entrySet()) {
+                for (Map.Entry<Long, LedgerEntryPage> pageEntry: lPages.entrySet()) {
                     long entryId = pageEntry.getKey();
-                    synchronized(lruCleanPageMap) {
+                    synchronized (lruCleanPageMap) {
                         lruCleanPageMap.remove(new EntryKey(ledgerId, entryId));
                     }
 
@@ -181,10 +176,9 @@ class IndexInMemPageMgr {
 
         /**
          * Gets the list of pages in memory that have been changed and hence need to
-         * be written as a part of the flush operation that is being issued
+         * be written as a part of the flush operation that is being issued.
          *
-         * @param ledgerId
-         *          Ledger id
+         * @param ledgerId Ledger id
          * @returns last entry in the in memory pages.
          */
         private LinkedList<Long> getFirstEntryListToBeFlushed(long ledgerId) {
@@ -194,7 +188,7 @@ class IndexInMemPageMgr {
             }
 
             LinkedList<Long> firstEntryList = new LinkedList<Long>();
-            for(ConcurrentMap.Entry<Long, LedgerEntryPage> entry: pageMap.entrySet()) {
+            for (ConcurrentMap.Entry<Long, LedgerEntryPage> entry: pageMap.entrySet()) {
                 LedgerEntryPage lep = entry.getValue();
                 if (lep.isClean()) {
                     if (!lep.inUse()) {
@@ -211,13 +205,12 @@ class IndexInMemPageMgr {
         }
 
         /**
-         * Add the LedgerEntryPage to the clean page LRU map
+         * Add the LedgerEntryPage to the clean page LRU map.
          *
-         * @param lep
-         *          Ledger Entry Page object
+         * @param lep Ledger Entry Page object
          */
         private void addToCleanPagesList(LedgerEntryPage lep) {
-            synchronized(lruCleanPageMap) {
+            synchronized (lruCleanPageMap) {
                 if (lep.isClean() && !lep.inUse()) {
                     lruCleanPageMap.put(lep.getEntryKey(), lep);
                 }
@@ -225,13 +218,12 @@ class IndexInMemPageMgr {
         }
 
         /**
-         * Remove the LedgerEntryPage from the clean page LRU map
+         * Remove the LedgerEntryPage from the clean page LRU map.
          *
-         * @param lep
-         *          Ledger Entry Page object
+         * @param lep Ledger Entry Page object
          */
         private void removeFromCleanPageList(LedgerEntryPage lep) {
-            synchronized(lruCleanPageMap) {
+            synchronized (lruCleanPageMap) {
                 if (!lep.isClean() || lep.inUse()) {
                     lruCleanPageMap.remove(lep.getEntryKey());
                 }
@@ -239,7 +231,7 @@ class IndexInMemPageMgr {
         }
 
         /**
-         * Get the set of active ledgers
+         * Get the set of active ledgers.
          *
          */
         Set<Long> getActiveLedgers() {
@@ -247,13 +239,10 @@ class IndexInMemPageMgr {
         }
 
         /**
-         * Get a clean page and provision it for the specified ledger and firstEntry within
-         * the ledger
+         * Get a clean page and provision it for the specified ledger and firstEntry within the ledger.
          *
-         * @param ledgerId
-         *          Ledger id
-         * @param firstEntry
-         *          Id of the first entry in the page
+         * @param ledgerId Ledger id
+         * @param firstEntry Id of the first entry in the page
          * @returns LedgerEntryPage if present
          */
         LedgerEntryPage grabCleanPage(long ledgerId, long firstEntry) {
@@ -266,16 +255,14 @@ class IndexInMemPageMgr {
             }
             while (lruCleanPageMap.size() > 0) {
                 lep = null;
-                synchronized(lruCleanPageMap) {
-                    Iterator<Map.Entry<EntryKey,LedgerEntryPage>> iterator = lruCleanPageMap.entrySet().iterator();
+                synchronized (lruCleanPageMap) {
+                    Iterator<Map.Entry<EntryKey, LedgerEntryPage>> iterator = lruCleanPageMap.entrySet().iterator();
 
-                    Map.Entry<EntryKey,LedgerEntryPage> entry = null;
-                    while (iterator.hasNext())
-                    {
+                    Map.Entry<EntryKey, LedgerEntryPage> entry = null;
+                    while (iterator.hasNext()) {
                         entry = iterator.next();
                         iterator.remove();
-                        if (entry.getValue().isClean() &&
-                                !entry.getValue().inUse()) {
+                        if (entry.getValue().isClean() && !entry.getValue().inUse()) {
                             lep = entry.getValue();
                             break;
                         }
@@ -360,7 +347,7 @@ class IndexInMemPageMgr {
     private final IndexPersistenceMgr indexPersistenceManager;
 
     /**
-     * the list of potentially dirty ledgers
+     * the list of potentially dirty ledgers.
      */
     private final ConcurrentLinkedQueue<Long> ledgersToFlush = new ConcurrentLinkedQueue<Long>();
     private final ConcurrentSkipListSet<Long> ledgersFlushing = new ConcurrentSkipListSet<Long>();
@@ -475,14 +462,11 @@ class IndexInMemPageMgr {
 
     /**
      * Grab ledger entry page whose first entry is <code>pageEntry</code>.
-     *
      * If the page doesn't existed before, we allocate a memory page.
      * Otherwise, we grab a clean page and read it from disk.
      *
-     * @param ledger
-     *          Ledger Id
-     * @param pageEntry
-     *          Start entry of this entry page.
+     * @param ledger Ledger Id
+     * @param pageEntry Start entry of this entry page.
      */
     private LedgerEntryPage grabLedgerEntryPage(long ledger, long pageEntry) throws IOException {
         LedgerEntryPage lep = grabCleanPage(ledger, pageEntry);
@@ -533,7 +517,7 @@ class IndexInMemPageMgr {
             throw new IllegalArgumentException(entry + " is not a multiple of " + entriesPerPage);
         }
 
-        while(true) {
+        while (true) {
             boolean canAllocate = false;
             if (pageCount.incrementAndGet() <= pageLimit) {
                 canAllocate = true;
@@ -579,10 +563,9 @@ class IndexInMemPageMgr {
     }
 
     /**
-     * Flush a specified ledger
+     * Flush a specified ledger.
      *
-     * @param ledger
-     *          Ledger Id
+     * @param ledger Ledger Id
      * @throws IOException
      */
     private void flushSpecificLedger(long ledger) throws IOException {
@@ -602,7 +585,7 @@ class IndexInMemPageMgr {
         // Now flush all the pages of a ledger
         List<LedgerEntryPage> entries = new ArrayList<LedgerEntryPage>(firstEntryList.size());
         try {
-            for(Long firstEntry: firstEntryList) {
+            for (Long firstEntry: firstEntryList) {
                 LedgerEntryPage lep = getLedgerEntryPageFromCache(ledger, firstEntry, true);
                 if (lep != null) {
                     entries.add(lep);
@@ -610,7 +593,7 @@ class IndexInMemPageMgr {
             }
             indexPersistenceManager.flushLedgerEntries(ledger, entries);
         } finally {
-            for(LedgerEntryPage lep: entries) {
+            for (LedgerEntryPage lep: entries) {
                 lep.releasePage();
             }
         }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java
index 6332996..d8bed79 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java
@@ -47,8 +47,11 @@ import org.slf4j.LoggerFactory;
 import static org.apache.bookkeeper.bookie.BookKeeperServerStats.LEDGER_CACHE_NUM_EVICTED_LEDGERS;
 import static org.apache.bookkeeper.bookie.BookKeeperServerStats.NUM_OPEN_LEDGERS;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class IndexPersistenceMgr {
-    private final static Logger LOG = LoggerFactory.getLogger(IndexPersistenceMgr.class);
+    private static final Logger LOG = LoggerFactory.getLogger(IndexPersistenceMgr.class);
 
     private static final String IDX = ".idx";
     static final String RLOC = ".rloc";
@@ -363,7 +366,7 @@ public class IndexPersistenceMgr {
             }
         }
     }
-    
+
     Observable waitForLastAddConfirmedUpdate(long ledgerId, long previoisLAC, Observer observer) throws IOException {
         FileInfo fi = null;
         try {
@@ -679,7 +682,8 @@ public class IndexPersistenceMgr {
                     position = 0;
                 }
                 // we read the last page from file size minus page size, so it should not encounter short read
-                // exception. if it does, it is an unexpected situation, then throw the exception and fail it immediately.
+                // exception. if it does, it is an unexpected situation, then throw the exception and fail it
+                // immediately.
                 try {
                     fi.read(bb, position, false);
                 } catch (ShortReadException sre) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
index 3d84877..2a49570 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
@@ -57,9 +57,11 @@ import static org.apache.bookkeeper.bookie.BookKeeperServerStats.STORAGE_GET_OFF
  * file and maintains an index file for each ledger.
  */
 public class InterleavedLedgerStorage implements CompactableLedgerStorage, EntryLogListener {
-    private final static Logger LOG = LoggerFactory.getLogger(InterleavedLedgerStorage.class);
+    private static final Logger LOG = LoggerFactory.getLogger(InterleavedLedgerStorage.class);
 
-    // Hold the last checkpoint
+    /**
+     * Hold the last checkpoint.
+     */
     protected static class CheckpointHolder {
         Checkpoint lastCheckpoint = Checkpoint.MAX;
 
@@ -84,7 +86,8 @@ public class InterleavedLedgerStorage implements CompactableLedgerStorage, Entry
     LedgerCache ledgerCache;
     private CheckpointSource checkpointSource;
     protected final CheckpointHolder checkpointHolder = new CheckpointHolder();
-    private final CopyOnWriteArrayList<LedgerDeletionListener> ledgerDeletionListeners = Lists.newCopyOnWriteArrayList();
+    private final CopyOnWriteArrayList<LedgerDeletionListener> ledgerDeletionListeners =
+            Lists.newCopyOnWriteArrayList();
 
     // A sorted map to stored all active ledger ids
     protected final SnapshotMap<Long, Boolean> activeLedgers;
@@ -261,13 +264,14 @@ public class InterleavedLedgerStorage implements CompactableLedgerStorage, Entry
     }
 
     @Override
-    public Observable waitForLastAddConfirmedUpdate(long ledgerId, long previoisLAC, Observer observer) throws IOException {
+    public Observable waitForLastAddConfirmedUpdate(long ledgerId, long previoisLAC, Observer observer)
+            throws IOException {
         return ledgerCache.waitForLastAddConfirmedUpdate(ledgerId, previoisLAC, observer);
     }
 
 
     @Override
-    synchronized public long addEntry(ByteBuf entry) throws IOException {
+    public synchronized long addEntry(ByteBuf entry) throws IOException {
         long ledgerId = entry.getLong(entry.readerIndex() + 0);
         long entryId = entry.getLong(entry.readerIndex() + 8);
         long lac = entry.getLong(entry.readerIndex() + 16);
@@ -371,7 +375,7 @@ public class InterleavedLedgerStorage implements CompactableLedgerStorage, Entry
     }
 
     @Override
-    synchronized public void flush() throws IOException {
+    public synchronized void flush() throws IOException {
         if (!somethingWritten) {
             return;
         }
@@ -431,7 +435,7 @@ public class InterleavedLedgerStorage implements CompactableLedgerStorage, Entry
         processEntry(ledgerId, entryId, entry, true);
     }
 
-    synchronized protected void processEntry(long ledgerId, long entryId, ByteBuffer entry, boolean rollLog)
+    protected synchronized void processEntry(long ledgerId, long entryId, ByteBuffer entry, boolean rollLog)
             throws IOException {
         /*
          * Touch dirty flag
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
index 3313f02..c94bd06 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
@@ -54,24 +54,22 @@ import org.apache.bookkeeper.util.ZeroBuffer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.bookkeeper.bookie.BookKeeperServerStats.*;
-
 /**
  * Provide journal related management.
  */
 class Journal extends BookieCriticalThread implements CheckpointSource {
 
-    private final static Logger LOG = LoggerFactory.getLogger(Journal.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Journal.class);
 
     /**
-     * Filter to pickup journals
+     * Filter to pickup journals.
      */
-    private static interface JournalIdFilter {
-        public boolean accept(long journalId);
+    private interface JournalIdFilter {
+        boolean accept(long journalId);
     }
 
     /**
-     * List all journal ids by a specified journal id filer
+     * List all journal ids by a specified journal id filer.
      *
      * @param journalDir journal dir
      * @param filter journal id filter
@@ -83,7 +81,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
             return Collections.emptyList();
         }
         List<Long> logs = new ArrayList<Long>();
-        for(File f: logFiles) {
+        for (File f: logFiles) {
             String name = f.getName();
             if (!name.endsWith(".txn")) {
                 continue;
@@ -120,7 +118,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
             } else if (o == Checkpoint.MIN) {
                 return 1;
             }
-            return mark.getCurMark().compare(((LogMarkCheckpoint)o).mark.getCurMark());
+            return mark.getCurMark().compare(((LogMarkCheckpoint) o).mark.getCurMark());
         }
 
         @Override
@@ -128,7 +126,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
             if (!(o instanceof LogMarkCheckpoint)) {
                 return false;
             }
-            return 0 == compareTo((LogMarkCheckpoint)o);
+            return 0 == compareTo((LogMarkCheckpoint) o);
         }
 
         @Override
@@ -143,7 +141,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
     }
 
     /**
-     * Last Log Mark
+     * Last Log Mark.
      */
     class LastLogMark {
         private final LogMark curMark;
@@ -205,7 +203,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
             byte buff[] = new byte[16];
             ByteBuffer bb = ByteBuffer.wrap(buff);
             LogMark mark = new LogMark();
-            for(File dir: ledgerDirsManager.getAllLedgerDirs()) {
+            for (File dir: ledgerDirsManager.getAllLedgerDirs()) {
                 File file = new File(dir, "lastMark");
                 try {
                     FileInputStream fis = new FileInputStream(file);
@@ -224,7 +222,8 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                         curMark.setLogMark(mark.getLogFileId(), mark.getLogFileOffset());
                     }
                 } catch (IOException e) {
-                    LOG.error("Problems reading from " + file + " (this is okay if it is the first time starting this bookie");
+                    LOG.error("Problems reading from " + file + " (this is okay if it is the first time starting this "
+                            + "bookie");
                 }
             }
         }
@@ -236,7 +235,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
     }
 
     /**
-     * Filter to return list of journals for rolling
+     * Filter to return list of journals for rolling.
      */
     private static class JournalRollingFilter implements JournalIdFilter {
 
@@ -257,25 +256,22 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
     }
 
     /**
-     * Scanner used to scan a journal
+     * Scanner used to scan a journal.
      */
-    public static interface JournalScanner {
+    public interface JournalScanner {
         /**
          * Process a journal entry.
          *
-         * @param journalVersion
-         *          Journal Version
-         * @param offset
-         *          File offset of the journal entry
-         * @param entry
-         *          Journal Entry
+         * @param journalVersion Journal Version
+         * @param offset File offset of the journal entry
+         * @param entry Journal Entry
          * @throws IOException
          */
-        public void process(int journalVersion, long offset, ByteBuffer entry) throws IOException;
+        void process(int journalVersion, long offset, ByteBuffer entry) throws IOException;
     }
 
     /**
-     * Journal Entry to Record
+     * Journal Entry to Record.
      */
     private class QueueEntry implements Runnable {
         ByteBuf entry;
@@ -285,8 +281,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         Object ctx;
         long enqueueTime;
 
-        QueueEntry(ByteBuf entry, long ledgerId, long entryId,
-                   WriteCallback cb, Object ctx, long enqueueTime) {
+        QueueEntry(ByteBuf entry, long ledgerId, long entryId, WriteCallback cb, Object ctx, long enqueueTime) {
             this.entry = entry.duplicate();
             this.cb = cb;
             this.ctx = ctx;
@@ -348,8 +343,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                 }
 
                 return this.forceWriteWaiters.size();
-            }
-            finally {
+            } finally {
                 closeFileIfNecessary();
             }
         }
@@ -363,8 +357,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                     logFile.close();
                     // Call close only once
                     shouldClose = false;
-                }
-                catch (IOException ioe) {
+                } catch (IOException ioe) {
                     LOG.error("I/O exception while closing file", ioe);
                 }
             }
@@ -372,7 +365,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
     }
 
     /**
-     * ForceWriteThread is a background thread which makes the journal durable periodically
+     * ForceWriteThread is a background thread which makes the journal durable periodically.
      *
      */
     private class ForceWriteThread extends BookieCriticalThread {
@@ -393,7 +386,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
             LOG.info("ForceWrite Thread started");
             boolean shouldForceWrite = true;
             int numReqInLastForceWrite = 0;
-            while(running) {
+            while (running) {
                 ForceWriteRequest req = null;
                 try {
                     req = forceWriteRequests.take();
@@ -420,16 +413,15 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                         numReqInLastForceWrite += req.process(shouldForceWrite);
                     }
 
-                    if (enableGroupForceWrites &&
-                        // if its a marker we should switch back to flushing
-                        !req.isMarker &&
-                        // This indicates that this is the last request in a given file
-                        // so subsequent requests will go to a different file so we should
-                        // flush on the next request
-                        !req.shouldClose) {
+                    if (enableGroupForceWrites
+                            // if its a marker we should switch back to flushing
+                            && !req.isMarker
+                            // This indicates that this is the last request in a given file
+                            // so subsequent requests will go to a different file so we should
+                            // flush on the next request
+                            && !req.shouldClose) {
                         shouldForceWrite = false;
-                    }
-                    else {
+                    } else {
                         shouldForceWrite = true;
                     }
                 } catch (IOException ioe) {
@@ -458,7 +450,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         }
     }
 
-    final static int PADDING_MASK = -0x100;
+    static final int PADDING_MASK = -0x100;
 
     static void writePaddingBytes(JournalChannel jc, ByteBuffer paddingBuffer, int journalAlignSize)
             throws IOException {
@@ -485,8 +477,8 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         }
     }
 
-    final static long MB = 1024 * 1024L;
-    final static int KB = 1024;
+    static final long MB = 1024 * 1024L;
+    static final int KB = 1024;
     // max journal file size
     final long maxJournalSize;
     // pre-allocation size for the journal files
@@ -545,7 +537,8 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         this(journalDirectory, conf, ledgerDirsManager, NullStatsLogger.INSTANCE);
     }
 
-    public Journal(File journalDirectory, ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, StatsLogger statsLogger) {
+    public Journal(File journalDirectory, ServerConfiguration conf, LedgerDirsManager ledgerDirsManager,
+                   StatsLogger statsLogger) {
         super("BookieJournal-" + conf.getBookiePort());
         this.ledgerDirsManager = ledgerDirsManager;
         this.conf = conf;
@@ -573,21 +566,24 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         }
 
         // Expose Stats
-        journalAddEntryStats = statsLogger.getOpStatsLogger(JOURNAL_ADD_ENTRY);
-        journalSyncStats = statsLogger.getOpStatsLogger(JOURNAL_SYNC);
-        journalCreationStats = statsLogger.getOpStatsLogger(JOURNAL_CREATION_LATENCY);
-        journalFlushStats = statsLogger.getOpStatsLogger(JOURNAL_FLUSH_LATENCY);
-        journalQueueStats = statsLogger.getOpStatsLogger(JOURNAL_QUEUE_LATENCY);
-        journalProcessTimeStats = statsLogger.getOpStatsLogger(JOURNAL_PROCESS_TIME_LATENCY);
-        forceWriteGroupingCountStats = statsLogger.getOpStatsLogger(JOURNAL_FORCE_WRITE_GROUPING_COUNT);
-        forceWriteBatchEntriesStats = statsLogger.getOpStatsLogger(JOURNAL_FORCE_WRITE_BATCH_ENTRIES);
-        forceWriteBatchBytesStats = statsLogger.getOpStatsLogger(JOURNAL_FORCE_WRITE_BATCH_BYTES);
-        journalQueueSize = statsLogger.getCounter(JOURNAL_QUEUE_SIZE);
-        forceWriteQueueSize = statsLogger.getCounter(JOURNAL_FORCE_WRITE_QUEUE_SIZE);
-        flushMaxWaitCounter = statsLogger.getCounter(JOURNAL_NUM_FLUSH_MAX_WAIT);
-        flushMaxOutstandingBytesCounter = statsLogger.getCounter(JOURNAL_NUM_FLUSH_MAX_OUTSTANDING_BYTES);
-        flushEmptyQueueCounter = statsLogger.getCounter(JOURNAL_NUM_FLUSH_EMPTY_QUEUE);
-        journalWriteBytes = statsLogger.getCounter(JOURNAL_WRITE_BYTES);
+        journalAddEntryStats = statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_ADD_ENTRY);
+        journalSyncStats = statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_SYNC);
+        journalCreationStats = statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_CREATION_LATENCY);
+        journalFlushStats = statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_FLUSH_LATENCY);
+        journalQueueStats = statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_QUEUE_LATENCY);
+        journalProcessTimeStats = statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_PROCESS_TIME_LATENCY);
+        forceWriteGroupingCountStats =
+                statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_FORCE_WRITE_GROUPING_COUNT);
+        forceWriteBatchEntriesStats =
+                statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_FORCE_WRITE_BATCH_ENTRIES);
+        forceWriteBatchBytesStats = statsLogger.getOpStatsLogger(BookKeeperServerStats.JOURNAL_FORCE_WRITE_BATCH_BYTES);
+        journalQueueSize = statsLogger.getCounter(BookKeeperServerStats.JOURNAL_QUEUE_SIZE);
+        forceWriteQueueSize = statsLogger.getCounter(BookKeeperServerStats.JOURNAL_FORCE_WRITE_QUEUE_SIZE);
+        flushMaxWaitCounter = statsLogger.getCounter(BookKeeperServerStats.JOURNAL_NUM_FLUSH_MAX_WAIT);
+        flushMaxOutstandingBytesCounter =
+                statsLogger.getCounter(BookKeeperServerStats.JOURNAL_NUM_FLUSH_MAX_OUTSTANDING_BYTES);
+        flushEmptyQueueCounter = statsLogger.getCounter(BookKeeperServerStats.JOURNAL_NUM_FLUSH_EMPTY_QUEUE);
+        journalWriteBytes = statsLogger.getCounter(BookKeeperServerStats.JOURNAL_WRITE_BYTES);
     }
 
     public File getJournalDirectory() {
@@ -618,7 +614,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         if (!(checkpoint instanceof LogMarkCheckpoint)) {
             return; // we didn't create this checkpoint, so dont do anything with it
         }
-        LogMarkCheckpoint lmcheckpoint = (LogMarkCheckpoint)checkpoint;
+        LogMarkCheckpoint lmcheckpoint = (LogMarkCheckpoint) checkpoint;
         LastLogMark mark = lmcheckpoint.mark;
 
         mark.rollLog(mark);
@@ -628,7 +624,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
             // keep MAX_BACKUP_JOURNALS journal files before marked journal
             if (logs.size() >= maxBackupJournals) {
                 int maxIdx = logs.size() - maxBackupJournals;
-                for (int i=0; i<maxIdx; i++) {
+                for (int i = 0; i < maxIdx; i++) {
                     long id = logs.get(i);
                     // make sure the journal id is smaller than marked journal id
                     if (id < mark.getCurMark().getLogFileId()) {
@@ -644,14 +640,11 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
     }
 
     /**
-     * Scan the journal
+     * Scan the journal.
      *
-     * @param journalId
-     *          Journal Log Id
-     * @param journalPos
-     *          Offset to start scanning
-     * @param scanner
-     *          Scanner to handle entries
+     * @param journalId Journal Log Id
+     * @param journalPos Offset to start scanning
+     * @param scanner Scanner to handle entries
      * @throws IOException
      */
     public void scanJournal(long journalId, long journalPos, JournalScanner scanner)
@@ -660,13 +653,14 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         if (journalPos <= 0) {
             recLog = new JournalChannel(journalDirectory, journalId, journalPreAllocSize, journalWriteBufferSize);
         } else {
-            recLog = new JournalChannel(journalDirectory, journalId, journalPreAllocSize, journalWriteBufferSize, journalPos);
+            recLog = new JournalChannel(journalDirectory, journalId, journalPreAllocSize, journalWriteBufferSize,
+                    journalPos);
         }
         int journalVersion = recLog.getFormatVersion();
         try {
             ByteBuffer lenBuff = ByteBuffer.allocate(4);
-            ByteBuffer recBuff = ByteBuffer.allocate(64*1024);
-            while(true) {
+            ByteBuffer recBuff = ByteBuffer.allocate(64 * 1024);
+            while (true) {
                 // entry start offset
                 long offset = recLog.fc.position();
                 // start reading entry
@@ -720,10 +714,9 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
     }
 
     /**
-     * Replay journal files
+     * Replay journal files.
      *
-     * @param scanner
-     *          Scanner to process replayed entries.
+     * @param scanner Scanner to process replayed entries.
      * @throws IOException
      */
     public void replay(JournalScanner scanner) throws IOException {
@@ -751,9 +744,9 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
         // TODO: When reading in the journal logs that need to be synced, we
         // should use BufferedChannels instead to minimize the amount of
         // system calls done.
-        for(Long id: logs) {
+        for (Long id: logs) {
             long logPosition = 0L;
-            if(id == markedLog.getLogFileId()) {
+            if (id == markedLog.getLogFileId()) {
                 logPosition = markedLog.getLogFileOffset();
             }
             LOG.info("Replaying journal {} from position {}", id, logPosition);
@@ -766,7 +759,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
     }
 
     /**
-     * record an add entry operation in journal
+     * record an add entry operation in journal.
      */
     public void logAddEntry(ByteBuf entry, WriteCallback cb, Object ctx) {
         long ledgerId = entry.getLong(entry.readerIndex() + 0);
@@ -835,13 +828,8 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                     logId = logId + 1;
 
                     journalCreationWatcher.reset().start();
-                    logFile = new JournalChannel(journalDirectory,
-                                        logId,
-                                        journalPreAllocSize,
-                                        journalWriteBufferSize,
-                                        journalAlignmentSize,
-                                        removePagesFromCache,
-                                        journalFormatVersionToWrite);
+                    logFile = new JournalChannel(journalDirectory, logId, journalPreAllocSize, journalWriteBufferSize,
+                                        journalAlignmentSize, removePagesFromCache, journalFormatVersionToWrite);
                     journalCreationStats.registerSuccessfulEvent(
                             journalCreationWatcher.stop().elapsed(TimeUnit.NANOSECONDS), TimeUnit.NANOSECONDS);
 
@@ -852,15 +840,18 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
 
                 if (qe == null) {
                     if (dequeueStartTime != 0) {
-                        journalProcessTimeStats.registerSuccessfulEvent(MathUtils.elapsedNanos(dequeueStartTime), TimeUnit.NANOSECONDS);
+                        journalProcessTimeStats.registerSuccessfulEvent(MathUtils.elapsedNanos(dequeueStartTime),
+                                TimeUnit.NANOSECONDS);
                     }
 
                     if (toFlush.isEmpty()) {
                         qe = queue.take();
                         dequeueStartTime = MathUtils.nowInNano();
-                        journalQueueStats.registerSuccessfulEvent(MathUtils.elapsedNanos(qe.enqueueTime), TimeUnit.NANOSECONDS);
+                        journalQueueStats.registerSuccessfulEvent(MathUtils.elapsedNanos(qe.enqueueTime),
+                                TimeUnit.NANOSECONDS);
                     } else {
-                        long pollWaitTimeNanos = maxGroupWaitInNanos - MathUtils.elapsedNanos(toFlush.get(0).enqueueTime);
+                        long pollWaitTimeNanos =
+                                maxGroupWaitInNanos - MathUtils.elapsedNanos(toFlush.get(0).enqueueTime);
                         if (flushWhenQueueEmpty || pollWaitTimeNanos < 0) {
                             pollWaitTimeNanos = 0;
                         }
@@ -868,7 +859,8 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                         dequeueStartTime = MathUtils.nowInNano();
 
                         if (qe != null) {
-                            journalQueueStats.registerSuccessfulEvent(MathUtils.elapsedNanos(qe.enqueueTime), TimeUnit.NANOSECONDS);
+                            journalQueueStats.registerSuccessfulEvent(MathUtils.elapsedNanos(qe.enqueueTime),
+                                    TimeUnit.NANOSECONDS);
                         }
 
                         boolean shouldFlush = false;
@@ -879,7 +871,8 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                             groupWhenTimeout = true;
                         } else if (maxGroupWaitInNanos > 0 && groupWhenTimeout && qe != null
                                 && MathUtils.elapsedNanos(qe.enqueueTime) < maxGroupWaitInNanos) {
-                            // when group timeout, it would be better to look forward, as there might be lots of entries already timeout
+                            // when group timeout, it would be better to look forward, as there might be lots of
+                            // entries already timeout
                             // due to a previous slow write (writing to filesystem which impacted by force write).
                             // Group those entries in the queue
                             // a) already timeout
@@ -887,9 +880,9 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                             groupWhenTimeout = false;
                             shouldFlush = true;
                             flushMaxWaitCounter.inc();
-                        } else if (qe != null &&
-                                ((bufferedEntriesThreshold > 0 && toFlush.size() > bufferedEntriesThreshold) ||
-                                 (bc.position() > lastFlushPosition + bufferedWritesThreshold))) {
+                        } else if (qe != null
+                                && ((bufferedEntriesThreshold > 0 && toFlush.size() > bufferedEntriesThreshold)
+                                || (bc.position() > lastFlushPosition + bufferedWritesThreshold))) {
                             // 2. If we have buffered more than the buffWriteThreshold or bufferedEntriesThreshold
                             shouldFlush = true;
                             flushMaxOutstandingBytesCounter.inc();
@@ -916,14 +909,16 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
                             // Trace the lifetime of entries through persistence
                             if (LOG.isDebugEnabled()) {
                                 for (QueueEntry e : toFlush) {
-                                    LOG.debug("Written and queuing for flush Ledger:" + e.ledgerId + " Entry:" + e.entryId);
+                                    LOG.debug("Written and queuing for flush Ledger:" + e.ledgerId + " Entry:"
+                                            + e.entryId);
                                 }
                             }
 
                             forceWriteBatchEntriesStats.registerSuccessfulValue(toFlush.size());
                             forceWriteBatchBytesStats.registerSuccessfulValue(batchSize);
 
-                            forceWriteRequests.put(new ForceWriteRequest(logFile, logId, lastFlushPosition, toFlush, (lastFlushPosition > maxJournalSize), false));
+                            forceWriteRequests.put(new ForceWriteRequest(logFile, logId, lastFlushPosition, toFlush,
+                                    (lastFlushPosition > maxJournalSize), false));
                             toFlush = new LinkedList<QueueEntry>();
                             batchSize = 0L;
                             // check whether journal file is over file limit
@@ -1010,7 +1005,7 @@ class Journal extends BookieCriticalThread implements CheckpointSource {
 
     private static int fullRead(JournalChannel fc, ByteBuffer bb) throws IOException {
         int total = 0;
-        while(bb.remaining() > 0) {
+        while (bb.remaining() > 0) {
             int rc = fc.read(bb);
             if (rc <= 0) {
                 return total;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java
index ad46e5c..1d0c883 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java
@@ -41,7 +41,7 @@ import static com.google.common.base.Charsets.UTF_8;
  * information to the file.
  */
 class JournalChannel implements Closeable {
-    private final static Logger LOG = LoggerFactory.getLogger(JournalChannel.class);
+    private static final Logger LOG = LoggerFactory.getLogger(JournalChannel.class);
 
     final RandomAccessFile randomAccessFile;
     final int fd;
@@ -50,11 +50,11 @@ class JournalChannel implements Closeable {
     final int formatVersion;
     long nextPrealloc = 0;
 
-    final byte[] MAGIC_WORD = "BKLG".getBytes(UTF_8);
+    final byte[] magicWord = "BKLG".getBytes(UTF_8);
 
-    final static int SECTOR_SIZE = 512;
-    private final static int START_OF_FILE = -12345;
-    private static long CACHE_DROP_LAG_BYTES = 8 * 1024 * 1024;
+    static final int SECTOR_SIZE = 512;
+    private static final int START_OF_FILE = -12345;
+    private static long cacheDropLagBytes = 8 * 1024 * 1024;
 
     // No header
     static final int V1 = 1;
@@ -156,7 +156,7 @@ class JournalChannel implements Closeable {
             ByteBuffer bb = ByteBuffer.allocate(headerSize);
             ZeroBuffer.put(bb);
             bb.clear();
-            bb.put(MAGIC_WORD);
+            bb.put(magicWord);
             bb.putInt(formatVersion);
             bb.clear();
             fc.write(bb);
@@ -178,7 +178,7 @@ class JournalChannel implements Closeable {
                 byte[] first4 = new byte[4];
                 bb.get(first4);
 
-                if (Arrays.equals(first4, MAGIC_WORD)) {
+                if (Arrays.equals(first4, magicWord)) {
                     formatVersion = bb.getInt();
                 } else {
                     // pre magic word journal, reset to 0;
@@ -255,7 +255,7 @@ class JournalChannel implements Closeable {
         // For POSIX_FADV_DONTNEED, we want to drop from the beginning
         // of the file to a position prior to the current position.
         //
-        // The CACHE_DROP_LAG_BYTES is to prevent dropping a page that will
+        // The cacheDropLagBytes is to prevent dropping a page that will
         // be appended again, which would introduce random seeking on journal
         // device.
         //
@@ -265,7 +265,7 @@ class JournalChannel implements Closeable {
         // lastDropPosition     newDropPos             lastForceWritePosition
         //
         if (fRemoveFromPageCache) {
-            long newDropPos = newForceWritePosition - CACHE_DROP_LAG_BYTES;
+            long newDropPos = newForceWritePosition - cacheDropLagBytes;
             if (lastDropPosition < newDropPos) {
                 NativeIO.bestEffortRemoveFromPageCache(fd, lastDropPosition, newDropPos - lastDropPosition);
             }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LEPStateChangeCallback.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LEPStateChangeCallback.java
index 9f4fbc6..e7eaabc 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LEPStateChangeCallback.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LEPStateChangeCallback.java
@@ -24,8 +24,8 @@ package org.apache.bookkeeper.bookie;
  * Callback interface when state of ledger entry page changed.
  */
 interface LEPStateChangeCallback {
-    public void onSetInUse(LedgerEntryPage lep);
-    public void onResetInUse(LedgerEntryPage lep);
-    public void onSetClean(LedgerEntryPage lep);
-    public void onSetDirty(LedgerEntryPage lep);
+    void onSetInUse(LedgerEntryPage lep);
+    void onResetInUse(LedgerEntryPage lep);
+    void onSetClean(LedgerEntryPage lep);
+    void onSetDirty(LedgerEntryPage lep);
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LastAddConfirmedUpdateNotification.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LastAddConfirmedUpdateNotification.java
index 81cd842..f52ccf9 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LastAddConfirmedUpdateNotification.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LastAddConfirmedUpdateNotification.java
@@ -20,6 +20,9 @@
  */
 package org.apache.bookkeeper.bookie;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class LastAddConfirmedUpdateNotification {
     public long lastAddConfirmed;
     public long timestamp;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerCacheImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerCacheImpl.java
index 5709ce6..18d7666 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerCacheImpl.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerCacheImpl.java
@@ -39,7 +39,7 @@ import io.netty.buffer.ByteBuf;
  * This class serves two purposes.
  */
 public class LedgerCacheImpl implements LedgerCache {
-    private final static Logger LOG = LoggerFactory.getLogger(LedgerCacheImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(LedgerCacheImpl.class);
 
     private final IndexInMemPageMgr indexPageManager;
     private final IndexPersistenceMgr indexPersistenceManager;
@@ -87,7 +87,8 @@ public class LedgerCacheImpl implements LedgerCache {
     }
 
     @Override
-    public Observable waitForLastAddConfirmedUpdate(long ledgerId, long previoisLAC, Observer observer) throws IOException {
+    public Observable waitForLastAddConfirmedUpdate(long ledgerId, long previoisLAC, Observer observer)
+            throws IOException {
         return indexPersistenceManager.waitForLastAddConfirmedUpdate(ledgerId, previoisLAC, observer);
     }
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java
index cfc1be0..cb36e14 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java
@@ -34,10 +34,9 @@ import org.slf4j.LoggerFactory;
 /**
  * Implements a ledger inside a bookie. In particular, it implements operations
  * to write entries to a ledger and read entries from a ledger.
- *
  */
 public class LedgerDescriptorImpl extends LedgerDescriptor {
-    private final static Logger LOG = LoggerFactory.getLogger(LedgerDescriptor.class);
+    private static final Logger LOG = LoggerFactory.getLogger(LedgerDescriptor.class);
     final LedgerStorage ledgerStorage;
     private long ledgerId;
     final byte[] masterKey;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java
index ad0777e..513d4d4 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java
@@ -45,8 +45,7 @@ import com.google.common.annotations.VisibleForTesting;
  * This class manages ledger directories used by the bookie.
  */
 public class LedgerDirsManager {
-    private final static Logger LOG = LoggerFactory
-            .getLogger(LedgerDirsManager.class);
+    private static final Logger LOG = LoggerFactory.getLogger(LedgerDirsManager.class);
 
     private volatile List<File> filledDirs;
     private final List<File> ledgerDirectories;
@@ -108,23 +107,22 @@ public class LedgerDirsManager {
     }
 
     /**
-     * Get all ledger dirs configured
+     * Get all ledger dirs configured.
      */
     public List<File> getAllLedgerDirs() {
         return ledgerDirectories;
     }
-    
+
     /**
-     * Get all dir listeners
-     * @return List<LedgerDirsListener> listeners
+     * Get all dir listeners.
+     * @return list of listeners
      */
     public List<LedgerDirsListener> getListeners() {
         return listeners;
     }
 
     /**
-     * Calculate the total amount of free space available
-     * in all of the ledger directories put together.
+     * Calculate the total amount of free space available in all of the ledger directories put together.
      *
      * @return totalDiskSpace in bytes
      * @throws IOException 
@@ -134,8 +132,7 @@ public class LedgerDirsManager {
     }
 
     /**
-     * Calculate the total amount of free space available
-     * in all of the ledger directories put together.
+     * Calculate the total amount of free space available in all of the ledger directories put together.
      *
      * @return freeDiskSpace in bytes
      * @throws IOException 
@@ -145,13 +142,13 @@ public class LedgerDirsManager {
     }
     
     /**
-     * Get disk usages map
-     * @return ConcurrentMap<File, Float> diskUsages
+     * Get disk usages map.
+     * @return disk usages map
      */
     public ConcurrentMap<File, Float> getDiskUsages() {
         return diskUsages;
     }
-    
+
     /**
      * Get only writable ledger dirs.
      */
@@ -168,7 +165,7 @@ public class LedgerDirsManager {
     }
 
     /**
-     * returns true if the writableLedgerDirs list has entries
+     * @return true if the writableLedgerDirs list has entries
      */
     public boolean hasWritableLedgerDirs() {
         return !writableLedgerDirectories.isEmpty();
@@ -198,7 +195,7 @@ public class LedgerDirsManager {
         List<File> fullLedgerDirsToAccomodate = new ArrayList<File>();
         for (File dir: this.ledgerDirectories) {
             // Pick dirs which can accommodate little more than thresholdSize
-            if (dir.getUsableSpace() > (thresholdSize) ) {
+            if (dir.getUsableSpace() > thresholdSize) {
                 fullLedgerDirsToAccomodate.add(dir);
             }
         }
@@ -216,7 +213,7 @@ public class LedgerDirsManager {
         LOG.error(errMsg, e);
         throw e;
     }
-    
+
     /**
      * @return full-filled ledger dirs.
      */
@@ -225,20 +222,19 @@ public class LedgerDirsManager {
     }
 
     /**
-     * Get dirs, which are full more than threshold
+     * Get dirs, which are full more than threshold.
      */
     public boolean isDirFull(File dir) {
         return filledDirs.contains(dir);
     }
 
     /**
-     * Add the dir to filled dirs list
+     * Add the dir to filled dirs list.
      */
     @VisibleForTesting
     public void addToFilledDirs(File dir) {
         if (!filledDirs.contains(dir)) {
-            LOG.warn(dir + " is out of space."
-                    + " Adding it to filled dirs list");
+            LOG.warn(dir + " is out of space. Adding it to filled dirs list");
             // Update filled dirs list
             List<File> updatedFilledDirs = new ArrayList<File>(filledDirs);
             updatedFilledDirs.add(dir);
@@ -306,9 +302,8 @@ public class LedgerDirsManager {
      * Pick up a dir randomly from writableLedgerDirectories. If writableLedgerDirectories is empty
      * then pick up a dir randomly from the ledger/indexdirs which have usable space more than
      * minUsableSizeForIndexFileCreation.
-     * 
-     * @param excludedDir
-     *          The directory to exclude during pickup.
+     *
+     * @param excludedDir The directory to exclude during pickup.
      * @return
      * @throws NoWritableLedgerDirException if there is no dir available.
      */
@@ -318,8 +313,8 @@ public class LedgerDirsManager {
             writableDirsForNewIndexFile = writableLedgerDirectories;
         } else {
             // We don't have writable Index Dirs.
-            // That means we must have turned readonly. But 
-            // during the Bookie restart, while replaying the journal there might be a need 
+            // That means we must have turned readonly. But
+            // during the Bookie restart, while replaying the journal there might be a need
             // to create new Index file and it should proceed.
             writableDirsForNewIndexFile = getDirsAboveUsableThresholdSize(minUsableSizeForIndexFileCreation);
         }
@@ -372,43 +367,38 @@ public class LedgerDirsManager {
      * Listener for the disk check events will be notified from the
      * {@link LedgerDirsManager} whenever disk full/failure detected.
      */
-    public static interface LedgerDirsListener {
+    public interface LedgerDirsListener {
         /**
-         * This will be notified on disk failure/disk error
+         * This will be notified on disk failure/disk error.
          *
-         * @param disk
-         *            Failed disk
+         * @param disk Failed disk
          */
         void diskFailed(File disk);
 
         /**
-         * Notified when the disk usage warn threshold is exceeded on
-         * the drive.
+         * Notified when the disk usage warn threshold is exceeded on the drive.
          * @param disk
          */
         void diskAlmostFull(File disk);
 
         /**
-         * This will be notified on disk detected as full
+         * This will be notified on disk detected as full.
          *
-         * @param disk
-         *            Filled disk
+         * @param disk Filled disk
          */
         void diskFull(File disk);
 
         /**
-         * This will be notified on disk detected as writable and under warn threshold
+         * This will be notified on disk detected as writable and under warn threshold.
          *
-         * @param disk
-         *          Writable disk
+         * @param disk Writable disk
          */
         void diskWritable(File disk);
 
         /**
-         * This will be notified on disk detected as writable but still in warn threshold
+         * This will be notified on disk detected as writable but still in warn threshold.
          *
-         * @param disk
-         *          Writable disk
+         * @param disk Writable disk
          */
         void diskJustWritable(File disk);
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java
index 81f0f64..390773e 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java
@@ -41,17 +41,16 @@ import org.slf4j.LoggerFactory;
  * Thread to monitor the disk space periodically.
  */
 class LedgerDirsMonitor extends BookieThread {
-    private final static Logger LOG = LoggerFactory.getLogger(LedgerDirsMonitor.class);
-    
+    private static final Logger LOG = LoggerFactory.getLogger(LedgerDirsMonitor.class);
+
     private final int interval;
     private final ServerConfiguration conf;
     private final ConcurrentMap<File, Float> diskUsages;
     private final DiskChecker diskChecker;
     private final LedgerDirsManager ldm;
 
-    public LedgerDirsMonitor(final ServerConfiguration conf, 
-            final DiskChecker diskChecker,
-            final LedgerDirsManager ldm) {
+    public LedgerDirsMonitor(final ServerConfiguration conf, final DiskChecker diskChecker,
+                             final LedgerDirsManager ldm) {
         super("LedgerDirsMonitorThread");
         this.interval = conf.getDiskCheckInterval();
         this.conf = conf;
@@ -90,8 +89,8 @@ class LedgerDirsMonitor extends BookieThread {
                 }
                 // Let's get NoWritableLedgerDirException without waiting for the next iteration
                 // in case we are out of writable dirs
-                // otherwise for the duration of {interval} we end up in the state where 
-                // bookie cannot get writable dir but considered to be writable 
+                // otherwise for the duration of {interval} we end up in the state where
+                // bookie cannot get writable dir but considered to be writable
                 ldm.getWritableLedgerDirs();
             } catch (NoWritableLedgerDirException e) {
                 for (LedgerDirsListener listener : ldm.getListeners()) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerEntryPage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerEntryPage.java
index ea96dff..333bdfc 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerEntryPage.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerEntryPage.java
@@ -37,15 +37,15 @@ public class LedgerEntryPage {
 
     private static final Logger LOG = LoggerFactory.getLogger(LedgerEntryPage.class);
 
-    private final static int indexEntrySize = 8;
+    private static final int indexEntrySize = 8;
     private final int pageSize;
     private final int entriesPerPage;
-    volatile private EntryKey entryKey = new EntryKey(-1, BookieProtocol.INVALID_ENTRY_ID);
+    private volatile EntryKey entryKey = new EntryKey(-1, BookieProtocol.INVALID_ENTRY_ID);
     private final ByteBuffer page;
-    volatile private boolean clean = true;
+    private volatile boolean clean = true;
     private final AtomicInteger useCount = new AtomicInteger(0);
     private final AtomicInteger version = new AtomicInteger(0);
-    volatile private int last = -1; // Last update position
+    private volatile int last = -1; // Last update position
     private final LEPStateChangeCallback callback;
 
     public static int getIndexEntrySize() {
@@ -135,7 +135,7 @@ public class LedgerEntryPage {
 
     @Override
     public int hashCode() {
-        return (int)getLedger() ^ (int)(getFirstEntry());
+        return (int) getLedger() ^ (int) (getFirstEntry());
     }
 
     void setClean(int versionOfCleaning) {
@@ -154,8 +154,8 @@ public class LedgerEntryPage {
         checkPage();
         page.putLong(position, offset);
         version.incrementAndGet();
-        if (last < position/getIndexEntrySize()) {
-            last = position/getIndexEntrySize();
+        if (last < position / getIndexEntrySize()) {
+            last = position / getIndexEntrySize();
         }
         this.clean = false;
 
@@ -245,8 +245,8 @@ public class LedgerEntryPage {
     }
 
     private int getLastEntryIndex() {
-        for(int i = entriesPerPage - 1; i >= 0; i--) {
-            if (getOffset(i*getIndexEntrySize()) > 0) {
+        for (int i = entriesPerPage - 1; i >= 0; i--) {
+            if (getOffset(i * getIndexEntrySize()) > 0) {
                 return i;
             }
         }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorage.java
index 9fc9390..b142c2b 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorage.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorage.java
@@ -37,40 +37,35 @@ import org.apache.bookkeeper.meta.LedgerManager;
 public interface LedgerStorage {
 
     /**
-     * Initialize the LedgerStorage implementation
+     * Initialize the LedgerStorage implementation.
      *
      * @param conf
      * @param ledgerManager
      * @param ledgerDirsManager
      */
-    public void initialize(ServerConfiguration conf, LedgerManager ledgerManager,
-                           LedgerDirsManager ledgerDirsManager, LedgerDirsManager indexDirsManager,
-                           CheckpointSource checkpointSource, StatsLogger statsLogger)
+    void initialize(ServerConfiguration conf, LedgerManager ledgerManager, LedgerDirsManager ledgerDirsManager,
+                    LedgerDirsManager indexDirsManager, CheckpointSource checkpointSource, StatsLogger statsLogger)
             throws IOException;
 
     /**
-     * Start any background threads
-     * belonging to the storage system. For example,
-     * garbage collection.
+     * Start any background threads belonging to the storage system. For example, garbage collection.
      */
     void start();
 
     /**
-     * Cleanup and free any resources
-     * being used by the storage system.
+     * Cleanup and free any resources being used by the storage system.
      */
     void shutdown() throws InterruptedException;
 
     /**
-     * Whether a ledger exists
+     * Whether a ledger exists.
      */
     boolean ledgerExists(long ledgerId) throws IOException;
 
     /**
      * Fenced the ledger id in ledger storage.
      *
-     * @param ledgerId
-     *          Ledger Id.
+     * @param ledgerId Ledger Id.
      * @throws IOException when failed to fence the ledger.
      */
     boolean setFenced(long ledgerId) throws IOException;
@@ -78,19 +73,19 @@ public interface LedgerStorage {
     /**
      * Check whether the ledger is fenced in ledger storage or not.
      *
-     * @param ledgerId
-     *          Ledger ID.
+     * @param ledgerId Ledger ID.
      * @throws IOException
      */
     boolean isFenced(long ledgerId) throws IOException;
 
     /**
-     * Set the master key for a ledger
+     * Set the master key for a ledger.
      */
     void setMasterKey(long ledgerId, byte[] masterKey) throws IOException;
 
     /**
-     * Get the master key for a ledger
+     * Get the master key for a ledger.
+     *
      * @throws IOException if there is an error reading the from the ledger
      * @throws BookieException if no such ledger exists
      */
@@ -98,20 +93,20 @@ public interface LedgerStorage {
 
     /**
      * Add an entry to the storage.
+     *
      * @return the entry id of the entry added
      */
     long addEntry(ByteBuf entry) throws IOException;
 
     /**
-     * Read an entry from storage
+     * Read an entry from storage.
      */
     ByteBuf getEntry(long ledgerId, long entryId) throws IOException;
 
     /**
      * Get last add confirmed.
      *
-     * @param ledgerId
-     *          ledger id.
+     * @param ledgerId ledger id.
      * @return last add confirmed.
      * @throws IOException
      */
@@ -140,29 +135,29 @@ public interface LedgerStorage {
      * that it finished. The returned the checkpoint indicates that all entries added
      * before that point already persist.
      *
-     * @param checkpoint
-     *          Check Point that {@link Checkpoint} proposed.
+     * @param checkpoint Check Point that {@link Checkpoint} proposed.
      * @throws IOException
      * @return the checkpoint that the ledger storage finished.
      */
     Checkpoint checkpoint(Checkpoint checkpoint) throws IOException;
 
-    /*
-     *
+    /**
      * @param ledgerId
      * @throws IOException
      */
     void deleteLedger(long ledgerId) throws IOException;
 
-    public static interface LedgerDeletionListener {
+    /**
+     * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+     */
+    interface LedgerDeletionListener {
         void ledgerDeleted(long ledgerId);
     }
 
     /**
-     * Register a listener for ledgers deletion notifications
+     * Register a listener for ledgers deletion notifications.
      *
-     * @param listener
-     *            object that will be notified every time a ledger is deleted
+     * @param listener object that will be notified every time a ledger is deleted
      */
     void registerLedgerDeletionListener(LedgerDeletionListener listener);
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorageFactory.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorageFactory.java
index d2bac64..6ff0ed2 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorageFactory.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorageFactory.java
@@ -24,6 +24,9 @@ import java.io.IOException;
 
 import org.apache.bookkeeper.util.ReflectionUtils;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class LedgerStorageFactory {
     public static LedgerStorage createLedgerStorage(String name) throws IOException {
         try {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java
index 3969f41..d74e7cd 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java
@@ -20,7 +20,12 @@ package org.apache.bookkeeper.bookie;
 import com.google.common.base.Optional;
 
 import java.net.UnknownHostException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import org.apache.bookkeeper.client.BookieInfoReader.BookieInfo;
 import org.apache.bookkeeper.client.EnsemblePlacementPolicy;
@@ -36,7 +41,6 @@ import com.google.common.collect.Lists;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 import io.netty.util.HashedWheelTimer;
 
 /**
@@ -49,7 +53,10 @@ public class LocalBookieEnsemblePlacementPolicy implements EnsemblePlacementPoli
     private BookieSocketAddress bookieAddress;
 
     @Override
-    public EnsemblePlacementPolicy initialize(ClientConfiguration conf, Optional<DNSToSwitchMapping> optionalDnsResolver, HashedWheelTimer hashedWheelTimer, FeatureProvider featureProvider, StatsLogger statsLogger) {
+    public EnsemblePlacementPolicy initialize(ClientConfiguration conf,
+                                              Optional<DNSToSwitchMapping> optionalDnsResolver,
+                                              HashedWheelTimer hashedWheelTimer,
+                                              FeatureProvider featureProvider, StatsLogger statsLogger) {
         // Configuration will have already the bookie configuration inserted
         ServerConfiguration serverConf = new ServerConfiguration();
         serverConf.addConfiguration(conf);
@@ -77,23 +84,27 @@ public class LocalBookieEnsemblePlacementPolicy implements EnsemblePlacementPoli
     @Override
     public BookieSocketAddress replaceBookie(int ensembleSize, int writeQuorumSize, int ackQuorumSize,
         java.util.Map<String, byte[]> customMetadata, Collection<BookieSocketAddress> currentEnsemble,
-        BookieSocketAddress bookieToReplace, Set<BookieSocketAddress> excludeBookies) throws BKNotEnoughBookiesException {
+        BookieSocketAddress bookieToReplace, Set<BookieSocketAddress> excludeBookies)
+            throws BKNotEnoughBookiesException {
         throw new BKNotEnoughBookiesException();
     }
 
     @Override
-    public List<Integer> reorderReadSequence(ArrayList<BookieSocketAddress> ensemble, List<Integer> writeSet, Map<BookieSocketAddress, Long> bookieFailureHistory) {
+    public List<Integer> reorderReadSequence(ArrayList<BookieSocketAddress> ensemble, List<Integer> writeSet,
+                                             Map<BookieSocketAddress, Long> bookieFailureHistory) {
         return null;
     }
 
     @Override
-    public List<Integer> reorderReadLACSequence(ArrayList<BookieSocketAddress> ensemble, List<Integer> writeSet, Map<BookieSocketAddress, Long> bookieFailureHistory) {
+    public List<Integer> reorderReadLACSequence(ArrayList<BookieSocketAddress> ensemble, List<Integer> writeSet,
+                                                Map<BookieSocketAddress, Long> bookieFailureHistory) {
         return null;
     }
 
     @Override
     public ArrayList<BookieSocketAddress> newEnsemble(int ensembleSize, int writeQuorumSize, int ackQuorumSize,
-        java.util.Map<String, byte[]> customMetadata, Set<BookieSocketAddress> excludeBookies) throws BKNotEnoughBookiesException {
+        java.util.Map<String, byte[]> customMetadata, Set<BookieSocketAddress> excludeBookies)
+            throws BKNotEnoughBookiesException {
         if (ensembleSize > 1) {
             throw new IllegalArgumentException("Local ensemble policy can only return 1 bookie");
         }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LogMark.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LogMark.java
index 7aa2850..adae5b2 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LogMark.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LogMark.java
@@ -22,7 +22,7 @@ package org.apache.bookkeeper.bookie;
 import java.nio.ByteBuffer;
 
 /**
- * Journal stream position
+ * Journal stream position.
  */
 class LogMark {
     long logFileId;
@@ -70,7 +70,7 @@ class LogMark {
         if (ret == 0) {
             ret = this.logFileOffset - other.getLogFileOffset();
         }
-        return (ret < 0)? -1 : ((ret > 0)? 1 : 0);
+        return (ret < 0) ? -1 : ((ret > 0) ? 1 : 0);
     }
 
     @Override
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/MarkerFileChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/MarkerFileChannel.java
index 8ed63bb..786508e 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/MarkerFileChannel.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/MarkerFileChannel.java
@@ -30,8 +30,7 @@ import java.nio.channels.ReadableByteChannel;
 import java.nio.channels.WritableByteChannel;
 
 /**
- * This class is just a stub that can be used in collections with
- * FileChannels
+ * This class is just a stub that can be used in collections with FileChannels.
  */
 public class MarkerFileChannel extends FileChannel {
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyBookie.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyBookie.java
index 8b42029..7536120 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyBookie.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyBookie.java
@@ -31,13 +31,13 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Implements a read only bookie.
- * 
+ * <p>
  * ReadOnlyBookie is force started as readonly, and will not change to writable.
- *
+ * </p>
  */
 public class ReadOnlyBookie extends Bookie {
 
-    private final static Logger LOG = LoggerFactory.getLogger(ReadOnlyBookie.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ReadOnlyBookie.class);
 
     public ReadOnlyBookie(ServerConfiguration conf, StatsLogger statsLogger)
             throws IOException, KeeperException, InterruptedException, BookieException {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java
index 14f6562..d661412 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java
@@ -28,7 +28,7 @@ import org.apache.bookkeeper.conf.ServerConfiguration;
 import org.apache.bookkeeper.util.DiskChecker;
 
 /**
- * Read Only Entry Logger
+ * Read Only Entry Logger.
  */
 public class ReadOnlyEntryLogger extends EntryLogger {
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
index ebcb98c..8b87d0a 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
@@ -99,7 +99,8 @@ public class ScanAndCompareGarbageCollector implements GarbageCollector{
     public void gc(GarbageCleaner garbageCleaner) {
         try {
             // Get a set of all ledgers on the bookie
-            NavigableSet<Long> bkActiveLedgers = Sets.newTreeSet(ledgerStorage.getActiveLedgersInRange(0, Long.MAX_VALUE));
+            NavigableSet<Long> bkActiveLedgers = Sets.newTreeSet(ledgerStorage.getActiveLedgersInRange(0,
+                    Long.MAX_VALUE));
 
             // Iterate over all the ledger on the metadata store
             LedgerRangeIterator ledgerRangeIterator = ledgerManager.getLedgerRanges();
@@ -129,7 +130,7 @@ public class ScanAndCompareGarbageCollector implements GarbageCollector{
                 lastOverReplicatedLedgerGcTimeMillis = MathUtils.now();
             }
 
-            while(ledgerRangeIterator.hasNext()) {
+            while (ledgerRangeIterator.hasNext()) {
                 LedgerRange lRange = ledgerRangeIterator.next();
 
                 Long start = lastEnd + 1;
@@ -182,7 +183,8 @@ public class ScanAndCompareGarbageCollector implements GarbageCollector{
                 // we try to acquire the underreplicated ledger lock to not let the bookie replicate the ledger that is
                 // already being checked for deletion, since that might change the ledger ensemble to include the
                 // current bookie again and, in that case, we cannot remove the ledger from local storage
-                ZkLedgerUnderreplicationManager.acquireUnderreplicatedLedgerLock(zk, zkLedgersRootPath, ledgerId, zkAcls);
+                ZkLedgerUnderreplicationManager.acquireUnderreplicatedLedgerLock(zk, zkLedgersRootPath, ledgerId,
+                        zkAcls);
                 semaphore.acquire();
                 ledgerManager.readLedgerMetadata(ledgerId, new GenericCallback<LedgerMetadata>() {
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListArena.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListArena.java
index c3ec897..7eafb41 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListArena.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListArena.java
@@ -32,16 +32,18 @@ import org.apache.bookkeeper.conf.ServerConfiguration;
  * The SkipListArena is basically a bump-the-pointer allocator that allocates
  * big (default 2MB) byte[] chunks from and then handles it out to threads that
  * request slices into the array.
+ * </p>
  * <p>
  * The purpose of this class is to combat heap fragmentation in the
  * bookie. By ensuring that all KeyValues in a given SkipList refer
  * only to large chunks of contiguous memory, we ensure that large blocks
  * get freed up when the SkipList is flushed.
+ * </p>
  * <p>
  * Without the Arena, the byte array allocated during insertion end up
  * interleaved throughout the heap, and the old generation gets progressively
  * more fragmented until a stop-the-world compacting collection occurs.
- * <p>
+ * </p>
  */
 public class SkipListArena {
     private AtomicReference<Chunk> curChunk = new AtomicReference<Chunk>();
@@ -57,11 +59,11 @@ public class SkipListArena {
     }
 
     /**
-    * Allocate a slice of the given length.
-    *
-    * If the size is larger than the maximum size specified for this
-    * allocator, returns null.
-    */
+     * Allocate a slice of the given length.
+     * <p>
+     * If the size is larger than the maximum size specified for this allocator, returns null.
+     * </p>
+     */
     public MemorySlice allocateBytes(int size) {
         assert size >= 0;
 
@@ -125,7 +127,7 @@ public class SkipListArena {
     * A chunk of memory out of which allocations are sliced.
     */
     private static class Chunk {
-        /** Actual underlying data */
+        /** Actual underlying data. */
         private byte[] data;
 
         private static final int UNINITIALIZED = -1;
@@ -133,13 +135,13 @@ public class SkipListArena {
         /**
          * Offset for the next allocation, or the sentinel value -1
          * which implies that the chunk is still uninitialized.
-         * */
+         */
         private AtomicInteger nextFreeOffset = new AtomicInteger(UNINITIALIZED);
 
-        /** Total number of allocations satisfied from this buffer */
+        /** Total number of allocations satisfied from this buffer. */
         private AtomicInteger allocCount = new AtomicInteger();
 
-        /** Size of chunk in bytes */
+        /** Size of chunk in bytes. */
         private final int size;
 
         /**
@@ -202,9 +204,8 @@ public class SkipListArena {
 
         @Override
         public String toString() {
-            return "Chunk@" + System.identityHashCode(this) +
-                ": used(" + allocCount.get() + "), free(" +
-                (data.length - nextFreeOffset.get() + ")");
+            return "Chunk@" + System.identityHashCode(this) + ": used(" + allocCount.get() + "), free("
+                    + (data.length - nextFreeOffset.get() + ")");
         }
     }
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListFlusher.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListFlusher.java
index 1dfb880..96fbbe1 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListFlusher.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SkipListFlusher.java
@@ -25,19 +25,16 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 
 /**
- * Flush entries from skip list
+ * Flush entries from skip list.
  */
 public interface SkipListFlusher {
     /**
      * Process an entry.
      *
-     * @param ledgerId
-     *          Ledger ID.
-     * @param entryId
-     *          The entry id this entry.
-     * @param entry
-     *          Entry ByteBuffer
+     * @param ledgerId Ledger ID.
+     * @param entryId The entry id this entry.
+     * @param entry Entry ByteBuffer
      * @throws IOException
      */
-    public void process(long ledgerId, long entryId, ByteBuffer entry) throws IOException;
+    void process(long ledgerId, long entryId, ByteBuffer entry) throws IOException;
 }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SortedLedgerStorage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SortedLedgerStorage.java
index 105a8b5..ff2aa42 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SortedLedgerStorage.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SortedLedgerStorage.java
@@ -38,9 +38,12 @@ import org.apache.bookkeeper.stats.StatsLogger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
+ */
 public class SortedLedgerStorage extends InterleavedLedgerStorage
         implements LedgerStorage, CacheCallback, SkipListFlusher {
-    private final static Logger LOG = LoggerFactory.getLogger(SortedLedgerStorage.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SortedLedgerStorage.class);
 
     EntryMemTable memTable;
     private ScheduledExecutorService scheduler;
@@ -59,7 +62,7 @@ public class SortedLedgerStorage extends InterleavedLedgerStorage
         this.scheduler = Executors.newSingleThreadScheduledExecutor(
                 new ThreadFactoryBuilder()
                 .setNameFormat("SortedLedgerStorage-%d")
-                .setPriority((Thread.NORM_PRIORITY + Thread.MAX_PRIORITY)/2).build());
+                .setPriority((Thread.NORM_PRIORITY + Thread.MAX_PRIORITY) / 2).build());
     }
 
     @Override
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SyncThread.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SyncThread.java
index 8d63555..5eb15df 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SyncThread.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SyncThread.java
@@ -55,7 +55,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
  * </p>
  */
 class SyncThread {
-    private final static Logger LOG = LoggerFactory.getLogger(SyncThread.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SyncThread.class);
 
     final ScheduledExecutorService executor;
     final int flushInterval;
@@ -152,7 +152,7 @@ class SyncThread {
      */
     @VisibleForTesting
     public void suspendSync() {
-        synchronized(suspensionLock) {
+        synchronized (suspensionLock) {
             suspended = true;
         }
     }
@@ -162,7 +162,7 @@ class SyncThread {
      */
     @VisibleForTesting
     public void resumeSync() {
-        synchronized(suspensionLock) {
+        synchronized (suspensionLock) {
             suspended = false;
             suspensionLock.notify();
         }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieConnectionPeer.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/package-info.java
similarity index 77%
copy from bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieConnectionPeer.java
copy to bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/package-info.java
index f7b917d..a44adb5 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieConnectionPeer.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/package-info.java
@@ -1,5 +1,4 @@
-/**
- *
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -16,15 +15,8 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
-package org.apache.bookkeeper.bookie;
-
-import org.apache.bookkeeper.proto.ConnectionPeer;
-
 /**
- * Represents the connection to a BookKeeper client, from the Bookie side 
+ * @TODO: Write JavaDoc comment {@link https://github.com/apache/bookkepeer/issues/247}
  */
-public interface BookieConnectionPeer extends ConnectionPeer {
-
-}
+package org.apache.bookkeeper.bookie;
\ No newline at end of file
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/AuthHandler.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/AuthHandler.java
index 11dff7a..9fd739f 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/AuthHandler.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/AuthHandler.java
@@ -278,7 +278,7 @@ class AuthHandler {
                     } else {
                         assert (resp.hasAuthResponse());
                         BookkeeperProtocol.AuthMessage am = resp.getAuthResponse();
-                        if (AuthProviderFactoryFactory.authenticationDisabledPluginName.equals(am.getAuthPluginName())){
+                        if (AuthProviderFactoryFactory.AUTHENTICATION_DISABLED_PLUGIN_NAME.equals(am.getAuthPluginName())){
                             SocketAddress remote  = ctx.channel().remoteAddress();
                             LOG.info("Authentication is not enabled."
                                 + "Considering this client {0} authenticated", remote);
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java
index 1f20425..90a0524 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java
@@ -196,7 +196,7 @@ public class BookieRequestProcessor implements RequestProcessor {
                     LOG.info("Ignoring auth operation from client {}",c.remoteAddress());
                     BookkeeperProtocol.AuthMessage message = BookkeeperProtocol.AuthMessage
                         .newBuilder()
-                        .setAuthPluginName(AuthProviderFactoryFactory.authenticationDisabledPluginName)
+                        .setAuthPluginName(AuthProviderFactoryFactory.AUTHENTICATION_DISABLED_PLUGIN_NAME)
                         .setPayload(ByteString.copyFrom(AuthToken.NULL.getData()))
                         .build();
                     BookkeeperProtocol.Response.Builder authResponse =

-- 
To stop receiving notification emails like this one, please contact
['"commits@bookkeeper.apache.org" <commits@bookkeeper.apache.org>'].

Mime
View raw message