Package org.alfresco.solr.tracker
Class ShardStatePublisher
java.lang.Object
org.alfresco.solr.tracker.AbstractTracker
org.alfresco.solr.tracker.ShardStatePublisher
- All Implemented Interfaces:
Tracker
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.solr.tracker.Tracker
Tracker.Type -
Field Summary
Fields inherited from class org.alfresco.solr.tracker.AbstractTracker
client, coreName, props, rollback, rollbackCausedBy, shardCount, shardInstance, shardKey, shardProperty, state, trackerId, transformContent, type -
Constructor Summary
ConstructorsConstructorDescriptionShardStatePublisher(boolean isMaster, Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSubclasses must implement behaviour that completes the following steps, in order: Purge Reindex Index Track repositoryTrackers implementing this method should decide if the Run Lock is applied globally for every Tracker Thread (static) or locally for each running Threadorg.alfresco.solr.TrackerStateWhen running in a slave mode, we need to recreate the tracker state every time.Trackers implementing this method should decide if the Write Lock is applied globally for every Tracker Thread (static) or locally for each running ThreadbooleanbooleanReturns true if the hosting core is master or standalone.voidMethods inherited from class org.alfresco.solr.tracker.AbstractTracker
checkNode, getDocRouter, getProps, getRollback, getRollbackCausedBy, getType, invalidateState, isAlreadyInShutDownMode, setRollback, setShutdown, shutdown, track
-
Constructor Details
-
ShardStatePublisher
public ShardStatePublisher(boolean isMaster, Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer)
-
-
Method Details
-
doTrack
Description copied from class:AbstractTrackerSubclasses must implement behaviour that completes the following steps, in order:- Purge
- Reindex
- Index
- Track repository
- Specified by:
doTrackin classAbstractTracker- 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:
getTrackerStatein interfaceTracker- Overrides:
getTrackerStatein classAbstractTracker- Returns:
- a new, fresh and up to date instance of
TrackerState.
-
getWriteLock
Description copied from class:AbstractTrackerTrackers 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:
getWriteLockin interfaceTracker- Specified by:
getWriteLockin classAbstractTracker
-
getRunLock
Description copied from class:AbstractTrackerTrackers 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:
getRunLockin classAbstractTracker
-
isOnMasterOrStandalone
public boolean isOnMasterOrStandalone()Returns true if the hosting core is master or standalone.- Returns:
- true if the hosting core is master or standalone.
-