public class ZkClientClusterStateProvider extends Object implements ClusterStateProvider
| 构造器和说明 |
|---|
ZkClientClusterStateProvider(Collection<String> zkHosts,
String chroot) |
ZkClientClusterStateProvider(String zkHost) |
ZkClientClusterStateProvider(ZkStateReader zkStateReader) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
connect() |
void |
downloadConfig(String configName,
Path downloadPath)
Download a named config from Zookeeper to a location on the filesystem
|
Map<String,String> |
getAliasProperties(String alias)
Return alias properties, or an empty map if the alias has no properties.
|
Map<String,Object> |
getClusterProperties()
Obtain cluster properties.
|
Object |
getClusterProperty(String propertyName)
Obtain a cluster property, or null if it doesn't exist.
|
<T> T |
getClusterProperty(String propertyName,
T def)
Obtain a cluster property, or the default value if it doesn't exist.
|
ClusterState |
getClusterState()
Obtain the current cluster state.
|
Set<String> |
getLiveNodes()
Obtain set of live_nodes for the cluster.
|
String |
getPolicyNameByCollection(String coll)
Get the collection-specific policy
|
ClusterState.CollectionRef |
getState(String collection)
Obtain the state of the collection (cluster status).
|
ZkStateReader |
getZkStateReader() |
boolean |
isClosed() |
List<String> |
resolveAlias(String alias)
Given a collection alias, returns a list of collections it points to, or returns a singleton list of the input if
it's not an alias.
|
String |
resolveSimpleAlias(String alias)
Given a collection alias, return a single collection it points to, or the original name if it's not an
alias.
|
String |
toString() |
void |
uploadConfig(Path configPath,
String configName)
Upload a set of config files to Zookeeper and give it a name
NOTE: You should only allow trusted users to upload configs.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCollection, isRoutedAliaspublic ZkClientClusterStateProvider(ZkStateReader zkStateReader)
public ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot)
public ZkClientClusterStateProvider(String zkHost)
public ClusterState.CollectionRef getState(String collection)
ClusterStateProvidergetState 在接口中 ClusterStateProviderpublic Set<String> getLiveNodes()
ClusterStateProvidergetLiveNodes 在接口中 ClusterStateProviderpublic List<String> resolveAlias(String alias)
ClusterStateProviderresolveAlias 在接口中 ClusterStateProviderpublic Map<String,String> getAliasProperties(String alias)
ClusterStateProvidergetAliasProperties 在接口中 ClusterStateProviderpublic String resolveSimpleAlias(String alias) throws IllegalArgumentException
ClusterStateProviderresolveSimpleAlias 在接口中 ClusterStateProviderIllegalArgumentException - if an alias points to more than 1 collection, either directly or indirectly.public Object getClusterProperty(String propertyName)
ClusterStateProvidergetClusterProperty 在接口中 ClusterStateProviderpublic <T> T getClusterProperty(String propertyName, T def)
ClusterStateProvidergetClusterProperty 在接口中 ClusterStateProviderpublic ClusterState getClusterState() throws IOException
ClusterStateProvidergetClusterState 在接口中 ClusterStateProviderIOExceptionpublic Map<String,Object> getClusterProperties()
ClusterStateProvidergetClusterProperties 在接口中 ClusterStateProviderpublic String getPolicyNameByCollection(String coll)
ClusterStateProviderpublic void downloadConfig(String configName, Path downloadPath) throws IOException
configName - the name of the configdownloadPath - the path to write config files toIOException - if an I/O exception occurspublic void uploadConfig(Path configPath, String configName) throws IOException
configPath - Path to the config filesconfigName - the name of the configIOException - if an IO error occurspublic void connect()
connect 在接口中 ClusterStateProviderpublic ZkStateReader getZkStateReader()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic boolean isClosed()
isClosed 在接口中 SolrCloseableCopyright © 2006–2022 The Apache Software Foundation. All rights reserved.