Package org.apache.solr.cloud
Class ReplicateFromLeader
- java.lang.Object
-
- org.apache.solr.cloud.ReplicateFromLeader
-
public class ReplicateFromLeader extends Object
-
-
Constructor Summary
Constructors Constructor Description ReplicateFromLeader(CoreContainer cc, String coreName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
determinePollInterval(SolrConfig.UpdateHandlerInfo uinfo)
Determine the poll interval for replicas based on the auto soft/hard commit schedulestatic String
getCommitVersion(SolrCore solrCore)
void
startReplication(boolean switchTransactionLog)
Start a replication handler thread that will periodically pull indices from the shard leadervoid
stopReplication()
-
-
-
Constructor Detail
-
ReplicateFromLeader
public ReplicateFromLeader(CoreContainer cc, String coreName)
-
-
Method Detail
-
startReplication
public void startReplication(boolean switchTransactionLog)
Start a replication handler thread that will periodically pull indices from the shard leaderThis is separate from the ReplicationHandler that listens at /replication, used for recovery and leader actions. It is simpler to discard the entire polling ReplicationHandler rather then worrying about disabling polling and correctly setting all of the leader bits if we need to reset.
TODO: It may be cleaner to extract the polling logic use that directly instead of creating what might be a fairly heavyweight instance here.
- Parameters:
switchTransactionLog
- if true, ReplicationHandler will rotate the transaction log once the replication is done
-
determinePollInterval
public static String determinePollInterval(SolrConfig.UpdateHandlerInfo uinfo)
Determine the poll interval for replicas based on the auto soft/hard commit schedule- Parameters:
uinfo
- the update handler info containing soft/hard commit configuration- Returns:
- a poll interval string representing a cadence of polling frequency in the form of hh:mm:ss
-
stopReplication
public void stopReplication()
-
-