From 27328d01b7e1ec22316d62de94b1788f3a83c11f Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 04 Oct 2013 12:46:34 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB
---
opendj-sdk/opends/src/server/org/opends/server/replication/common/CSNGenerator.java | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/common/CSNGenerator.java b/opendj-sdk/opends/src/server/org/opends/server/replication/common/CSNGenerator.java
index 559d621..5b295b5 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/common/CSNGenerator.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/common/CSNGenerator.java
@@ -64,19 +64,22 @@
* all {@link CSN}s generated will be larger than all the
* {@link CSN}s currently in state.
*/
- public CSNGenerator(int id, ServerState state)
- {
- this.lastTime = TimeThread.getTime();
- for (int stateId : state)
- {
- if (this.lastTime < state.getCSN(stateId).getTime())
- this.lastTime = state.getCSN(stateId).getTime();
- if (stateId == id)
- this.seqnum = state.getCSN(id).getSeqnum();
- }
- this.serverId = id;
-
- }
+ public CSNGenerator(int id, ServerState state)
+ {
+ this.lastTime = TimeThread.getTime();
+ for (CSN csn : state)
+ {
+ if (this.lastTime < csn.getTime())
+ {
+ this.lastTime = csn.getTime();
+ }
+ if (csn.getServerId() == id)
+ {
+ this.seqnum = csn.getSeqnum();
+ }
+ }
+ this.serverId = id;
+ }
/**
* Generate a new {@link CSN}.
@@ -160,9 +163,9 @@
*/
public void adjust(ServerState state)
{
- for (int localServerId : state)
+ for (CSN csn : state)
{
- adjust(state.getCSN(localServerId));
+ adjust(csn);
}
}
}
--
Gitblit v1.10.0