| | |
| | | */ |
| | | private int assuredTimeoutTimerPurgeCounter; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Stores pending status messages such as DS change time heartbeats for future |
| | | * forwarding to the rest of the topology. This class is required in order to |
| | |
| | | pendingRSMonitorMsgs.put(rsServerId, msg); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Run when the assured timeout for an assured update message we are waiting |
| | | * acks for occurs. |
| | | * Run when the assured timeout for an assured update message we are waiting acks for occurs. |
| | | */ |
| | | @Override |
| | | public void run() |
| | |
| | | if (safeRead) |
| | | { |
| | | origServer.incrementAssuredSrReceivedUpdatesTimeout(); |
| | | } else |
| | | } |
| | | else if (origServer.isDataServer()) |
| | | { |
| | | if (origServer.isDataServer()) |
| | | { |
| | | origServer.incrementAssuredSdReceivedUpdatesTimeout(); |
| | | } |
| | | origServer.incrementAssuredSdReceivedUpdatesTimeout(); |
| | | } |
| | | // retrieve expected servers in timeout to increment their counter |
| | | List<Integer> serversInTimeout = expectedAcksInfo.getTimeoutServers(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Stop operations with a list of replication servers. |
| | | * |
| | |
| | | return servers; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Processes a message coming from one server in the topology and potentially |
| | | * forwards it to one or all other servers. |
| | |
| | | return returnMsg; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new monitor message including monitoring information for the |
| | | * topology directly connected to this RS. This includes information for: - |
| | |
| | | return monitorMsg; |
| | | } |
| | | |
| | | /** |
| | | * Shutdown this ReplicationServerDomain. |
| | | */ |
| | | /** Shutdown this ReplicationServerDomain. */ |
| | | public void shutdown() |
| | | { |
| | | DirectoryServer.deregisterMonitorProvider(this); |
| | |
| | | return domainDB.getDomainNewestCSNs(baseDN); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return "ReplicationServerDomain " + baseDN; |
| | | return getClass().getSimpleName() + " " + baseDN; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a TopologyMsg filled with information to be sent to a remote RS. |
| | | * We send remote RS the info of every DS that are directly connected to us |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Update every peers (RS/DS) with topology changes. |
| | | */ |
| | | /** Update every peers (RS/DS) with topology changes. */ |
| | | public void sendTopoInfoToAll() |
| | | { |
| | | enqueueTopoInfoToAllExcept(null); |
| | |
| | | statusAnalyzer.notifyPendingStatusMessage(); |
| | | } |
| | | |
| | | /** |
| | | * Clears the Db associated with that domain. |
| | | */ |
| | | /** Clears the Db associated with that domain. */ |
| | | private void clearDbs() |
| | | { |
| | | try |
| | |
| | | rsHandler.send(errorMsg); |
| | | } |
| | | |
| | | /* |
| | | * Sends the currently known topology information to every connected |
| | | * DS we have. |
| | | */ |
| | | /* Sends the currently known topology information to every connected DS we have. */ |
| | | synchronized (pendingStatusMessagesLock) |
| | | { |
| | | pendingStatusMessages.enqueueTopoInfoToAllDSsExcept(null); |
| | |
| | | return Collections.unmodifiableMap(connectedRSs); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * A synchronization mechanism is created to insure exclusive access to the |
| | | * domain. The goal is to have a consistent view of the topology by locking |
| | |
| | | */ |
| | | private final ReentrantLock lock = new ReentrantLock(); |
| | | |
| | | /** |
| | | * This lock is used to protect the generationId variable. |
| | | */ |
| | | /** This lock is used to protect the generationId variable. */ |
| | | private final Object generationIDLock = new Object(); |
| | | |
| | | /** |
| | |
| | | lock.lockInterruptibly(); |
| | | } |
| | | |
| | | /** |
| | | * Releases the lock on this domain. |
| | | */ |
| | | /** Releases the lock on this domain. */ |
| | | public void release() |
| | | { |
| | | lock.unlock(); |
| | |
| | | return lock.tryLock(timeout, TimeUnit.MILLISECONDS); |
| | | } |
| | | |
| | | /** |
| | | * Starts the monitoring publisher for the domain if not already started. |
| | | */ |
| | | /** Starts the monitoring publisher for the domain if not already started. */ |
| | | private void startMonitoringPublisher() |
| | | { |
| | | long period = localReplicationServer.getMonitoringPublisherPeriod(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Stops the monitoring publisher for the domain. |
| | | */ |
| | | /** Stops the monitoring publisher for the domain. */ |
| | | private void stopMonitoringPublisher() |
| | | { |
| | | final MonitoringPublisher thread = monitoringPublisher.get(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuraiton) |
| | | { |
| | | // Nothing to do for now |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Processes a ChangeTimeHeartbeatMsg received, by storing the CSN (timestamp) |
| | | * value received, and forwarding the message to the other RSes. |
| | |
| | | + ": " + message); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Go through each connected DS, get the number of pending changes we have for |
| | | * it and change status accordingly if threshold value is crossed/uncrossed. |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Sends any enqueued status messages to the rest of the topology. |
| | | */ |
| | | /** Sends any enqueued status messages to the rest of the topology. */ |
| | | void sendPendingStatusMessages() |
| | | { |
| | | /* |
| | |
| | | sendPendingMonitorMsgs(savedState); |
| | | } |
| | | |
| | | |
| | | |
| | | private void sendPendingMonitorMsgs(final PendingStatusMessages pendingMsgs) |
| | | { |
| | | for (Entry<Integer, MonitorMsg> msg : pendingMsgs.pendingDSMonitorMsgs |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void sendPendingChangeTimeHeartbeatMsgs(PendingStatusMessages pendingMsgs) |
| | | { |
| | | for (ChangeTimeHeartbeatMsg pendingHeartbeat : pendingMsgs.pendingHeartbeats.values()) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void sendPendingTopologyMsgs(PendingStatusMessages pendingMsgs) |
| | | { |
| | | if (pendingMsgs.sendDSTopologyMsg) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void enqueueMonitorMsg(MonitorRequestMsg msg, ServerHandler sender) |
| | | { |
| | | /* |