From bd3c137fd2e1fa9e13289ab0573e07f9a4212e05 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 30 Aug 2013 09:56:47 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB
---
opends/src/server/org/opends/server/replication/server/changelog/je/DbHandler.java | 34 ++++++++++++++++++----------------
1 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/changelog/je/DbHandler.java b/opends/src/server/org/opends/server/replication/server/changelog/je/DbHandler.java
index 8caa08f..e4f4dd8 100644
--- a/opends/src/server/org/opends/server/replication/server/changelog/je/DbHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/changelog/je/DbHandler.java
@@ -43,8 +43,8 @@
import org.opends.server.replication.server.ReplicationServer;
import org.opends.server.replication.server.ReplicationServerDomain;
import org.opends.server.replication.server.changelog.api.ChangelogException;
-import org.opends.server.replication.server.changelog.api.ReplicationIterator;
-import org.opends.server.replication.server.changelog.je.ReplicationDB.*;
+import org.opends.server.replication.server.changelog.api.ReplicationDBCursor;
+import org.opends.server.replication.server.changelog.je.ReplicationDB.ReplServerDBCursor;
import org.opends.server.types.Attribute;
import org.opends.server.types.Attributes;
import org.opends.server.types.InitializationException;
@@ -59,8 +59,8 @@
* server in the topology.
* It is responsible for efficiently saving the updates that is received from
* each master server into stable storage.
- * This class is also able to generate a ReplicationIterator that can be
- * used to read all changes from a given ChangeNumber.
+ * This class is also able to generate a {@link ReplicationDBCursor} that can be
+ * used to read all changes from a given {@link ChangeNumber}.
*
* This class publish some monitoring information below cn=monitor.
*/
@@ -260,24 +260,26 @@
}
/**
- * Generate a new ReplicationIterator that allows to browse the db
- * managed by this dbHandler and starting at the position defined
- * by a given changeNumber.
- *
- * @param startAfterCN The position where the iterator must start.
- * @return a new ReplicationIterator that allows to browse the db
- * managed by this dbHandler and starting at the position defined
- * by a given changeNumber.
- * @throws ChangelogException if a database problem happened.
- */
- public ReplicationIterator generateIterator(ChangeNumber startAfterCN)
+ * Generate a new {@link ReplicationDBCursor} that allows to browse the db
+ * managed by this dbHandler and starting at the position defined by a given
+ * changeNumber.
+ *
+ * @param startAfterCN
+ * The position where the cursor must start.
+ * @return a new {@link ReplicationDBCursor} that allows to browse the db
+ * managed by this dbHandler and starting at the position defined by a
+ * given changeNumber.
+ * @throws ChangelogException
+ * if a database problem happened.
+ */
+ public ReplicationDBCursor generateCursorFrom(ChangeNumber startAfterCN)
throws ChangelogException
{
if (startAfterCN == null)
{
flush();
}
- return new JEReplicationIterator(db, startAfterCN, this);
+ return new JEReplicationDBCursor(db, startAfterCN, this);
}
/**
--
Gitblit v1.10.0