* @param tableConfigJson the table config json
*/
public IndexIntegrityValidator(SearchServiceAdapter searchServiceAdapter,
- ElasticSearchSchemaConfig esSchemaConfig, RestEndpointConfig esEndpointConfig,
+ ElasticSearchSchemaConfig esSchemaConfig, RestEndpointConfig endpointConfig,
String tableConfigJson) {
this.searchServiceAdapter = searchServiceAdapter;
this.schemaConfig = esSchemaConfig;
- this.endpointConfig = esEndpointConfig;
+ this.endpointConfig = endpointConfig;
this.tableConfigJson = tableConfigJson;
}
"IndexIntegrityValidator.createOrRepair() for indexName = " + schemaConfig.getIndexName();
LOG.info(AaiUiMsgs.INFO_GENERIC, message);
- final String fullUrlStr = getFullUrl("/" + schemaConfig.getIndexName() + "/");
+ final String fullUrlStr = getFullUrl(schemaConfig.getIndexName() + "/");
OperationResult createResult =
searchServiceAdapter.doPut(fullUrlStr, tableConfigJson,"application/json");
for (IndexValidator validator : registeredIndexValidators) {
try {
- if (!validator.exists()) {
+
validator.createOrRepair();
- }
+
} catch (Exception exc) {
String message = "Index validator caused an error = " + exc.getMessage();
LOG.error(AaiUiMsgs.ERROR_GENERIC, message);