Package com.atlassian.jira.issue.index
Class IndexConsistencyUtils
java.lang.Object
com.atlassian.jira.issue.index.IndexConsistencyUtils
Utility methods related to performing consistency checks on indexes.
- Since:
- v5.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic booleanisIndexConsistent(String name, int expectedCount, int actualCount) Performs a simple consistency check by comparing the actual document count to an expected value.
-
Method Details
-
isIndexConsistent
Performs a simple consistency check by comparing the actual document count to an expected value. If the expected document count cannot be determined reliably and efficiently, then-1may be specified to skip that part of the check. If an expected count is given, the actual count must be within the allowed tolerance defined as a percentage of the expected value (set byINDEX_CONSISTENCY_TOLERANCE_PERCENTAGE_SYSTEM_PROPERTY, defaultINDEX_CONSISTENCY_TOLERANCE_PERCENTAGE_DEFAULT_VALUE) orMINIMUM_ABSOLUTE_TOLERANCEdocuments, whichever value is larger.- Parameters:
name- a name to identify the indexexpectedCount- the expected count of documents in the index, or-1to skip this checkactualCount- the actual count of documents in the index- Returns:
trueif the actual count is reasonably close to the expected number of documents;falseif the index document count is excessively different from the expected count
-
getIndexConsistencyTolerancePercentage
public static int getIndexConsistencyTolerancePercentage()
-