public class ChangeNumberIndexer extends DirectoryThread
Only changes older than the medium consistency point are inserted in the CNIndexDB. As a consequence this class is
also responsible for maintaining the medium consistency point (indirectly through an ECLMultiDomainDBCursor
).
Thread.State, Thread.UncaughtExceptionHandler
DIRECTORY_THREAD_GROUP
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ChangeNumberIndexer(ChangelogDB changelogDB,
ChangelogStateProvider changelogStateProvider)
Builds a ChangeNumberIndexer object.
|
Modifier and Type | Method and Description |
---|---|
void |
clear(Dn baseDN)
Asks the current thread to clear its state for the specified domain.
|
void |
initiateShutdown()
Instructs the current thread to initiate the shutdown process.
|
boolean |
isReplicaOffline(Dn domainDN,
int serverId)
Indicates if the replica corresponding to provided domain DN and server id is offline.
|
protected void |
notifyEntryAddedToChangelog(Dn baseDN,
long changeNumber,
MultiDomainServerState cookie,
UpdateMsg msg)
Notifies the
ChangelogBackend that a new entry has been added. |
void |
publishHeartbeat(Dn baseDN,
CSN heartbeatCSN)
Ensures the medium consistency point is updated by heartbeats.
|
void |
publishUpdateMsg(Dn baseDN,
UpdateMsg updateMsg)
Ensures the medium consistency point is updated by UpdateMsg.
|
void |
replicaOffline(Dn baseDN,
CSN offlineCSN)
Signals a replica went offline.
|
void |
run() |
getAssociatedTask, getCreationStackTrace, getDebugProperties, getParentThread, isShutdownInitiated, isStarted, isStarting, setAssociatedTask, setStarted
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public ChangeNumberIndexer(ChangelogDB changelogDB, ChangelogStateProvider changelogStateProvider)
changelogDB
- the changelogDBchangelogStateProvider
- the replication environment information for access to changelog statepublic void publishHeartbeat(Dn baseDN, CSN heartbeatCSN)
baseDN
- the baseDN of the domain for which the heartbeat is publishedheartbeatCSN
- the CSN coming from the heartbeatpublic boolean isReplicaOffline(Dn domainDN, int serverId)
domainDN
- base DN of the replicaserverId
- server id of the replicatrue
if replica is offline, false
otherwisepublic void publishUpdateMsg(Dn baseDN, UpdateMsg updateMsg)
baseDN
- the baseDN of the domain for which the heartbeat is publishedupdateMsg
- the updateMsg that will update the medium consistency pointpublic void replicaOffline(Dn baseDN, CSN offlineCSN)
baseDN
- the replica's replication domainofflineCSN
- the serverId and time of the replica that went offlinepublic void initiateShutdown()
DirectoryThread
Thread.run()
method.initiateShutdown
in class DirectoryThread
protected void notifyEntryAddedToChangelog(Dn baseDN, long changeNumber, MultiDomainServerState cookie, UpdateMsg msg) throws ChangelogException
ChangelogBackend
that a new entry has been added.baseDN
- the baseDN of the newly added entry.changeNumber
- the change number of the newly added entry. It will be greater than zero for entries added to the
change number index and less than or equal to zero for entries added to any replica DBcookie
- the cookie of the newly added entry. This is only meaningful for entries added to the change number
indexmsg
- the update message of the newly added entryChangelogException
- If a problem occurs while notifying of the newly added entry.public void clear(Dn baseDN)
Note: This method blocks the current thread until state is cleared.
baseDN
- the baseDN to be cleared from this thread's state. null
and Dn.rootDn()
mean "clear
all domains".Copyright 2010-2018 ForgeRock AS.