Package org.apache.solr.schema
Class ZkIndexSchemaReader
- java.lang.Object
-
- org.apache.solr.schema.ZkIndexSchemaReader
-
- All Implemented Interfaces:
OnReconnect
public class ZkIndexSchemaReader extends Object implements 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 class
ZkIndexSchemaReader.SchemaWatcher
Watches 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 void
command()
Called after a ZooKeeper session expiration occurs; need to re-create the watcher and update the current schema from ZooKeeper.ZkIndexSchemaReader.SchemaWatcher
createSchemaWatcher()
Creates a schema watcher and returns it for controlling purposes.boolean
equals(Object other)
Object
getSchemaUpdateLock()
String
getUniqueCoreId()
int
hashCode()
ManagedIndexSchema
refreshSchemaFromZk(int expectedZkVersion)
String
toString()
-
-
-
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.KeeperException
InterruptedException
-
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:
command
in interfaceOnReconnect
-
getUniqueCoreId
public String getUniqueCoreId()
-
-