| | |
| | | import org.opends.server.replication.protocol.UpdateMsg; |
| | | import org.opends.server.replication.server.changelog.api.ChangelogException; |
| | | import org.opends.server.replication.server.changelog.api.DBCursor; |
| | | import org.opends.server.replication.server.changelog.file.LogFile.LogCursor; |
| | | import org.opends.server.replication.server.changelog.file.Log.RepositionableCursor; |
| | | |
| | | /** |
| | | * A cursor on ReplicaDB. |
| | |
| | | { |
| | | |
| | | /** The underlying cursor. */ |
| | | private final LogCursor<CSN, UpdateMsg> cursor; |
| | | private final RepositionableCursor<CSN, UpdateMsg> cursor; |
| | | |
| | | /** The next record to return. */ |
| | | private Record<CSN, UpdateMsg> nextRecord; |
| | |
| | | * The CSN to use as a start point (excluded from cursor, the lowest |
| | | * CSN higher than this CSN is used as the real start point). |
| | | */ |
| | | FileReplicaDBCursor(LogCursor<CSN, UpdateMsg> cursor, CSN startAfterCSN) { |
| | | FileReplicaDBCursor(RepositionableCursor<CSN, UpdateMsg> cursor, CSN startAfterCSN) { |
| | | this.cursor = cursor; |
| | | this.lastNonNullCurrentCSN = startAfterCSN; |
| | | } |
| | |
| | | else |
| | | { |
| | | // Exhausted cursor must be able to reinitialize itself |
| | | cursor.rewind(); |
| | | cursor.positionTo(lastNonNullCurrentCSN, true); |
| | | |
| | | nextRecord = cursor.getRecord(); |