public final class ZkController extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COLLECTION_PARAM_PREFIX |
static String |
CONFIGNAME_PROP |
protected Overseer |
overseer |
| Constructor and Description |
|---|
ZkController(CoreContainer cc,
String zkServerAddress,
int zkClientTimeout,
int zkClientConnectTimeout,
String localHost,
String locaHostPort,
String localHostContext,
CurrentCoreDescriptorProvider registerOnReconnect) |
| Modifier and Type | Method and Description |
|---|---|
static void |
bootstrapConf(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 |
createCollection(String collection) |
void |
createCollectionZkNode(CloudDescriptor cd) |
static void |
downloadConfigDir(SolrZkClient zkClient,
String configName,
File dir) |
static void |
downloadFromZK(SolrZkClient zkClient,
String zkPath,
File dir) |
String |
getBaseUrl() |
ClusterState |
getClusterState() |
byte[] |
getConfigFileData(String zkConfigName,
String fileName) |
String |
getHostName() |
String |
getHostPort() |
String |
getNodeName() |
DistributedQueue |
getOverseerCollectionQueue() |
DistributedQueue |
getOverseerJobQueue() |
SolrZkClient |
getZkClient() |
String |
getZkServerAddress() |
ZkStateReader |
getZkStateReader() |
boolean |
isConnected() |
static void |
linkConfSet(SolrZkClient zkClient,
String collection,
String confSetName) |
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(SolrZkClient zkClient,
File dir,
String configName) |
void |
uploadToZK(File dir,
String zkPath) |
static void |
uploadToZK(SolrZkClient zkClient,
File dir,
String zkPath) |
public static final String COLLECTION_PARAM_PREFIX
public static final String CONFIGNAME_PROP
protected volatile Overseer overseer
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 - InterruptedExceptionTimeoutExceptionIOExceptionpublic void close()
public boolean configFileExists(String collection, String fileName) throws org.apache.zookeeper.KeeperException, InterruptedException
collection - fileName - org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic ClusterState getClusterState()
public byte[] getConfigFileData(String zkConfigName, String fileName) throws org.apache.zookeeper.KeeperException, InterruptedException
zkConfigName - fileName - org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic String getHostName()
public String getHostPort()
public 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.KeeperExceptionInterruptedExceptionpublic String readConfigName(String collection) throws org.apache.zookeeper.KeeperException, InterruptedException
collection - org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic String register(String coreName, CoreDescriptor desc) throws Exception
coreName - desc - Exceptionpublic 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.KeeperExceptionInterruptedExceptionpublic void unregister(String coreName, CloudDescriptor cloudDesc) throws InterruptedException, org.apache.zookeeper.KeeperException
coreName - cloudDesc - org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void createCollection(String collection) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void uploadToZK(File dir, String zkPath) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
dir - zkPath - IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void uploadConfigDir(File dir, String configName) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
dir - configName - IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void createCollectionZkNode(CloudDescriptor cd) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic ZkStateReader getZkStateReader()
public static void uploadToZK(SolrZkClient zkClient, File dir, String zkPath) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void downloadFromZK(SolrZkClient zkClient, String zkPath, File dir) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void uploadConfigDir(SolrZkClient zkClient, File dir, String configName) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void downloadConfigDir(SolrZkClient zkClient, String configName, File dir) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void preRegister(CoreDescriptor cd) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void linkConfSet(SolrZkClient zkClient, String collection, String confSetName) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void bootstrapConf(SolrZkClient zkClient, Config cfg, String solrHome) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic DistributedQueue getOverseerJobQueue()
public DistributedQueue getOverseerCollectionQueue()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.