Class IndexValidator

    • Constructor Detail

      • IndexValidator

        public IndexValidator​(@Nonnull
                              Index index)
    • Method Detail

      • validateGrouping

        protected void validateGrouping​(int minGrouped)
      • validateNotGrouping

        protected void validateNotGrouping()
      • validateVersionKey

        protected void validateVersionKey()
      • validateVersionInGroupedKeys

        protected void validateVersionInGroupedKeys()
      • validateNotUnique

        protected void validateNotUnique()
      • validateNotVersion

        protected void validateNotVersion()
      • validateNoValue

        protected void validateNoValue()
      • validateChangedOptions

        @API(EXPERIMENTAL)
        protected void validateChangedOptions​(@Nonnull
                                              Index oldIndex,
                                              @Nonnull
                                              Set<String> changedOptions)
        Validate any option changes included in the set of changed options provided. This is a natural extension point for subclasses which may wish to override how certain options are handled. This function should look at only the options included in the 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:
        1. Validate that any options specific to this index have been changed responsibly.
        2. Remove those options from changedOptions.
        3. Call super.validateChangedOptions(oldIndex, changedOptions to handle common options.
        Parameters:
        oldIndex - an older version of this validator's index
        changedOptions - the set of changed options to inspect
      • validateChangedOptions

        @API(EXPERIMENTAL)
        public void validateChangedOptions​(@Nonnull
                                           Index oldIndex)
        Validate any options that have changed. This should inspect the options of 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).

        Parameters:
        oldIndex - an older version of this validator's index
        See Also:
        validateChangedOptions(Index, Set)