private void setupSearchChainRegistry(ComponentRegistry<Searcher> searchers, ChainsConfig chainsConfig) { ChainsModel chainsModel = ChainsModelBuilder.buildFromConfig(chainsConfig); ChainsConfigurer.prepareChainRegistry(searchChainRegistry, chainsModel, searchers); searchChainRegistry.freeze(); }
public static ChainsModel buildFromConfig(ChainsConfig chainsConfig) { ChainsModel model = createChainsModel(chainsConfig); for (ChainsConfig.Components component : chainsConfig.components()) { ChainedComponentModel componentModel = createChainedComponentModel(component); model.register(componentModel.getComponentId(), componentModel); } return model; }
private static ChainSpecification.Inheritance createInheritance(List<String> inherit, List<String> exclude) { return new ChainSpecification.Inheritance( createComponentSpecifications(inherit), createComponentSpecifications(exclude)); } }
private static ChainSpecification createChainSpecification(ChainsConfig.Chains config) { return new ChainSpecification(new ComponentId(config.id()), createInheritance(config.inherits(), config.excludes()), createPhases(config.phases()), createComponentSpecifications(config.components())); }
private static Collection<Phase> createPhases(List<ChainsConfig.Chains.Phases> phases) { Collection<Phase> result = new ArrayList<>(); for (ChainsConfig.Chains.Phases phase : phases) { result.add( new Phase(phase.id(), createDependencies(null, phase.before(), phase.after()))); } return result; }
private static ChainsModel createChainsModel(ChainsConfig chainsConfig) { ChainsModel model = new ChainsModel(); for (ChainsConfig.Chains chainConfig : chainsConfig.chains()) { model.register( createChainSpecification(chainConfig)); } return model; }
private static ChainedComponentModel createChainedComponentModel(ChainsConfig.Components component) { return new ChainedComponentModel( new BundleInstantiationSpecification(new ComponentSpecification(component.id()), null, null), createDependencies( component.dependencies().provides(), component.dependencies().before(), component.dependencies().after()), null); }
private static <COMPONENT extends ChainedComponent> ChainRegistry<COMPONENT> createChainRegistry( ChainsConfig processingChainsConfig, ComponentRegistry<COMPONENT> availableComponents) { ChainRegistry<COMPONENT> chainRegistry = new ChainRegistry<>(); prepareChainRegistry(chainRegistry, ChainsModelBuilder.buildFromConfig(processingChainsConfig), availableComponents); chainRegistry.freeze(); return chainRegistry; }
private static ChainRegistry<FilterWrapper> buildChainRegistry(ChainsConfig chainsConfig, ComponentRegistry<?>... filters) { ChainRegistry<FilterWrapper> chainRegistry = new ChainRegistry<>(); ChainsModel chainsModel = ChainsModelBuilder.buildFromConfig(chainsConfig); ChainsConfigurer.prepareChainRegistry(chainRegistry, chainsModel, allFiltersWrapped(filters)); removeEmptyChains(chainRegistry); chainRegistry.freeze(); return chainRegistry; }
.setMaxQueueTimeMs(docprocConfig.maxqueuetimems()) .setDocumentTypeManager(new DocumentTypeManager(docManConfig)) .setChainsModel(buildFromConfig(chainsConfig)).setSchemaMap(configureMapping(mappingConfig)) .setStatisticsManager(manager) .setMetric(metric)