@Test public void coreTrackersRegistrationAndScheduling() { List<Tracker> coreTrackers = listener.createAndScheduleCoreTrackers(core, registry, coreProperties, scheduler, api, informationServer); verify(registry).register(eq(coreName), any(AclTracker.class)); verify(registry).register(eq(coreName), any(ContentTracker.class)); verify(registry).register(eq(coreName), any(MetadataTracker.class)); verify(registry).register(eq(coreName), any(CascadeTracker.class)); verify(scheduler).schedule(any(AclTracker.class), eq(coreName), same(coreProperties)); verify(scheduler).schedule(any(ContentTracker.class), eq(coreName), same(coreProperties)); verify(scheduler).schedule(any(MetadataTracker.class), eq(coreName), same(coreProperties)); verify(scheduler).schedule(any(CascadeTracker.class), eq(coreName), same(coreProperties)); Set<Type> trackerTypes = coreTrackers.stream().map(Tracker::getType).collect(Collectors.toSet()); assertEquals("Unexpected trackers found.", Set.of(ACL, CONTENT, METADATA, NODE_STATE_PUBLISHER, CASCADE), trackerTypes); }
List<Tracker> createAndScheduleCoreTrackers(SolrCore core, TrackerRegistry trackerRegistry, Properties props, SolrTrackerScheduler scheduler, SOLRAPIClient repositoryClient, SolrInformationServer srv) { AclTracker aclTracker = registerAndSchedule( new AclTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); ContentTracker contentTracker = registerAndSchedule( new ContentTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); MetadataTracker metadataTracker = registerAndSchedule( new MetadataTracker(props, repositoryClient, core.getName(), srv, true), core, props, trackerRegistry, scheduler); ShardStatePublisher coreStateTracker = registerAndSchedule( new ShardStatePublisher(true, props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler ); List<Tracker> trackers = new ArrayList<>(); String cascadeTrackerEnabledProp = ofNullable((String) props.get(CASCADE_TRACKER_ENABLED)).orElse("true"); if (Boolean.valueOf(cascadeTrackerEnabledProp)) { CascadeTracker cascadeTracker = registerAndSchedule( new CascadeTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); trackers.add(cascadeTracker); } trackers.addAll(asList(contentTracker, metadataTracker, aclTracker, coreStateTracker)); return trackers; }
SolrCoreLoadListener extends AbstractSolrEventListener { List<Tracker> createAndScheduleCoreTrackers(SolrCore core, TrackerRegistry trackerRegistry, Properties props, SolrTrackerScheduler scheduler, SOLRAPIClient repositoryClient, SolrInformationServer srv) { AclTracker aclTracker = registerAndSchedule( new AclTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); ContentTracker contentTracker = registerAndSchedule( new ContentTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); MetadataTracker metadataTracker = registerAndSchedule( new MetadataTracker(props, repositoryClient, core.getName(), srv, true), core, props, trackerRegistry, scheduler); ShardStatePublisher coreStateTracker = registerAndSchedule( new ShardStatePublisher(true, props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler ); List<Tracker> trackers = new ArrayList<>(); String cascadeTrackerEnabledProp = ofNullable((String) props.get(CASCADE_TRACKER_ENABLED)).orElse("true"); if (Boolean.valueOf(cascadeTrackerEnabledProp)) { CascadeTracker cascadeTracker = registerAndSchedule( new CascadeTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); trackers.add(cascadeTracker); } trackers.addAll(asList(contentTracker, metadataTracker, aclTracker, coreStateTracker)); return trackers; } }
SolrCoreLoadListener extends AbstractSolrEventListener { List<Tracker> createAndScheduleCoreTrackers(SolrCore core, TrackerRegistry trackerRegistry, Properties props, SolrTrackerScheduler scheduler, SOLRAPIClient repositoryClient, SolrInformationServer srv) { AclTracker aclTracker = registerAndSchedule( new AclTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); ContentTracker contentTracker = registerAndSchedule( new ContentTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); MetadataTracker metadataTracker = registerAndSchedule( new MetadataTracker(props, repositoryClient, core.getName(), srv, true), core, props, trackerRegistry, scheduler); ShardStatePublisher coreStateTracker = registerAndSchedule( new ShardStatePublisher(true, props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler ); List<Tracker> trackers = new ArrayList<>(); String cascadeTrackerEnabledProp = ofNullable((String) props.get(CASCADE_TRACKER_ENABLED)).orElse("true"); if (Boolean.valueOf(cascadeTrackerEnabledProp)) { CascadeTracker cascadeTracker = registerAndSchedule( new CascadeTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); trackers.add(cascadeTracker); } trackers.addAll(asList(contentTracker, metadataTracker, aclTracker, coreStateTracker)); return trackers; } SolrCoreLoadListener(SolrCore core); }
SolrCoreLoadListener extends AbstractSolrEventListener { List<Tracker> createAndScheduleCoreTrackers(SolrCore core, TrackerRegistry trackerRegistry, Properties props, SolrTrackerScheduler scheduler, SOLRAPIClient repositoryClient, SolrInformationServer srv) { AclTracker aclTracker = registerAndSchedule( new AclTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); ContentTracker contentTracker = registerAndSchedule( new ContentTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); MetadataTracker metadataTracker = registerAndSchedule( new MetadataTracker(props, repositoryClient, core.getName(), srv, true), core, props, trackerRegistry, scheduler); ShardStatePublisher coreStateTracker = registerAndSchedule( new ShardStatePublisher(true, props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler ); List<Tracker> trackers = new ArrayList<>(); String cascadeTrackerEnabledProp = ofNullable((String) props.get(CASCADE_TRACKER_ENABLED)).orElse("true"); if (Boolean.valueOf(cascadeTrackerEnabledProp)) { CascadeTracker cascadeTracker = registerAndSchedule( new CascadeTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); trackers.add(cascadeTracker); } trackers.addAll(asList(contentTracker, metadataTracker, aclTracker, coreStateTracker)); return trackers; } SolrCoreLoadListener(SolrCore core); @Override void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher); }
SolrCoreLoadListener extends AbstractSolrEventListener { List<Tracker> createAndScheduleCoreTrackers(SolrCore core, TrackerRegistry trackerRegistry, Properties props, SolrTrackerScheduler scheduler, SOLRAPIClient repositoryClient, SolrInformationServer srv) { AclTracker aclTracker = registerAndSchedule( new AclTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); ContentTracker contentTracker = registerAndSchedule( new ContentTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); MetadataTracker metadataTracker = registerAndSchedule( new MetadataTracker(props, repositoryClient, core.getName(), srv, true), core, props, trackerRegistry, scheduler); ShardStatePublisher coreStateTracker = registerAndSchedule( new ShardStatePublisher(true, props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler ); List<Tracker> trackers = new ArrayList<>(); String cascadeTrackerEnabledProp = ofNullable((String) props.get(CASCADE_TRACKER_ENABLED)).orElse("true"); if (Boolean.valueOf(cascadeTrackerEnabledProp)) { CascadeTracker cascadeTracker = registerAndSchedule( new CascadeTracker(props, repositoryClient, core.getName(), srv), core, props, trackerRegistry, scheduler); trackers.add(cascadeTracker); } trackers.addAll(asList(contentTracker, metadataTracker, aclTracker, coreStateTracker)); return trackers; } SolrCoreLoadListener(SolrCore core); @Override void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher);  }