Class IndexName
java.lang.Object
org.apache.jackrabbit.oak.plugins.index.IndexName
- All Implemented Interfaces:
Comparable<IndexName>
An index name, which possibly contains two version numbers: the product
version number, and the customer version number.
The format of an index node name is:
- The name of the index,
- optionally a dash ('-') and the product version number,
- optionally "-custom-" and the customer version number.
If the node name doesn't contain version numbers / dashes, then version 0 is
assumed (for both the product version number and customer version number).
-
Method Summary
Modifier and TypeMethodDescriptionint
static Collection<String>
filterReplacedIndexes
(Collection<String> indexPaths, NodeState rootState, boolean checkIsActive) Filter out index that are replaced by another index with the same base name but newer version.int
getLatestCustomized
(List<IndexName> all) Get the latest index name object that matches this index base name, and is customized.getLatestProduct
(List<IndexName> all) Get the latest product index that matches this index base name.int
static boolean
isIndexActive
(String indexPath, NodeState rootState) boolean
isLegal()
boolean
static IndexName
Parse the node name.toString()
-
Method Details
-
parse
Parse the node name. Both node names with version and without version are supported.- Parameters:
nodeName
- the node name (starting from root; e.g. "/oak:index/lucene")- Returns:
- the index name object
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<IndexName>
-
getLatestCustomized
Get the latest index name object that matches this index base name, and is customized.- Parameters:
all
- the list of all indexes- Returns:
- the lastest customized index, or null if none
-
getLatestProduct
Get the latest product index that matches this index base name.- Parameters:
all
- the list of all indexes- Returns:
- the latest product index, or null if none
-
filterReplacedIndexes
public static Collection<String> filterReplacedIndexes(Collection<String> indexPaths, NodeState rootState, boolean checkIsActive) Filter out index that are replaced by another index with the same base name but newer version. Indexes without a version number in the name are always used, except if there is an active index with the same base name but a newer version. Active indexes have a hidden ":oak:mount-" node, which means they are indexed in the read-only node store.- Parameters:
indexPaths
- the set of index pathsrootState
- the root node state (used to find hidden nodes)- Returns:
- the filtered list
-
nextCustomizedName
-
isIndexActive
-
getNodeName
-
getCustomerVersion
public int getCustomerVersion() -
getProductVersion
public int getProductVersion() -
getBaseName
-
isVersioned
public boolean isVersioned() -
isLegal
public boolean isLegal()
-