org.apache.solr.core
Class ConfigSolrXml

java.lang.Object
  extended by org.apache.solr.core.Config
      extended by org.apache.solr.core.ConfigSolrXml
All Implemented Interfaces:
ConfigSolr

public class ConfigSolrXml
extends Config
implements ConfigSolr

ConfigSolrXml

This class is entirely to localize the dealing with specific issues when transitioning from old-style solr.xml to new-style xml, enumeration/discovery of defined cores. See SOLR-4196 for background.

Since:
solr 4.3 It's a bit twisted, but we decided to NOT do the solr.properties switch. But since there's already an interface it makes sense to leave it in so we can use other methods of providing the Solr information that is contained in solr.xml. Perhaps something form SolrCloud in the future?

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.solr.core.ConfigSolr
ConfigSolr.CfgProp
 
Field Summary
 
Fields inherited from class org.apache.solr.core.Config
log
 
Fields inherited from interface org.apache.solr.core.ConfigSolr
CORE_PROP_FILE, SOLR_XML_FILE
 
Constructor Summary
ConfigSolrXml(SolrResourceLoader loader, Config cfg, CoreContainer container)
           
ConfigSolrXml(SolrResourceLoader loader, String name, InputStream is, String prefix, boolean subProps, CoreContainer container)
           
 
Method Summary
 void addPersistAllCores(Properties containerProperties, Map<String,String> rootSolrAttribs, Map<String,String> coresAttribs, File file)
           
 void addPersistCore(String coreName, Properties attribs, Map<String,String> props)
           
static Document copyDoc(Document doc)
           
 String get(ConfigSolr.CfgProp prop, String def)
           
 List<String> getAllCoreNames()
           
 String getBadConfigCoreMessage(String name)
           
 boolean getBool(ConfigSolr.CfgProp prop, boolean defValue)
           
 String getCoreNameFromOrig(String origCoreName, SolrResourceLoader loader, String coreName)
           
 int getInt(ConfigSolr.CfgProp prop, int def)
           
 String getOrigProp(ConfigSolr.CfgProp prop, String def)
           
 String getProperty(String coreName, String property, String defaultVal)
           
 IndexSchema getSchemaFromZk(ZkController zkController, String zkConfigName, String schemaName, SolrConfig config)
           
 SolrConfig getSolrConfigFromZk(ZkController zkController, String zkConfigName, String solrConfigFileName, SolrResourceLoader resourceLoader)
           
 Properties getSolrProperties(String path)
           
 void initPersist()
           
static void initPersistStatic()
           
 ShardHandlerFactory initShardHandler()
           
 boolean is50OrLater()
           
 Map<String,String> readCoreAttributes(String coreName)
           
 Properties readCoreProperties(String coreName)
           
 
Methods inherited from class org.apache.solr.core.Config
complainAboutUnknownAttributes, evaluate, get, get, getBool, getBool, getDocument, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLuceneVersion, getLuceneVersion, getName, getNode, getNodeList, getResourceLoader, getResourceName, getUnknownAttributes, getVal, getXPath, parseLuceneVersionString, substituteProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.solr.core.ConfigSolr
substituteProperties
 

Constructor Detail

ConfigSolrXml

public ConfigSolrXml(SolrResourceLoader loader,
                     String name,
                     InputStream is,
                     String prefix,
                     boolean subProps,
                     CoreContainer container)
              throws ParserConfigurationException,
                     IOException,
                     SAXException
Throws:
ParserConfigurationException
IOException
SAXException

ConfigSolrXml

public ConfigSolrXml(SolrResourceLoader loader,
                     Config cfg,
                     CoreContainer container)
              throws TransformerException,
                     IOException
Throws:
TransformerException
IOException
Method Detail

getBadConfigCoreMessage

public String getBadConfigCoreMessage(String name)
Specified by:
getBadConfigCoreMessage in interface ConfigSolr

copyDoc

public static Document copyDoc(Document doc)
                        throws TransformerException
Throws:
TransformerException

getInt

public int getInt(ConfigSolr.CfgProp prop,
                  int def)
Specified by:
getInt in interface ConfigSolr

getBool

public boolean getBool(ConfigSolr.CfgProp prop,
                       boolean defValue)
Specified by:
getBool in interface ConfigSolr

get

public String get(ConfigSolr.CfgProp prop,
                  String def)
Specified by:
get in interface ConfigSolr

getOrigProp

public String getOrigProp(ConfigSolr.CfgProp prop,
                          String def)
Specified by:
getOrigProp in interface ConfigSolr

initShardHandler

public ShardHandlerFactory initShardHandler()
Specified by:
initShardHandler in interface ConfigSolr

getSolrProperties

public Properties getSolrProperties(String path)
Specified by:
getSolrProperties in interface ConfigSolr

readCoreAttributes

public Map<String,String> readCoreAttributes(String coreName)
Specified by:
readCoreAttributes in interface ConfigSolr

getSchemaFromZk

public IndexSchema getSchemaFromZk(ZkController zkController,
                                   String zkConfigName,
                                   String schemaName,
                                   SolrConfig config)
                            throws org.apache.zookeeper.KeeperException,
                                   InterruptedException
Throws:
org.apache.zookeeper.KeeperException
InterruptedException

getSolrConfigFromZk

public SolrConfig getSolrConfigFromZk(ZkController zkController,
                                      String zkConfigName,
                                      String solrConfigFileName,
                                      SolrResourceLoader resourceLoader)
Specified by:
getSolrConfigFromZk in interface ConfigSolr

initPersist

public void initPersist()
Specified by:
initPersist in interface ConfigSolr

initPersistStatic

public static void initPersistStatic()

addPersistCore

public void addPersistCore(String coreName,
                           Properties attribs,
                           Map<String,String> props)
Specified by:
addPersistCore in interface ConfigSolr

addPersistAllCores

public void addPersistAllCores(Properties containerProperties,
                               Map<String,String> rootSolrAttribs,
                               Map<String,String> coresAttribs,
                               File file)
Specified by:
addPersistAllCores in interface ConfigSolr

getCoreNameFromOrig

public String getCoreNameFromOrig(String origCoreName,
                                  SolrResourceLoader loader,
                                  String coreName)
Specified by:
getCoreNameFromOrig in interface ConfigSolr

getAllCoreNames

public List<String> getAllCoreNames()
Specified by:
getAllCoreNames in interface ConfigSolr

getProperty

public String getProperty(String coreName,
                          String property,
                          String defaultVal)
Specified by:
getProperty in interface ConfigSolr

readCoreProperties

public Properties readCoreProperties(String coreName)
Specified by:
readCoreProperties in interface ConfigSolr

is50OrLater

public boolean is50OrLater()
Specified by:
is50OrLater in interface ConfigSolr


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.