From da0ab2365152aba4ed332d6e1f49ba9d60119ccf Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 16 Dec 2015 14:25:58 +0000
Subject: [PATCH] Code cleanup
---
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
index 40b2e0b..061b658 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
@@ -257,7 +257,6 @@
/** Holds the parameters for log files rotation. */
static class LogRotationParameters {
-
private final long sizeLimitPerFileInBytes;
private final long rotationInterval;
private final long lastRotationTime;
@@ -279,6 +278,15 @@
this.lastRotationTime = lastRotationTime;
}
+ @Override
+ public String toString()
+ {
+ return getClass().getSimpleName() + "("
+ + "sizeLimitPerFileInBytes=" + sizeLimitPerFileInBytes
+ + ", rotationInterval=" + rotationInterval
+ + ", lastRotationTime=" + lastRotationTime
+ + ")";
+ }
}
/**
@@ -509,10 +517,7 @@
return false;
}
- /**
- * Indicates if the provided record has a key that would break the key
- * ordering in the log.
- */
+ /** Indicates if the provided record has a key that would break the key ordering in the log. */
private boolean recordIsBreakingKeyOrdering(final Record<K, V> record)
{
return lastAppendedKey != null && record.getKey().compareTo(lastAppendedKey) <= 0;
@@ -669,7 +674,6 @@
}
}
-
/**
* Returns the newest (last) record from this log.
*
@@ -771,11 +775,11 @@
{
exclusiveLock.unlock();
}
-
}
/**
* Abort all cursors opened on the provided log file.
+ * <p>
* @GuardedBy("exclusiveLock")
*/
private void abortCursorsOpenOnLogFile(LogFile<K, V> logFile)
@@ -1166,7 +1170,7 @@
private boolean isHeadLogFile(final LogFile<K, V> logFile)
{
- return logFile.getFile().getName().equals(Log.HEAD_LOG_FILE_NAME);
+ return Log.HEAD_LOG_FILE_NAME.equals(logFile.getFile().getName());
}
/** @GuardedBy("sharedLock") */
@@ -1220,9 +1224,8 @@
* <p>
* This is an abstract class rather than an interface to allow reduced visibility of the methods.
*/
- private abstract static class LogCursor<K extends Comparable<K>, V> implements RepositionableCursor<K, V>
+ private static abstract class LogCursor<K extends Comparable<K>, V> implements RepositionableCursor<K, V>
{
-
/** Closes the underlying cursor. */
abstract void closeUnderlyingCursor();
@@ -1234,7 +1237,6 @@
/** Returns true if cursor is pointing on provided log file. */
abstract boolean isAccessingLogFile(LogFile<K, V> logFile);
-
}
/**
@@ -1376,7 +1378,6 @@
return String.format("Cursor on log : %s, current log file: %s, current cursor: %s",
log.logPath, currentLogFile.getFile().getName(), currentCursor);
}
-
}
/**
@@ -1668,5 +1669,4 @@
return isValid;
}
}
-
}
--
Gitblit v1.10.0