public class Aliases extends Object
Modifier and Type | Field and Description |
---|---|
static Aliases |
EMPTY
An empty, minimal Aliases primarily used to support the non-cloud solr use cases.
|
Modifier and Type | Method and Description |
---|---|
Aliases |
cloneWithCollectionAlias(String alias,
String collections)
Creates a new Aliases instance with the same data as the current one but with a modification based on the
parameters.
|
Aliases |
cloneWithCollectionAliasMetadata(String alias,
String metadataKey,
String metadataValue)
Set the value for some metadata on a collection alias.
|
static Map<String,List<String>> |
convertMapOfCommaDelimitedToMapOfList(Map<String,String> collectionAliasMap) |
static Map<String,String> |
convertMapOfListToMapOfCommaDelimited(Map<String,List<String>> collectionAliasMap) |
static Aliases |
fromJSON(byte[] bytes,
int zNodeVersion)
Create an instance from the JSON bytes read from zookeeper.
|
Map<String,List<String>> |
getCollectionAliasListMap()
Get a fully parsed map of collection aliases.
|
Map<String,String> |
getCollectionAliasMap()
Get a map similar to the JSON data as stored in zookeeper.
|
Map<String,String> |
getCollectionAliasMetadata(String alias)
Returns an unmodifiable Map of metadata for a given alias.
|
int |
getZNodeVersion() |
List<String> |
resolveAliases(String aliasName)
List the collections associated with a particular alias.
|
static List<String> |
resolveAliasesGivenAliasMap(Map<String,List<String>> collectionAliasListMap,
String aliasName) |
byte[] |
toJSON()
Serialize our state.
|
String |
toString() |
public static final Aliases EMPTY
public static Aliases fromJSON(byte[] bytes, int zNodeVersion)
bytes
- The bytes read via a getData request to zookeeper (possibly null)zNodeVersion
- the version of the data in zookeeper that this instance corresponds topublic byte[] toJSON()
public static Map<String,List<String>> convertMapOfCommaDelimitedToMapOfList(Map<String,String> collectionAliasMap)
public static Map<String,String> convertMapOfListToMapOfCommaDelimited(Map<String,List<String>> collectionAliasMap)
public int getZNodeVersion()
public Map<String,String> getCollectionAliasMap()
getCollectionAliasListMap()
instead, if collection names will be iterated.public Map<String,List<String>> getCollectionAliasListMap()
public Map<String,String> getCollectionAliasMetadata(String alias)
alias
- the name of an alias also found as a key in getCollectionAliasListMap()
public List<String> resolveAliases(String aliasName)
public static List<String> resolveAliasesGivenAliasMap(Map<String,List<String>> collectionAliasListMap, String aliasName)
public Aliases cloneWithCollectionAlias(String alias, String collections)
Note that the state in zookeeper is unaffected by this method and the change must still be persisted via
ZkStateReader.AliasesManager.applyModificationAndExportToZk(UnaryOperator)
alias
- the alias to update, must not be nullcollections
- the comma separated list of collections for the alias, null to remove the aliaspublic Aliases cloneWithCollectionAliasMetadata(String alias, String metadataKey, String metadataValue)
Note that the state in zookeeper is unaffected by this method and the change must still be persisted via
ZkStateReader.AliasesManager.applyModificationAndExportToZk(UnaryOperator)
alias
- the alias to updatemetadataKey
- the key for the metadatametadataValue
- the metadata to add/replace, null to remove the key.Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.