Class ShardStatePublisher

  • All Implemented Interfaces:
    Tracker

    public class ShardStatePublisher
    extends AbstractTracker
    Despite belonging to the Tracker ecosystem, this component is actually a publisher, which periodically informs Alfresco about the state of the hosting core. This has been introduced in SEARCH-1752 for splitting the dual responsibility of the MetadataTracker. As consequence of that, this class contains only the members needed for obtaining a valid ShardState that can be periodically communicated to Alfresco.
    Since:
    1.5
    Author:
    Andrea Gazzarini
    See Also:
    SEARCH-1752
    • Constructor Detail

      • ShardStatePublisher

        public ShardStatePublisher​(boolean isMaster,
                                   java.util.Properties p,
                                   org.alfresco.solr.client.SOLRAPIClient client,
                                   java.lang.String coreName,
                                   InformationServer informationServer)
    • Method Detail

      • doTrack

        protected void doTrack​(java.lang.String iterationId)
        Description copied from class: AbstractTracker
        Subclasses must implement behaviour that completes the following steps, in order:
        1. Purge
        2. Reindex
        3. Index
        4. Track repository
        Specified by:
        doTrack in class AbstractTracker
        Parameters:
        iterationId - an identifier which is uniquely associated with a given iteration.
      • maintenance

        public void maintenance()
      • hasMaintenance

        public boolean hasMaintenance()
      • getTrackerState

        public org.alfresco.solr.TrackerState getTrackerState()
        When running in a slave mode, we need to recreate the tracker state every time. This because in that context we don't have any tracker updating the state (e.g. lastIndexedChangeSetCommitTime, lastIndexedChangeSetId)
        Specified by:
        getTrackerState in interface Tracker
        Overrides:
        getTrackerState in class AbstractTracker
        Returns:
        a new, fresh and up to date instance of TrackerState.
      • getWriteLock

        public java.util.concurrent.Semaphore getWriteLock()
        Description copied from class: AbstractTracker
        Trackers implementing this method should decide if the Write Lock is applied globally for every Tracker Thread (static) or locally for each running Thread
        Specified by:
        getWriteLock in interface Tracker
        Specified by:
        getWriteLock in class AbstractTracker
      • getRunLock

        public java.util.concurrent.Semaphore getRunLock()
        Description copied from class: AbstractTracker
        Trackers implementing this method should decide if the Run Lock is applied globally for every Tracker Thread (static) or locally for each running Thread
        Specified by:
        getRunLock in class AbstractTracker
      • isOnMasterOrStandalone

        public boolean isOnMasterOrStandalone()
        Returns true if the hosting core is master or standalone.
        Returns:
        true if the hosting core is master or standalone.