public final class IndexUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ATTRIBUTES
Maximum number of attributes allowed in the index.
|
Modifier and Type | Method and Description |
---|---|
static String |
canonicalizeAttribute(String attribute)
Produces canonical attribute representation by stripping an unnecessary
"this." qualifier from the passed attribute, if any.
|
static IndexConfig |
createIndexConfig(IndexType type,
String... attributes)
Create simple index definition with the given attributes
|
static IndexConfig |
createTestIndexConfig(IndexType type,
String... attributes)
Create simple index definition with the given attributes and initialize it's name upfront.
|
static void |
generateXml(ConfigXmlGenerator.XmlGenerator gen,
List<IndexConfig> indexConfigs) |
static String[] |
getComponents(IndexConfig config) |
static IndexConfig |
getIndexConfigFromXml(Node indexNode,
boolean domLevel3) |
static IndexConfig |
getIndexConfigFromYaml(Node indexNode,
boolean domLevel3) |
static IndexType |
getIndexTypeFromXmlName(String typeStr) |
static IndexConfig |
validateAndNormalize(String mapName,
IndexConfig config)
Validate provided index config and normalize it's name and attribute names.
|
static void |
validateAttribute(IndexConfig config,
String attributeName)
Validate attribute name.
|
static void |
validateAttribute(String attributeName)
Validate attribute name.
|
public static final int MAX_ATTRIBUTES
public static IndexConfig validateAndNormalize(String mapName, IndexConfig config)
mapName
- Name of the mapconfig
- Index config.IllegalArgumentException
- If index configuration is invalid.public static void validateAttribute(IndexConfig config, String attributeName)
config
- Index config.attributeName
- Attribute name.public static void validateAttribute(String attributeName)
attributeName
- Attribute name.public static String canonicalizeAttribute(String attribute)
attribute
- the attribute to canonicalize.public static String[] getComponents(IndexConfig config)
public static IndexConfig createIndexConfig(IndexType type, String... attributes)
type
- Index type.attributes
- Attribute names.public static IndexConfig createTestIndexConfig(IndexType type, String... attributes)
type
- Index type.attributes
- Attribute names.public static void generateXml(ConfigXmlGenerator.XmlGenerator gen, List<IndexConfig> indexConfigs)
public static IndexConfig getIndexConfigFromXml(Node indexNode, boolean domLevel3)
public static IndexConfig getIndexConfigFromYaml(Node indexNode, boolean domLevel3)
Copyright © 2019 Hazelcast, Inc.. All rights reserved.