@API(value=MAINTAINED) public class IndexValidator extends Object
Index
,
IndexMaintainerFactory
Constructor and Description |
---|
IndexValidator(Index index) |
Modifier and Type | Method and Description |
---|---|
void |
validate(MetaDataValidator metaDataValidator) |
void |
validateChangedOptions(Index oldIndex)
Validate any options that have changed.
|
protected void |
validateChangedOptions(Index oldIndex,
Set<String> changedOptions)
Validate any option changes included in the set of changed options provided.
|
protected void |
validateGrouping(int minGrouped) |
void |
validateIndexForRecordType(RecordType recordType,
MetaDataValidator metaDataValidator) |
protected void |
validateNotGrouping() |
protected void |
validateNotUnique() |
protected void |
validateNotVersion() |
protected void |
validateNoValue() |
protected void |
validateStoresRecordVersions(RecordMetaDataProvider metaDataProvider) |
protected void |
validateVersionInGroupedKeys() |
protected void |
validateVersionKey() |
public void validate(@Nonnull MetaDataValidator metaDataValidator)
public void validateIndexForRecordType(@Nonnull RecordType recordType, @Nonnull MetaDataValidator metaDataValidator)
protected void validateGrouping(int minGrouped)
protected void validateNotGrouping()
protected void validateStoresRecordVersions(@Nonnull RecordMetaDataProvider metaDataProvider)
protected void validateVersionKey()
protected void validateVersionInGroupedKeys()
protected void validateNotUnique()
protected void validateNotVersion()
protected void validateNoValue()
@API(value=EXPERIMENTAL) protected void validateChangedOptions(@Nonnull Index oldIndex, @Nonnull Set<String> changedOptions)
changedOptions
parameter even if additional options in this
validator's index and oldIndex
. The changedOptions
parameter is also
guaranteed to be safe to mutate. A common pattern for extending subclasses for
specific index types might therefore be something like:
changedOptions
.super.validateChangedOptions(oldIndex, changedOptions
to handle common options.oldIndex
- an older version of this validator's indexchangedOptions
- the set of changed options to inspect@API(value=EXPERIMENTAL) public void validateChangedOptions(@Nonnull Index oldIndex)
oldIndex
,
which will be an older version of this index, and determine if all index option changes
are valid. In particular, this should validate that none of the changes necessitate any
on-disk changes or index rebuilds. For example, it is generally legal to drop a
uniqueness constraint from an index, but it is
not legal to change the tokenizer
of a text index.
The default behavior is to allow the index to go from having a uniqueness constraint to not
having one as well as allowing any change to the option specifying whether the index may be
used for queries, but all other changes are
rejected. If an index type would like to different behavior because some options specific
to it may be safely changed, the validator for that type should either override this method
or validateChangedOptions(Index, Set)
.
oldIndex
- an older version of this validator's indexvalidateChangedOptions(Index, Set)