|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.solr.cloud.ZkController
public final class ZkController
Handle ZooKeeper interactions. notes: loads everything on init, creates what's not there - further updates are prompted with Watches. TODO: exceptions during shutdown on attempts to update cloud state
| Field Summary | |
|---|---|
static String |
COLLECTION_PARAM_PREFIX
|
static String |
CONFIGNAME_PROP
|
| Constructor Summary | |
|---|---|
ZkController(CoreContainer cc,
String zkServerAddress,
int zkClientTimeout,
int zkClientConnectTimeout,
String localHost,
String locaHostPort,
String localHostContext,
CurrentCoreDescriptorProvider registerOnReconnect)
|
|
| Method Summary | |
|---|---|
static void |
bootstrapConf(org.apache.solr.common.cloud.SolrZkClient zkClient,
Config cfg,
String solrHome)
If in SolrCloud mode, upload config sets for each SolrCore in solr.xml. |
void |
close()
Closes the underlying ZooKeeper client. |
boolean |
configFileExists(String collection,
String fileName)
|
void |
createCollectionZkNode(CloudDescriptor cd)
|
String |
getBaseUrl()
|
org.apache.solr.common.cloud.CloudState |
getCloudState()
|
byte[] |
getConfigFileData(String zkConfigName,
String fileName)
|
String |
getHostName()
|
String |
getHostPort()
|
String |
getNodeName()
|
org.apache.solr.common.cloud.SolrZkClient |
getZkClient()
|
String |
getZkServerAddress()
|
org.apache.solr.common.cloud.ZkStateReader |
getZkStateReader()
|
boolean |
isConnected()
|
static void |
main(String[] args)
Bootstraps the current configs for all collections in solr.xml. |
boolean |
pathExists(String path)
|
void |
preRegister(CoreDescriptor cd)
|
void |
publish(CoreDescriptor cd,
String state)
Publish core state to overseer. |
String |
readConfigName(String collection)
|
String |
register(String coreName,
CoreDescriptor desc)
Register shard with ZooKeeper. |
String |
register(String coreName,
CoreDescriptor desc,
boolean recoverReloadedCores)
Register shard with ZooKeeper. |
void |
unregister(String coreName,
CloudDescriptor cloudDesc)
|
void |
uploadConfigDir(File dir,
String configName)
|
static void |
uploadConfigDir(org.apache.solr.common.cloud.SolrZkClient zkClient,
File dir,
String configName)
|
void |
uploadToZK(File dir,
String zkPath)
|
static void |
uploadToZK(org.apache.solr.common.cloud.SolrZkClient zkClient,
File dir,
String zkPath)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String COLLECTION_PARAM_PREFIX
public static final String CONFIGNAME_PROP
| Constructor Detail |
|---|
public ZkController(CoreContainer cc,
String zkServerAddress,
int zkClientTimeout,
int zkClientConnectTimeout,
String localHost,
String locaHostPort,
String localHostContext,
CurrentCoreDescriptorProvider registerOnReconnect)
throws InterruptedException,
TimeoutException,
IOException
cc - if null, recovery will not be enabledzkServerAddress - zkClientTimeout - zkClientConnectTimeout - localHost - locaHostPort - localHostContext - registerOnReconnect -
InterruptedException
TimeoutException
IOException| Method Detail |
|---|
public static void main(String[] args)
throws Exception
args -
Exceptionpublic void close()
public boolean configFileExists(String collection,
String fileName)
throws org.apache.zookeeper.KeeperException,
InterruptedException
collection - fileName -
org.apache.zookeeper.KeeperException
InterruptedExceptionpublic org.apache.solr.common.cloud.CloudState getCloudState()
public byte[] getConfigFileData(String zkConfigName,
String fileName)
throws org.apache.zookeeper.KeeperException,
InterruptedException
zkConfigName - fileName -
org.apache.zookeeper.KeeperException
InterruptedExceptionpublic String getHostName()
public String getHostPort()
public org.apache.solr.common.cloud.SolrZkClient getZkClient()
public String getZkServerAddress()
public boolean isConnected()
public String getNodeName()
public boolean pathExists(String path)
throws org.apache.zookeeper.KeeperException,
InterruptedException
path -
org.apache.zookeeper.KeeperException
InterruptedException
public String readConfigName(String collection)
throws org.apache.zookeeper.KeeperException,
InterruptedException,
IOException
collection -
org.apache.zookeeper.KeeperException
InterruptedException
IOException
public String register(String coreName,
CoreDescriptor desc)
throws Exception
coreName - desc -
Exception
public String register(String coreName,
CoreDescriptor desc,
boolean recoverReloadedCores)
throws Exception
coreName - desc - recoverReloadedCores -
Exceptionpublic String getBaseUrl()
public void publish(CoreDescriptor cd,
String state)
throws org.apache.zookeeper.KeeperException,
InterruptedException
cd - state -
org.apache.zookeeper.KeeperException
InterruptedException
public void unregister(String coreName,
CloudDescriptor cloudDesc)
throws InterruptedException,
org.apache.zookeeper.KeeperException
coreName - cloudDesc -
org.apache.zookeeper.KeeperException
InterruptedException
public void uploadToZK(File dir,
String zkPath)
throws IOException,
org.apache.zookeeper.KeeperException,
InterruptedException
dir - zkPath -
IOException
org.apache.zookeeper.KeeperException
InterruptedException
public void uploadConfigDir(File dir,
String configName)
throws IOException,
org.apache.zookeeper.KeeperException,
InterruptedException
dir - configName -
IOException
org.apache.zookeeper.KeeperException
InterruptedException
public void createCollectionZkNode(CloudDescriptor cd)
throws org.apache.zookeeper.KeeperException,
InterruptedException,
IOException
org.apache.zookeeper.KeeperException
InterruptedException
IOExceptionpublic org.apache.solr.common.cloud.ZkStateReader getZkStateReader()
public static void uploadToZK(org.apache.solr.common.cloud.SolrZkClient zkClient,
File dir,
String zkPath)
throws IOException,
org.apache.zookeeper.KeeperException,
InterruptedException
IOException
org.apache.zookeeper.KeeperException
InterruptedException
public static void uploadConfigDir(org.apache.solr.common.cloud.SolrZkClient zkClient,
File dir,
String configName)
throws IOException,
org.apache.zookeeper.KeeperException,
InterruptedException
IOException
org.apache.zookeeper.KeeperException
InterruptedException
public void preRegister(CoreDescriptor cd)
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static void bootstrapConf(org.apache.solr.common.cloud.SolrZkClient zkClient,
Config cfg,
String solrHome)
throws IOException,
org.apache.zookeeper.KeeperException,
InterruptedException
IOException
org.apache.zookeeper.KeeperException
InterruptedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||