Class MetaData

    • Method Detail

      • registerFactory

        public static void registerFactory(String type,
                                           MetaData.Custom.Factory factory)
        Register a custom index meta data factory. Make sure to call it from a static block.
      • version

        public long version()
      • settings

        public Settings settings()
        Returns the merges transient and persistent settings.
      • transientSettings

        public Settings transientSettings()
      • persistentSettings

        public Settings persistentSettings()
      • findAliases

        public ImmutableOpenMap<String,<any>> findAliases(String[] aliases,
                                                          String[] concreteIndices)
        Finds the specific index aliases that match with the specified aliases directly or partially via wildcards and that point to the specified concrete indices or match partially with the indices via wildcards.
        Parameters:
        aliases - The names of the index aliases to find
        concreteIndices - The concrete indexes the index aliases must point to order to be returned.
        Returns:
        the found index aliases grouped by index
      • hasAliases

        public boolean hasAliases(String[] aliases,
                                  String[] concreteIndices)
        Checks if at least one of the specified aliases exists in the specified concrete indices. Wildcards are supported in the alias names for partial matches.
        Parameters:
        aliases - The names of the index aliases to find
        concreteIndices - The concrete indexes the index aliases must point to order to be returned.
        Returns:
        whether at least one of the specified aliases exists in one of the specified concrete indices.
      • concreteAllIndices

        public String[] concreteAllIndices()
        Returns all the concrete indices.
      • getConcreteAllIndices

        public String[] getConcreteAllIndices()
      • concreteAllOpenIndices

        public String[] concreteAllOpenIndices()
      • getConcreteAllOpenIndices

        public String[] getConcreteAllOpenIndices()
      • concreteAllClosedIndices

        public String[] concreteAllClosedIndices()
      • getConcreteAllClosedIndices

        public String[] getConcreteAllClosedIndices()
      • resolveIndexRouting

        public String resolveIndexRouting(@Nullable
                                          String routing,
                                          String aliasOrIndex)
        Returns indexing routing for the given index.
      • concreteIndices

        public String[] concreteIndices(IndicesOptions indicesOptions,
                                        String... aliasesOrIndices)
                                 throws IndexMissingException,
                                        ElasticsearchIllegalArgumentException
        Translates the provided indices or aliases, eventually containing wildcard expressions, into actual indices.
        Parameters:
        indicesOptions - how the aliases or indices need to be resolved to concrete indices
        aliasesOrIndices - the aliases or indices to be resolved to concrete indices
        Returns:
        the obtained concrete indices
        Throws:
        IndexMissingException - if one of the aliases or indices is missing and the provided indices options don't allow such a case, or if the final result of the indices resolution is no indices and the indices options don't allow such a case.
        ElasticsearchIllegalArgumentException - if one of the aliases resolve to multiple indices and the provided indices options don't allow such a case.
      • convertFromWildcards

        public String[] convertFromWildcards(String[] aliasesOrIndices,
                                             IndicesOptions indicesOptions)
        Converts a list of indices or aliases wildcards, and special +/- signs, into their respective full matches. It won't convert only to indices, but also to aliases. For example, alias_* will expand to alias_1 and alias_2, not to the respective indices those aliases point to.
      • hasIndex

        public boolean hasIndex(String index)
      • hasConcreteIndex

        public boolean hasConcreteIndex(String index)
      • totalNumberOfShards

        public int totalNumberOfShards()
      • getTotalNumberOfShards

        public int getTotalNumberOfShards()
      • numberOfShards

        public int numberOfShards()
      • getNumberOfShards

        public int getNumberOfShards()
      • filteringAliases

        public String[] filteringAliases(String index,
                                         String... indicesOrAliases)
        Iterates through the list of indices and selects the effective list of filtering aliases for the given index.

        Only aliases with filters are returned. If the indices list contains a non-filtering reference to the index itself - null is returned. Returns null if no filtering is required.

      • isAllIndices

        public static boolean isAllIndices(String[] aliasesOrIndices)
        Identifies whether the array containing index names given as argument refers to all indices The empty or null array identifies all indices
        Parameters:
        aliasesOrIndices - the array containing index names
        Returns:
        true if the provided array maps to all indices, false otherwise
      • isAllTypes

        public static boolean isAllTypes(String[] types)
        Identifies whether the array containing type names given as argument refers to all types The empty or null array identifies all types
        Parameters:
        types - the array containing index names
        Returns:
        true if the provided array maps to all indices, false otherwise
      • isExplicitAllPattern

        public static boolean isExplicitAllPattern(String[] aliasesOrIndices)
        Identifies whether the array containing index names given as argument explicitly refers to all indices The empty or null array doesn't explicitly map to all indices
        Parameters:
        aliasesOrIndices - the array containing index names
        Returns:
        true if the provided array explicitly maps to all indices, false otherwise
      • isPatternMatchingAllIndices

        public boolean isPatternMatchingAllIndices(String[] indicesOrAliases,
                                                   String[] concreteIndices)
        Identifies whether the first argument (an array containing index names) is a pattern that matches all indices
        Parameters:
        indicesOrAliases - the array containing index names
        concreteIndices - array containing the concrete indices that the first argument refers to
        Returns:
        true if the first argument is a pattern that maps to all available indices, false otherwise
      • routingRequired

        public boolean routingRequired(String concreteIndex,
                                       String type)
        Parameters:
        concreteIndex - The concrete index to check if routing is required
        type - The type to check if routing is required
        Returns:
        Whether routing is required according to the mapping for the specified index and type
      • iterator

        public <any> iterator()
      • isGlobalStateEquals

        public static boolean isGlobalStateEquals(MetaData metaData1,
                                                  MetaData metaData2)