Class IndexManagerImpl

    • Method Detail

      • start

        public void start()
        Specified by:
        start in interface Lifecycle
      • stop

        public void stop()
        Specified by:
        stop in interface Lifecycle
      • processResources

        protected void processResources()
      • processMappingExtensionResources

        protected Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> processMappingExtensionResources()
      • validateMappingExtensionJson

        protected boolean validateMappingExtensionJson​(Resource mappingExtensionResource,
                                                       com.fasterxml.jackson.databind.JsonNode mappingExtensionJson)
      • processMappingResources

        protected void processMappingResources​(Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> mappingExtensionConfigurations)
      • processVariableMappings

        protected void processVariableMappings​(CustomIndexMapping indexMapping,
                                               com.fasterxml.jackson.databind.JsonNode jsonNode)
      • enhanceMappingWithExtension

        protected void enhanceMappingWithExtension​(Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> mappingExtensionConfigurations,
                                                   CustomIndexConfiguration customIndexConfiguration,
                                                   String indexName)
      • enhanceProperties

        protected void enhanceProperties​(Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> mappingExtensionConfigurations,
                                         CustomIndexConfiguration customIndexConfiguration,
                                         String indexName)
      • enhanceVariableProperties

        protected void enhanceVariableProperties​(Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> mappingExtensionConfigurations,
                                                 CustomIndexConfiguration customIndexConfiguration,
                                                 String indexName)
      • enhanceSettings

        protected void enhanceSettings​(Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> mappingExtensionConfigurations,
                                       CustomIndexConfiguration customIndexConfiguration,
                                       String indexName)
      • setIndexNamePrefix

        public void setIndexNamePrefix​(String indexNamePrefix)
      • getESIndexName

        public String getESIndexName​(String indexName)
        Description copied from interface: IndexManager
        Returns the internal index name for the provided raw index name. As there might be an index-prefix in place, the index name towards the Elasticsearch client needs to use the internal name though which is returned using this method.
        Specified by:
        getESIndexName in interface IndexManager
        Parameters:
        indexName - the index name as being used in configuration, query DSL and API
        Returns:
        the index name as being used towards Elasticsearch (might have a prefix)
      • createIndexWithAlias

        public com.fasterxml.jackson.databind.JsonNode createIndexWithAlias​(String indexName)
        Description copied from interface: IndexManager
        Creates an index. The index mapping that is used will need to have as 'name' the passed index name. In fact, creates both an alias with the given name and the actual index, prefixed with the project name and with a timestamp. This allows later to change indices, but keep the alias and reindex.
        Specified by:
        createIndexWithAlias in interface IndexManager
      • createIndexAndAlias

        public com.fasterxml.jackson.databind.JsonNode createIndexAndAlias​(String alias,
                                                                           String indexMapping)
      • deleteAliasAndRelatedIndices

        public void deleteAliasAndRelatedIndices​(String indexName)
        Description copied from interface: IndexManager
        Deletes the given index and all its aliases. Or, when the name is an alias, deletes the alias and all indices.
        Specified by:
        deleteAliasAndRelatedIndices in interface IndexManager
      • deleteIndex

        public void deleteIndex​(String indexName)
        Description copied from interface: IndexManager
        Deletes the index with the given name. Does not delete the alias, if one exists.
        Specified by:
        deleteIndex in interface IndexManager
      • enhanceIndexName

        protected String enhanceIndexName​(String indexName)
      • isKnownIndex

        public boolean isKnownIndex​(String index)
        Description copied from interface: IndexManager
        Returns whether the index is a known mapped index. This is useful when parsing queries.
        Specified by:
        isKnownIndex in interface IndexManager
      • updateIndexMetaData

        protected void updateIndexMetaData​(Map<String,​com.fasterxml.jackson.databind.JsonNode> indicesMetaData,
                                           Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> aliasesMetaData)
      • updateIndexAndMappingMetaData

        protected void updateIndexAndMappingMetaData​(String index,
                                                     com.fasterxml.jackson.databind.JsonNode metaData)
      • createCustomMappings

        protected void createCustomMappings()
      • createCustomAliasesFromMappings

        protected Map<String,​List<com.fasterxml.jackson.databind.JsonNode>> createCustomAliasesFromMappings​(Map<String,​com.fasterxml.jackson.databind.JsonNode> indexMetaData)
      • updateExistingAliasMapping

        protected void updateExistingAliasMapping​(IndexMapping customMapping)
      • updateExistingMappingIfNeeded

        protected com.fasterxml.jackson.databind.JsonNode updateExistingMappingIfNeeded​(String indexName,
                                                                                        IndexMapping indexMapping)
      • compareExtensionMetadata

        protected boolean compareExtensionMetadata​(com.fasterxml.jackson.databind.JsonNode currentMapping,
                                                   com.fasterxml.jackson.databind.JsonNode updateMapping)
      • getMappingDelta

        protected com.fasterxml.jackson.databind.node.ObjectNode getMappingDelta​(com.fasterxml.jackson.databind.JsonNode currentMapping,
                                                                                 com.fasterxml.jackson.databind.JsonNode updateMapping,
                                                                                 String currentType)
      • createCustomAlias

        protected void createCustomAlias​(String alias,
                                         String indexMapping)
      • logElasticsearchVersionInformation

        protected void logElasticsearchVersionInformation()
      • getMappingResources

        public Resource[] getMappingResources()
      • setMappingResources

        public void setMappingResources​(Resource[] mappingResources)
      • getMappingExtensionResources

        public Resource[] getMappingExtensionResources()
      • setMappingExtensionResources

        public void setMappingExtensionResources​(Resource[] mappingExtensionResources)