Class ShardStatePublisher

java.lang.Object
org.alfresco.solr.tracker.AbstractTracker
org.alfresco.solr.tracker.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:
  • Constructor Details

    • ShardStatePublisher

      public ShardStatePublisher(boolean isMaster, Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer)
  • Method Details

    • doTrack

      protected void doTrack(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 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 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.