| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | * Portions copyright 2011-2013 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | import org.opends.messages.MessageBuilder; |
| | |
| | | private DbMonitorProvider dbMonitor = new DbMonitorProvider(); |
| | | private boolean shutdown = false; |
| | | private boolean done = false; |
| | | private DirectoryThread thread = null; |
| | | private DirectoryThread thread; |
| | | private final Object flushLock = new Object(); |
| | | private ReplicationServer replicationServer; |
| | | |
| | |
| | | this.baseDn = baseDn; |
| | | trimAge = replicationServer.getTrimAge(); |
| | | queueMaxSize = queueSize; |
| | | queueLowmark = queueSize * 1 / 5; |
| | | queueLowmark = queueSize / 5; |
| | | queueHimark = queueSize * 4 / 5; |
| | | queueMaxBytes = 200 * queueMaxSize; |
| | | queueLowmarkBytes = 200 * queueLowmark; |
| | |
| | | { |
| | | flush(); |
| | | } |
| | | ReplicationIterator it = |
| | | new ReplicationIterator(serverId, db, changeNumber, this); |
| | | return it; |
| | | return new ReplicationIterator(serverId, db, changeNumber, this); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public void shutdown() |
| | | { |
| | | if (shutdown == true) |
| | | if (shutdown) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | synchronized (this) |
| | | { |
| | | while (done == false) |
| | | { /* Can this be replaced with thread.join() ? */ |
| | | while (!done) |
| | | { |
| | | try |
| | | { |
| | | this.wait(); |
| | | } catch (Exception e) |
| | | {} |
| | | { /* do nothing */} |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | while (shutdown == false) |
| | | while (!shutdown) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | msgQueue.wait(1000); |
| | | } catch (InterruptedException e) |
| | | { } |
| | | { |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception end) |