Package org.apache.stanbol.commons.solr.impl

Examples of org.apache.stanbol.commons.solr.impl.OsgiSolrResourceLoader


                //TODO: add support for ZooKeeper managed cores
                return super.create(dcore);
            } else {
                File idir = new File(dcore.getInstanceDir());
                String instanceDir = idir.getPath();
                SolrResourceLoader loader = new OsgiSolrResourceLoader(context, instanceDir,
                    CoreContainer.class.getClassLoader());
                SolrConfig config;
                try {
                    config = new SolrConfig(loader, dcore.getConfigName(), null);
                } catch (Exception e) {
                    log.error("Failed to load file {}", new File(instanceDir, dcore.getConfigName()).getAbsolutePath());
                    throw new SolrException(ErrorCode.SERVER_ERROR, "Could not load config for " + dcore.getConfigName(), e);
                }
                IndexSchema schema = null;
                //indexSchemaCache is now protected (Solr 4.4)
                if (indexSchemaCache != null) {
                  final String resourceNameToBeUsed = IndexSchemaFactory.getResourceNameToBeUsed(dcore.getSchemaName(), config);
                  File schemaFile = new File(resourceNameToBeUsed);
                  if (!schemaFile.isAbsolute()) {
                    schemaFile = new File(loader.getConfigDir(), schemaFile.getPath());
                  }
                  if (schemaFile.exists()) {
                    String key = schemaFile.getAbsolutePath()
                        + ":"
                        + new SimpleDateFormat("yyyyMMddHHmmss", Locale.ROOT).format(new Date(
View Full Code Here


        File solrCof = new File(solrDir,parsedServerProperties.getSolrXml());
        ClassLoader classLoader = updateContextClassLoader();
        CoreContainer container;
        try {
            log.info("   ... create OSGI enabled SolrCore (conf: {}",solrCof);
            SolrResourceLoader loader = new OsgiSolrResourceLoader(context, solrDir.getAbsolutePath(),
                SolrServerAdapter.class.getClassLoader());
            container = new OsgiCoreContainer(loader, context,solrCof);
        } finally {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.commons.solr.impl.OsgiSolrResourceLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.