Class ManagedIndexSchemaFactory

    • Constructor Detail

      • ManagedIndexSchemaFactory

        public ManagedIndexSchemaFactory()
    • Method Detail

      • getManagedSchemaResourceName

        public String getManagedSchemaResourceName()
      • init

        public void init​(org.apache.solr.common.util.NamedList<?> args)
        Description copied from interface: NamedListInitializedPlugin
        init will be called just once, immediately after creation.

        Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself

        Specified by:
        init in interface NamedListInitializedPlugin
        Parameters:
        args - non-null list of initialization parameters (may be empty)
      • lookupZKManagedSchemaPath

        public String lookupZKManagedSchemaPath()
        Lookup the path to the managed schema, dealing with falling back to the legacy managed-schema file, instead of the expected managed-schema.xml file if the legacy file exists.

        This method is duplicated in ManagedIndexSchema.

      • lookupLocalManagedSchemaPath

        public Path lookupLocalManagedSchemaPath()
        Lookup the path to the managed schema, dealing with falling back to the legacy managed-schema file, instead of the expected managed-schema.xml file if the legacy file exists.
      • create

        public ManagedIndexSchema create​(String resourceName,
                                         SolrConfig config,
                                         ConfigSetService configSetService)
        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.getConfigPath(), or if configs are in ZooKeeper, under ZkSolrResourceLoader.getConfigSetZkPath().

        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()
      • isMutable

        public boolean isMutable()