| | |
| | | import org.opends.server.replication.server.ReplicationServerDomain; |
| | | import org.opends.server.replication.server.changelog.api.*; |
| | | import org.opends.server.replication.server.changelog.je.DraftCNDB.*; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.*; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void clear(String baseDNToClear) throws ChangelogException |
| | | public void clear(DN baseDNToClear) throws ChangelogException |
| | | { |
| | | if (isEmpty()) |
| | | { |
| | |
| | | |
| | | // From the draftCNDb change record, get the domain and CSN |
| | | final CNIndexRecord record = cursor.currentRecord(); |
| | | final String baseDN = record.getBaseDN(); |
| | | if (baseDNToClear != null && baseDNToClear.equalsIgnoreCase(baseDN)) |
| | | if (baseDNToClear != null && baseDNToClear.equals(record.getBaseDN())) |
| | | { |
| | | cursor.delete(); |
| | | continue; |
| | | } |
| | | |
| | | final ReplicationServerDomain domain = |
| | | replicationServer.getReplicationServerDomain(baseDN); |
| | | replicationServer.getReplicationServerDomain(record.getBaseDN()); |
| | | if (domain == null) |
| | | { |
| | | // the domain has been removed since the record was written in the |
| | |
| | | ServerState csnVector; |
| | | try |
| | | { |
| | | Map<String, ServerState> csnStartStates = |
| | | Map<DN, ServerState> csnStartStates = |
| | | MultiDomainServerState.splitGenStateToServerStates( |
| | | record.getPreviousCookie()); |
| | | csnVector = csnStartStates.get(baseDN); |
| | | csnVector = csnStartStates.get(record.getBaseDN()); |
| | | |
| | | if (debugEnabled()) |
| | | TRACER.debugInfo("DraftCNDBHandler:clear() - ChangeVector:" |
| | |
| | | * Takes the lock on this object (blocking until lock can be acquired). |
| | | * @throws InterruptedException If interrupted. |
| | | */ |
| | | public void lock() throws InterruptedException |
| | | public void lock() throws InterruptedException |
| | | { |
| | | lock.lockInterruptibly(); |
| | | } |