Package org.alfresco.solr.tracker
Class AbstractTracker
- java.lang.Object
-
- org.alfresco.solr.tracker.AbstractTracker
-
- All Implemented Interfaces:
Tracker
- Direct Known Subclasses:
AclTracker,CascadeTracker,CommitTracker,ContentTracker,MetadataTracker,ModelTracker
public abstract class AbstractTracker extends Object implements Tracker
Abstract base class that provides commonTrackerbehaviour.- Author:
- Matt Ward
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.solr.tracker.Tracker
Tracker.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected StringalfrescoVersionprotected longbatchCountprotected org.alfresco.solr.client.SOLRAPIClientclientprotected StringcoreNameprotected InformationServerinfoSrvprotected booleanisMasterprotected booleanisSlaveprotected static org.slf4j.Loggerlogprotected Propertiespropsprotected booleanrollbackprotected booleanrunPostModelLoadInitstatic StringSHARD_METHOD_ACLIDstatic StringSHARD_METHOD_DBIDprotected intshardCountprotected intshardInstanceprotected StringshardMethodprotected StringshardTemplateprotected org.alfresco.solr.TrackerStatestateprotected org.alfresco.service.cmr.repository.StoreRefstoreRefprotected ThreadHandlerthreadHandlerstatic longTIME_STEP_1_HR_IN_MSstatic longTIME_STEP_32_DAYS_IN_MSprotected org.alfresco.solr.tracker.TrackerStatstrackerStatsprotected booleantransformContentprotected Tracker.Typetype
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTracker(Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer, Tracker.Type type)protectedAbstractTracker(Tracker.Type type)Default constructor, strictly for testing.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckShutdown()protected abstract voiddoTrack()Subclasses must implement behaviour that completes the following steps, in order: Purge Reindex Index Track repositoryStringgetAlfrescoVersion()intgetMaxLiveSearchers()PropertiesgetProps()booleangetRollback()SemaphoregetRunLock()org.alfresco.solr.TrackerStategetTrackerState()Tracker.TypegetType()SemaphoregetWriteLock()voidinvalidateState()voidsetRollback(boolean rollback)voidsetShutdown(boolean shutdown)voidshutdown()voidtrack()protected voidwaitForAsynchronous()Allows time for the scheduled asynchronous tasks to complete-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.solr.tracker.Tracker
hasMaintenance, maintenance
-
-
-
-
Field Detail
-
TIME_STEP_32_DAYS_IN_MS
public static final long TIME_STEP_32_DAYS_IN_MS
- See Also:
- Constant Field Values
-
TIME_STEP_1_HR_IN_MS
public static final long TIME_STEP_1_HR_IN_MS
- See Also:
- Constant Field Values
-
SHARD_METHOD_ACLID
public static final String SHARD_METHOD_ACLID
- See Also:
- Constant Field Values
-
SHARD_METHOD_DBID
public static final String SHARD_METHOD_DBID
- See Also:
- Constant Field Values
-
log
protected static final org.slf4j.Logger log
-
props
protected Properties props
-
client
protected org.alfresco.solr.client.SOLRAPIClient client
-
infoSrv
protected InformationServer infoSrv
-
coreName
protected String coreName
-
storeRef
protected org.alfresco.service.cmr.repository.StoreRef storeRef
-
batchCount
protected long batchCount
-
isSlave
protected boolean isSlave
-
isMaster
protected boolean isMaster
-
alfrescoVersion
protected String alfrescoVersion
-
trackerStats
protected org.alfresco.solr.tracker.TrackerStats trackerStats
-
runPostModelLoadInit
protected boolean runPostModelLoadInit
-
state
protected volatile org.alfresco.solr.TrackerState state
-
shardCount
protected int shardCount
-
shardInstance
protected int shardInstance
-
shardMethod
protected String shardMethod
-
transformContent
protected boolean transformContent
-
shardTemplate
protected String shardTemplate
-
rollback
protected volatile boolean rollback
-
type
protected final Tracker.Type type
-
threadHandler
protected ThreadHandler threadHandler
-
-
Constructor Detail
-
AbstractTracker
protected AbstractTracker(Tracker.Type type)
Default constructor, strictly for testing.
-
AbstractTracker
protected AbstractTracker(Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer, Tracker.Type type)
-
-
Method Detail
-
doTrack
protected abstract void doTrack() throws ThrowableSubclasses must implement behaviour that completes the following steps, in order:- Purge
- Reindex
- Index
- Track repository
- Throws:
Throwable
-
track
public void track()
-
getRollback
public boolean getRollback()
- Specified by:
getRollbackin interfaceTracker
-
setRollback
public void setRollback(boolean rollback)
- Specified by:
setRollbackin interfaceTracker
-
invalidateState
public void invalidateState()
- Specified by:
invalidateStatein interfaceTracker
-
getTrackerState
public org.alfresco.solr.TrackerState getTrackerState()
- Specified by:
getTrackerStatein interfaceTracker
-
waitForAsynchronous
protected void waitForAsynchronous()
Allows time for the scheduled asynchronous tasks to complete
-
getMaxLiveSearchers
public int getMaxLiveSearchers()
-
checkShutdown
protected void checkShutdown()
-
setShutdown
public void setShutdown(boolean shutdown)
- Specified by:
setShutdownin interfaceTracker
-
getWriteLock
public Semaphore getWriteLock()
- Specified by:
getWriteLockin interfaceTracker
-
getRunLock
public Semaphore getRunLock()
-
getAlfrescoVersion
public String getAlfrescoVersion()
- Specified by:
getAlfrescoVersionin interfaceTracker- Returns:
- Alfresco version Solr was built for
-
getProps
public Properties getProps()
-
getType
public Tracker.Type getType()
-
-