Class ExamineReplicator
Used to replicate an index to a destination directory
public class ExamineReplicator : IDisposable
- Inheritance
-
ExamineReplicator
- Implements
- Inherited Members
Remarks
The destination directory must not have any active writers open to it.
Constructors
ExamineReplicator(ILogger<ExamineReplicator>, ILogger<LoggingReplicationClient>, LuceneIndex, Directory, Directory, Directory?, DirectoryInfo)
Initializes a new instance of the ExamineReplicator class.
public ExamineReplicator(ILogger<ExamineReplicator> replicatorLogger, ILogger<LoggingReplicationClient> clientLogger, LuceneIndex sourceIndex, Directory sourceDirectory, Directory destinationDirectory, Directory? destinationTaxonomyDirectory, DirectoryInfo tempStorage)
Parameters
replicatorLoggerILogger<ExamineReplicator>The logger for the replicator.
clientLoggerILogger<LoggingReplicationClient>The logger for the replication client.
sourceIndexLuceneIndexThe source index to replicate from.
sourceDirectoryDirectoryThe source directory of the index.
destinationDirectoryDirectoryThe destination directory for replication.
destinationTaxonomyDirectoryDirectoryThe destination taxonomy directory for replication. Can be null if taxonomy is disabled.
tempStorageDirectoryInfoThe temporary storage directory used during replication.
Properties
ConsecutiveReplicationFailures
The number of consecutive times scheduled replication has failed to publish a revision.
public int ConsecutiveReplicationFailures { get; }
Property Value
Remarks
This is reset to zero after a successful publish or when scheduled replication is (re)started.
IsReplicationHealthy
Returns false once scheduled replication has failed MaxConsecutiveReplicationFailures
consecutive times and has therefore been stopped, allowing callers to monitor replication health.
public bool IsReplicationHealthy { get; }
Property Value
MaxConsecutiveReplicationFailures
The number of consecutive scheduled replication failures that are tolerated before replication is automatically stopped and reported as unhealthy via IsReplicationHealthy.
public int MaxConsecutiveReplicationFailures { get; }
Property Value
Remarks
Defaults to 5. Set to a value of 0 or less to never stop replication automatically.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Disposes the instance
protected virtual void Dispose(bool disposing)
Parameters
disposingboolIf the call is coming from Dispose
ReplicateIndex()
Will sync from the active index to the destination directory
public void ReplicateIndex()
StartIndexReplicationOnSchedule(int)
Starts index replication
public void StartIndexReplicationOnSchedule(int milliseconds)
Parameters
millisecondsint