Class PeerSync

  • All Implemented Interfaces:
    AutoCloseable, SolrMetricProducer

    public class PeerSync
    extends Object
    implements SolrMetricProducer
    This class is useful for performing peer to peer synchronization of recently indexed update commands during recovery process.
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Constructor Detail

      • PeerSync

        public PeerSync​(SolrCore core,
                        List<String> replicas,
                        int nUpdates,
                        boolean cantReachIsSuccess)
      • PeerSync

        public PeerSync​(SolrCore core,
                        List<String> replicas,
                        int nUpdates,
                        boolean cantReachIsSuccess,
                        boolean onlyIfActive,
                        boolean doFingerprint)
    • Method Detail

      • initializeMetrics

        public void initializeMetrics​(SolrMetricManager manager,
                                      String registry,
                                      String tag,
                                      String scope)
        Description copied from interface: SolrMetricProducer
        Initializes metrics specific to this producer
        Specified by:
        initializeMetrics in interface SolrMetricProducer
        Parameters:
        manager - an instance of SolrMetricManager
        registry - registry name where metrics are registered
        tag - a symbolic tag that represents this instance of the producer, or a group of related instances that have the same life-cycle. This tag is used when managing life-cycle of some metrics.
        scope - scope of the metrics (eg. handler name) to separate metrics of components with the same implementation but different scope.
      • percentile

        public static long percentile​(List<Long> arr,
                                      float frac)
      • sync

        public PeerSync.PeerSyncResult sync()
        Returns true if peer sync was successful, meaning that this core may be considered to have the latest updates. It does not mean that the remote replica is in sync with us.