org.apache.solr.schema
Class ManagedIndexSchemaFactory

java.lang.Object
  extended by org.apache.solr.schema.IndexSchemaFactory
      extended by org.apache.solr.schema.ManagedIndexSchemaFactory
All Implemented Interfaces:
NamedListInitializedPlugin, SolrCoreAware

public class ManagedIndexSchemaFactory
extends IndexSchemaFactory
implements SolrCoreAware

Factory for ManagedIndexSchema


Field Summary
static String DEFAULT_MANAGED_SCHEMA_RESOURCE_NAME
           
static String MANAGED_SCHEMA_RESOURCE_NAME
           
 
Constructor Summary
ManagedIndexSchemaFactory()
           
 
Method Summary
 ManagedIndexSchema create(String resourceName, SolrConfig config)
          First, try to locate the managed schema file named in the managedSchemaResourceName param.
 String getManagedSchemaResourceName()
           
 SolrResourceLoader getResourceLoader()
           
 ManagedIndexSchema getSchema()
           
 Object getSchemaUpdateLock()
           
 void inform(SolrCore core)
           
 void init(NamedList args)
           
 void setSchema(ManagedIndexSchema schema)
           
 
Methods inherited from class org.apache.solr.schema.IndexSchemaFactory
buildIndexSchema, getResourceNameToBeUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MANAGED_SCHEMA_RESOURCE_NAME

public static final String DEFAULT_MANAGED_SCHEMA_RESOURCE_NAME
See Also:
Constant Field Values

MANAGED_SCHEMA_RESOURCE_NAME

public static final String MANAGED_SCHEMA_RESOURCE_NAME
See Also:
Constant Field Values
Constructor Detail

ManagedIndexSchemaFactory

public ManagedIndexSchemaFactory()
Method Detail

getManagedSchemaResourceName

public String getManagedSchemaResourceName()

getResourceLoader

public SolrResourceLoader getResourceLoader()

init

public void init(NamedList args)
Specified by:
init in interface NamedListInitializedPlugin

create

public ManagedIndexSchema create(String resourceName,
                                 SolrConfig config)
First, try to locate the managed schema file named in the managedSchemaResourceName param. If the managed schema file exists and is accessible, it is used to instantiate an IndexSchema. If the managed schema file can't be found, the resource named by the resourceName parameter is used to instantiate an IndexSchema. Once the IndexSchema is instantiated, if the managed schema file does not exist, the instantiated IndexSchema is persisted to the managed schema file named in the managedSchemaResourceName param, in the directory given by SolrResourceLoader.getConfigDir(), or if configs are in ZooKeeper, under ZkSolrResourceLoader.collectionZkPath. After the managed schema file is persisted, the original schema file is renamed by appending the extension named in UPGRADED_SCHEMA_EXTENSION.

Overrides:
create in class IndexSchemaFactory

getSchemaUpdateLock

public Object getSchemaUpdateLock()

inform

public void inform(SolrCore core)
Specified by:
inform in interface SolrCoreAware

getSchema

public ManagedIndexSchema getSchema()

setSchema

public void setSchema(ManagedIndexSchema schema)


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