From dbc982944cd13543eaa810c6eb0b78a7c2524d86 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Tue, 17 Jun 2014 13:40:54 +0000
Subject: [PATCH] OPENDJ-1449 : File-based changelog should handle partially written record left over from a previous failure CR-3768

---
 opends/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDB.java |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDB.java b/opends/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDB.java
index 988e65c..a4acf52 100644
--- a/opends/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDB.java
+++ b/opends/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDB.java
@@ -203,21 +203,6 @@
   }
 
   /**
-   * Get the number of changes.
-   *
-   * @return Returns the number of changes.
-   */
-  long getChangesCount()
-  {
-    final CSNLimits limits = csnLimits;
-    if (limits.newestCSN != null && limits.oldestCSN != null)
-    {
-      return limits.newestCSN.getSeqnum() - limits.oldestCSN.getSeqnum() + 1;
-    }
-    return 0;
-  }
-
-  /**
    * Returns a cursor that allows to retrieve the update messages from this DB,
    * starting at the position defined by the smallest CSN that is strictly
    * higher than the provided CSN.
@@ -363,6 +348,16 @@
     return log.getNumberOfRecords();
   }
 
+  /**
+   * Dump this DB as text files, intended for debugging purpose only.
+   *
+   * @throws ChangelogException
+   *           If an error occurs during dump
+   */
+  void dumpAsTextFiles() throws ChangelogException {
+    log.dumpAsTextFile(log.getPath());
+  }
+
   /** Parser of records persisted in the ReplicaDB log. */
   private static class ReplicaDBParser implements RecordParser<CSN, UpdateMsg>
   {

--
Gitblit v1.10.0