Class IndexationHelper
- java.lang.Object
-
- fr.gouv.vitam.common.database.server.elasticsearch.IndexationHelper
-
public class IndexationHelper extends java.lang.ObjectIndexationHelper useful method for indexation
-
-
Constructor Summary
Constructors Constructor Description IndexationHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ReindexationResultgetFullKOResult(IndexParameters indexParameters, java.lang.String message)Get KO Result for reindexation ordersstatic IndexationHelpergetInstance()SwitchIndexResultgetKOResult(SwitchIndexParameters switchIndexParameters, java.lang.String message)Get KO Result for switching orderReindexationOKreindex(com.mongodb.client.MongoCollection<org.bson.Document> collection, ElasticsearchAccess esClient, ElasticsearchIndexAlias indexAlias, ElasticsearchIndexSettings indexSettings, ElasticsearchCollections elasticsearchCollection, java.util.List<java.lang.Integer> tenantIds, java.lang.String tenantGroupName)reindex a collection on a tenant list with a esmapping fileSwitchIndexResultswitchIndex(ElasticsearchIndexAlias indexAlias, ElasticsearchIndexAlias newIndex, ElasticsearchAccess esClient)switch index, attach a new index to an existing alias
-
-
-
Method Detail
-
getInstance
public static IndexationHelper getInstance()
-
reindex
public ReindexationOK reindex(com.mongodb.client.MongoCollection<org.bson.Document> collection, ElasticsearchAccess esClient, ElasticsearchIndexAlias indexAlias, ElasticsearchIndexSettings indexSettings, ElasticsearchCollections elasticsearchCollection, java.util.List<java.lang.Integer> tenantIds, java.lang.String tenantGroupName) throws DatabaseException
reindex a collection on a tenant list with a esmapping file- Parameters:
collection- the collection to be reindexedesClient- the elastic client to be used to reindexindexAlias- the elastic index alias information- Returns:
- the result of the reindexation as a IndexationResult object
- Throws:
DatabaseException
-
switchIndex
public SwitchIndexResult switchIndex(ElasticsearchIndexAlias indexAlias, ElasticsearchIndexAlias newIndex, ElasticsearchAccess esClient) throws DatabaseException
switch index, attach a new index to an existing alias- Parameters:
indexAlias- the alias informationnewIndex- the new index name to switch onesClient- the elastic client- Throws:
DatabaseException- if an error occurs
-
getFullKOResult
public ReindexationResult getFullKOResult(IndexParameters indexParameters, java.lang.String message)
Get KO Result for reindexation orders- Parameters:
indexParameters- the index parametermessage- the message to be added- Returns:
- the final result as an IndexationResult object
-
getKOResult
public SwitchIndexResult getKOResult(SwitchIndexParameters switchIndexParameters, java.lang.String message)
Get KO Result for switching order- Parameters:
switchIndexParameters- the switch index parametermessage- the message to be added- Returns:
- the final result as an IndexationResult object
-
-