Package org.alfresco.solr.tracker
Class AclTracker
java.lang.Object
org.alfresco.solr.tracker.AbstractTracker
org.alfresco.solr.tracker.ActivatableTracker
org.alfresco.solr.tracker.AclTracker
- All Implemented Interfaces:
Tracker
Multithreaded ACL
Tracker implementation.- Author:
- Matt Ward
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.solr.tracker.Tracker
Tracker.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longprotected static final org.slf4j.LoggerFields inherited from class org.alfresco.solr.tracker.ActivatableTracker
isEnabledFields inherited from class org.alfresco.solr.tracker.AbstractTracker
client, coreName, props, rollback, rollbackCausedBy, shardCount, shardInstance, shardKey, shardProperty, state, trackerId, transformContent, type -
Constructor Summary
ConstructorsConstructorDescriptionAclTracker(Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAclChangeSetToIndex(Long aclChangeSetToIndex) voidaddAclChangeSetToPurge(Long aclChangeSetToPurge) voidaddAclChangeSetToReindex(Long aclChangeSetToReindex) voidaddAclToIndex(Long aclToIndex) voidaddAclToPurge(Long aclToPurge) voidaddAclToReindex(Long aclToReindex) org.alfresco.solr.AclReportorg.alfresco.solr.tracker.IndexHealthReportcheckIndex(Long toAclTx, Long fromTime, Long toTime) protected voidcheckRepoAndIndexConsistency(org.alfresco.solr.TrackerState state) Checks the first and last TX timeprotected voidCleans up the scheduled maintenance work collected by this tracker.protected voidSubclasses must implement behaviour that completes the following steps, in order: Purge Reindex Index Track repositorygetAclsForDbAclTransaction(Long acltxid) protected LonggetChangeSetFromCommitTime(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound, long lastGoodChangeSetCommitTimeInIndex) Trackers implementing this method should decide if the Run Lock is applied globally for every Tracker Thread (static) or locally for each running Threadprotected org.alfresco.solr.client.AclChangeSetsgetSomeAclChangeSets(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound, Long fromCommitTime, long timeStep, int maxResults, long endTime) Trackers implementing this method should decide if the Write Lock is applied globally for every Tracker Thread (static) or locally for each running Threadbooleanprotected voidprotected voidprotected voidvoidvoidprotected voidprotected voidprotected voidprotected voidprotected voidEvery ACL Change Set contains a list of ACLs to be indexed.protected voidMethods inherited from class org.alfresco.solr.tracker.ActivatableTracker
disable, enable, isDisabled, isEnabled, logAndClear, trackMethods inherited from class org.alfresco.solr.tracker.AbstractTracker
checkNode, getDocRouter, getProps, getRollback, getRollbackCausedBy, getTrackerState, getType, isAlreadyInShutDownMode, setRollback, setShutdown, shutdown
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
INITIAL_MAX_ACL_CHANGE_SET_ID
protected static final long INITIAL_MAX_ACL_CHANGE_SET_ID- See Also:
-
-
Constructor Details
-
AclTracker
public AclTracker(Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer)
-
-
Method Details
-
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
-
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.- Throws:
Throwable
-
maintenance
- Throws:
Exception
-
hasMaintenance
public boolean hasMaintenance() -
indexAclChangeSets
protected void indexAclChangeSets() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
indexAcls
protected void indexAcls() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
reindexAclChangeSets
protected void reindexAclChangeSets() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
reindexAcls
protected void reindexAcls() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
purgeAclChangeSets
- Throws:
IOExceptionorg.json.JSONException
-
purgeAcls
- Throws:
IOExceptionorg.json.JSONException
-
addAclChangeSetToReindex
-
addAclChangeSetToIndex
-
addAclChangeSetToPurge
-
addAclToReindex
-
addAclToIndex
-
addAclToPurge
-
clearScheduledMaintenanceWork
protected void clearScheduledMaintenanceWork()Description copied from class:ActivatableTrackerCleans up the scheduled maintenance work collected by this tracker.- Overrides:
clearScheduledMaintenanceWorkin classActivatableTracker
-
trackRepository
protected void trackRepository() throws IOException, org.alfresco.httpclient.AuthenticationException, org.json.JSONException- Throws:
IOExceptionorg.alfresco.httpclient.AuthenticationExceptionorg.json.JSONException
-
checkRepoAndIndexConsistency
protected void checkRepoAndIndexConsistency(org.alfresco.solr.TrackerState state) throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException Checks the first and last TX time- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
getChangeSetFromCommitTime
protected Long getChangeSetFromCommitTime(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound, long lastGoodChangeSetCommitTimeInIndex) - Parameters:
changeSetsFound- BoundedDequelastGoodChangeSetCommitTimeInIndex- long- Returns:
- Long
-
getSomeAclChangeSets
protected org.alfresco.solr.client.AclChangeSets getSomeAclChangeSets(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound, Long fromCommitTime, long timeStep, int maxResults, long endTime) throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException - Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
indexAcl
protected void indexAcl(List<org.alfresco.solr.client.AclReaders> aclReaderList, boolean overwrite) throws IOException - Parameters:
aclReaderList- Listoverwrite- boolean- Throws:
IOException
-
checkIndex
public org.alfresco.solr.tracker.IndexHealthReport checkIndex(Long toAclTx, Long fromTime, Long toTime) throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException - Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
getAclsForDbAclTransaction
-
checkAcl
-
trackAclChangeSets
protected void trackAclChangeSets() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONExceptionEvery ACL Change Set contains a list of ACLs to be indexed. This method gets ACL Change Sets from Alfresco Repository to be indexed. The indexing is performed in batches of ACL Change Sets and the Tracker Status is updated in batched of ACLs. Tracker Status contains the Commit Time from the latest ACL Change Set indexed, so new operations can be retrieved from Repository starting with that time.- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
invalidateState
public void invalidateState()- Specified by:
invalidateStatein interfaceTracker- Overrides:
invalidateStatein classAbstractTracker
-