Package org.alfresco.solr.tracker
Class AbstractTracker
java.lang.Object
org.alfresco.solr.tracker.AbstractTracker
- All Implemented Interfaces:
Tracker
- Direct Known Subclasses:
ActivatableTracker,CommitTracker,ModelTracker,ShardStatePublisher
Abstract base class that provides common
Tracker behaviour.- Author:
- Matt Ward
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.solr.tracker.Tracker
Tracker.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.alfresco.solr.client.SOLRAPIClientprotected Stringprotected Propertiesprotected booleanprotected ThrowableWhen rollback is set, original error is also gathered in order to provide detailed logging.protected intprotected intThe string representation of the shard key.protected Optional<org.alfresco.service.namespace.QName>The property to use for determining the shard.protected org.alfresco.solr.TrackerStateprotected final Stringprotected booleanprotected final Tracker.Type -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTracker(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
Modifier and TypeMethodDescriptionorg.alfresco.solr.NodeReportReturns information about theNodeassociated with the given dbid.protected abstract voidSubclasses must implement behaviour that completes the following steps, in order: Purge Reindex Index Track repositoryReturns theDocRouterinstance in use on this node.getProps()booleanabstract SemaphoreTrackers 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.TrackerStategetType()abstract SemaphoreTrackers implementing this method should decide if the Write Lock is applied globally for every Tracker Thread (static) or locally for each running ThreadvoidbooleanvoidsetRollback(boolean rollback, Throwable rollbackCausedBy) voidsetShutdown(boolean shutdown) voidshutdown()voidtrack()Template method - subclasses must implement theTracker-specific indexing by implementing the abstract methoddoTrack(String).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.solr.tracker.Tracker
hasMaintenance, maintenance
-
Field Details
-
props
-
client
protected org.alfresco.solr.client.SOLRAPIClient client -
coreName
-
state
protected volatile org.alfresco.solr.TrackerState state -
shardCount
protected int shardCount -
shardInstance
protected int shardInstance -
transformContent
protected boolean transformContent -
rollback
protected volatile boolean rollback -
rollbackCausedBy
When rollback is set, original error is also gathered in order to provide detailed logging. -
type
-
trackerId
-
shardProperty
The property to use for determining the shard. Note that this property is not used by all trackers, it is actually managed by theShardStatePublisherandMetadataTracker. We put this property here because otherwise we should introduce another supertype layer for those two trackers. -
shardKey
The string representation of the shard key. Note that this property is not used by all trackers, it is actually managed by theShardStatePublisherandMetadataTracker. We put this property here because otherwise we should introduce another supertype layer for those two trackers.
-
-
Constructor Details
-
AbstractTracker
Default constructor, strictly for testing. -
AbstractTracker
protected AbstractTracker(Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer, Tracker.Type type)
-
-
Method Details
-
doTrack
Subclasses must implement behaviour that completes the following steps, in order:- Purge
- Reindex
- Index
- Track repository
- Parameters:
iterationId- an identifier which is uniquely associated with a given iteration.- Throws:
Throwable
-
track
public void track()Template method - subclasses must implement theTracker-specific indexing by implementing the abstract methoddoTrack(String). -
getRollback
public boolean getRollback()- Specified by:
getRollbackin interfaceTracker
-
getRollbackCausedBy
- Specified by:
getRollbackCausedByin interfaceTracker
-
setRollback
- Specified by:
setRollbackin interfaceTracker
-
invalidateState
public void invalidateState()- Specified by:
invalidateStatein interfaceTracker
-
getTrackerState
public org.alfresco.solr.TrackerState getTrackerState()- Specified by:
getTrackerStatein interfaceTracker
-
isAlreadyInShutDownMode
public boolean isAlreadyInShutDownMode()- Specified by:
isAlreadyInShutDownModein interfaceTracker
-
setShutdown
public void setShutdown(boolean shutdown) - Specified by:
setShutdownin interfaceTracker
-
shutdown
public void shutdown() -
getWriteLock
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:
getWriteLockin interfaceTracker
-
getRunLock
Trackers implementing this method should decide if the Run Lock is applied globally for every Tracker Thread (static) or locally for each running Thread -
getProps
-
getType
-
checkNode
Returns information about theNodeassociated with the given dbid.- Parameters:
dbid- the node identifier.- Returns:
- the
Nodeassociated with the given dbid.
-
getDocRouter
Returns theDocRouterinstance in use on this node.- Returns:
- the
DocRouterinstance in use on this node.
-