Package org.apache.solr.update
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PeerSync.MissedUpdatesFinder
Helper class for doing comparison ourUpdates and other replicas's updates to find the updates that we missedstatic class
PeerSync.MissedUpdatesRequest
Result ofPeerSync.MissedUpdatesFinder
static class
PeerSync.PeerSyncResult
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Long>
absComparator
static String
METRIC_SCOPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SolrMetricsContext
getSolrMetricsContext()
Implementations should return the context used inSolrMetricProducer.initializeMetrics(SolrMetricsContext, String)
to ensure proper cleanup of metrics at the end of the life-cycle of this component.void
initializeMetrics(SolrMetricsContext parentContext, String scope)
Initialize metrics specific to this producer.static long
percentile(List<Long> arr, float frac)
PeerSync.PeerSyncResult
sync()
Returns true if peer sync was successful, meaning that this core may be considered to have the latest updates.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
absComparator
public static Comparator<Long> absComparator
-
METRIC_SCOPE
public static final String METRIC_SCOPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSolrMetricsContext
public SolrMetricsContext getSolrMetricsContext()
Description copied from interface:SolrMetricProducer
Implementations should return the context used inSolrMetricProducer.initializeMetrics(SolrMetricsContext, String)
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 interfaceSolrMetricProducer
-
initializeMetrics
public void initializeMetrics(SolrMetricsContext parentContext, String scope)
Description copied from interface:SolrMetricProducer
Initialize metrics specific to this producer.- Specified by:
initializeMetrics
in interfaceSolrMetricProducer
- Parameters:
parentContext
- parent metrics context. If this component has the same life-cycle as the parent it can simply use the parent context, otherwise it should obtain a child context usingSolrMetricsContext.getChildContext(Object)
passingthis
as the child object.scope
- component scope
-
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.
-
-