Package org.apache.solr.schema
Class ZkIndexSchemaReader
- java.lang.Object
-
- org.apache.solr.schema.ZkIndexSchemaReader
-
- All Implemented Interfaces:
org.apache.solr.common.cloud.OnReconnect
public class ZkIndexSchemaReader extends Object implements org.apache.solr.common.cloud.OnReconnect
Keeps a ManagedIndexSchema up-to-date when changes are made to the serialized managed schema in ZooKeeper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZkIndexSchemaReader.SchemaWatcherWatches for schema changes and triggers updates in the ZkIndexSchemaReader.
-
Constructor Summary
Constructors Constructor Description ZkIndexSchemaReader(ManagedIndexSchemaFactory managedIndexSchemaFactory, SolrCore solrCore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommand()Called after a ZooKeeper session expiration occurs; need to re-create the watcher and update the current schema from ZooKeeper.ZkIndexSchemaReader.SchemaWatchercreateSchemaWatcher()Creates a schema watcher and returns it for controlling purposes.booleanequals(Object other)ObjectgetSchemaUpdateLock()StringgetUniqueCoreId()inthashCode()ManagedIndexSchemarefreshSchemaFromZk(int expectedZkVersion)StringtoString()
-
-
-
Constructor Detail
-
ZkIndexSchemaReader
public ZkIndexSchemaReader(ManagedIndexSchemaFactory managedIndexSchemaFactory, SolrCore solrCore)
-
-
Method Detail
-
getSchemaUpdateLock
public Object getSchemaUpdateLock()
-
createSchemaWatcher
public ZkIndexSchemaReader.SchemaWatcher createSchemaWatcher()
Creates a schema watcher and returns it for controlling purposes.- Returns:
- the registered ZkIndexSchemaReader.SchemaWatcher.
-
refreshSchemaFromZk
public ManagedIndexSchema refreshSchemaFromZk(int expectedZkVersion) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
command
public void command()
Called after a ZooKeeper session expiration occurs; need to re-create the watcher and update the current schema from ZooKeeper.- Specified by:
commandin interfaceorg.apache.solr.common.cloud.OnReconnect
-
getUniqueCoreId
public String getUniqueCoreId()
-
-