| | |
| | | |
| | | import org.opends.messages.MessageBuilder; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.replication.server.changelog.api.CNIndexRecord; |
| | | import org.opends.server.replication.server.changelog.api.ChangelogException; |
| | | import org.opends.server.replication.server.changelog.api.*; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | |
| | | import com.sleepycat.je.*; |
| | |
| | | * Add a record to the database. |
| | | * |
| | | * @param record |
| | | * the provided {@link CNIndexRecord} to be stored. |
| | | * the provided {@link ChangeNumberIndexRecord} to be stored. |
| | | */ |
| | | public void addRecord(CNIndexRecord record) |
| | | public void addRecord(ChangeNumberIndexRecord record) |
| | | { |
| | | try |
| | | { |
| | |
| | | * @throws ChangelogException |
| | | * if a database problem occurred |
| | | */ |
| | | public CNIndexRecord readFirstRecord() throws ChangelogException |
| | | public ChangeNumberIndexRecord readFirstRecord() throws ChangelogException |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private CNIndexRecord newCNIndexRecord(ReplicationDraftCNKey key, |
| | | private ChangeNumberIndexRecord newCNIndexRecord(ReplicationDraftCNKey key, |
| | | DatabaseEntry data) throws ChangelogException |
| | | { |
| | | return new DraftCNData(key.getChangeNumber(), data.getData()).getRecord(); |
| | |
| | | * @throws ChangelogException |
| | | * if a database problem occurred |
| | | */ |
| | | public CNIndexRecord readLastRecord() throws ChangelogException |
| | | public ChangeNumberIndexRecord readLastRecord() throws ChangelogException |
| | | { |
| | | try |
| | | { |
| | |
| | | private final Transaction txn; |
| | | private final ReplicationDraftCNKey key; |
| | | private final DatabaseEntry entry = new DatabaseEntry(); |
| | | private CNIndexRecord record; |
| | | private ChangeNumberIndexRecord record; |
| | | private boolean isClosed = false; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the {@link CNIndexRecord} at the current position of the cursor. |
| | | * Returns the {@link ChangeNumberIndexRecord} at the current position of |
| | | * the cursor. |
| | | * |
| | | * @return The current {@link CNIndexRecord}. |
| | | * @return The current {@link ChangeNumberIndexRecord}. |
| | | */ |
| | | public CNIndexRecord currentRecord() |
| | | public ChangeNumberIndexRecord currentRecord() |
| | | { |
| | | if (isClosed) |
| | | { |