Search in sources :

Example 1 with ContentTracker

use of org.alfresco.solr.tracker.ContentTracker in project SearchServices by Alfresco.

the class SolrCoreLoadRegistration method createTrackers.

/**
 * Creates the trackers
 *
 * @param coreName
 * @param trackerRegistry
 * @param props
 * @param scheduler
 * @param repositoryClient
 * @param srv
 * @return A list of trackers
 */
private static List<Tracker> createTrackers(String coreName, TrackerRegistry trackerRegistry, Properties props, SolrTrackerScheduler scheduler, SOLRAPIClient repositoryClient, SolrInformationServer srv) {
    List<Tracker> trackers = new ArrayList<Tracker>();
    AclTracker aclTracker = new AclTracker(props, repositoryClient, coreName, srv);
    trackerRegistry.register(coreName, aclTracker);
    scheduler.schedule(aclTracker, coreName, props);
    ContentTracker contentTrkr = new ContentTracker(props, repositoryClient, coreName, srv);
    trackerRegistry.register(coreName, contentTrkr);
    scheduler.schedule(contentTrkr, coreName, props);
    MetadataTracker metaTrkr = new MetadataTracker(props, repositoryClient, coreName, srv);
    trackerRegistry.register(coreName, metaTrkr);
    scheduler.schedule(metaTrkr, coreName, props);
    CascadeTracker cascadeTrkr = new CascadeTracker(props, repositoryClient, coreName, srv);
    trackerRegistry.register(coreName, cascadeTrkr);
    scheduler.schedule(cascadeTrkr, coreName, props);
    // The CommitTracker will acquire these locks in order
    // The ContentTracker will likely have the longest runs so put it first to ensure the MetadataTracker is not paused while
    // waiting for the ContentTracker to release it's lock.
    // The aclTracker will likely have the shortest runs so put it last.
    trackers.add(cascadeTrkr);
    trackers.add(contentTrkr);
    trackers.add(metaTrkr);
    trackers.add(aclTracker);
    return trackers;
}
Also used : ContentTracker(org.alfresco.solr.tracker.ContentTracker) Tracker(org.alfresco.solr.tracker.Tracker) MetadataTracker(org.alfresco.solr.tracker.MetadataTracker) CommitTracker(org.alfresco.solr.tracker.CommitTracker) CascadeTracker(org.alfresco.solr.tracker.CascadeTracker) AclTracker(org.alfresco.solr.tracker.AclTracker) ModelTracker(org.alfresco.solr.tracker.ModelTracker) ArrayList(java.util.ArrayList) AclTracker(org.alfresco.solr.tracker.AclTracker) ContentTracker(org.alfresco.solr.tracker.ContentTracker) CascadeTracker(org.alfresco.solr.tracker.CascadeTracker) MetadataTracker(org.alfresco.solr.tracker.MetadataTracker)

Aggregations

ArrayList (java.util.ArrayList)1 AclTracker (org.alfresco.solr.tracker.AclTracker)1 CascadeTracker (org.alfresco.solr.tracker.CascadeTracker)1 CommitTracker (org.alfresco.solr.tracker.CommitTracker)1 ContentTracker (org.alfresco.solr.tracker.ContentTracker)1 MetadataTracker (org.alfresco.solr.tracker.MetadataTracker)1 ModelTracker (org.alfresco.solr.tracker.ModelTracker)1 Tracker (org.alfresco.solr.tracker.Tracker)1