Table of Contents

Class ExamineReplicator

Namespace
Examine.Lucene
Assembly
Examine.Lucene.dll

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

replicatorLogger ILogger<ExamineReplicator>

The logger for the replicator.

clientLogger ILogger<LoggingReplicationClient>

The logger for the replication client.

sourceIndex LuceneIndex

The source index to replicate from.

sourceDirectory Directory

The source directory of the index.

destinationDirectory Directory

The destination directory for replication.

destinationTaxonomyDirectory Directory

The destination taxonomy directory for replication. Can be null if taxonomy is disabled.

tempStorage DirectoryInfo

The 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

int

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

bool

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

int

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

disposing bool

If 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

milliseconds int

Exceptions

InvalidOperationException