Class PeerSync

java.lang.Object
org.apache.solr.update.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.
  • Field Details

  • Constructor Details

    • 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 Details

    • getSolrMetricsContext

      public SolrMetricsContext getSolrMetricsContext()
      Description copied from interface: SolrMetricProducer
      Implementations should return the context used in SolrMetricProducer.initializeMetrics(SolrMetricsContext, Attributes) to ensure proper cleanup of metrics at the end of the life-cycle of this component. This should be the child context if one was created, or null if the parent context was used.
      Specified by:
      getSolrMetricsContext in interface SolrMetricProducer
    • initializeMetrics

      public void initializeMetrics(SolrMetricsContext parentContext, io.opentelemetry.api.common.Attributes attributes)
      Description copied from interface: SolrMetricProducer
      Implementation should initialize all metrics to a SolrMetricsContext Registry/MeterProvider with Attributes as the common set of attributes that will be attached to every metric that is initialized for that class/component
      Specified by:
      initializeMetrics in interface SolrMetricProducer
      Parameters:
      parentContext - The registry that the component will initialize metrics to
      attributes - Base set of attributes that will be bound to all metrics for that component
    • 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.