From bd9c90e162cf30b5d7e240f20a29bb3fc3092a7e Mon Sep 17 00:00:00 2001 From: renealr Date: Fri, 24 Aug 2018 15:33:08 -0400 Subject: remove extra slash needed for index creation Issue-ID: AAI-1543 Change-Id: I8c8ec703c6bdc7654dc02e929a727c5b4d0f0179 Signed-off-by: renealr --- .../main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java | 6 +++--- .../src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java index c9d8272..ee5d6fb 100644 --- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java @@ -55,12 +55,12 @@ public class IndexIntegrityValidator implements IndexValidator { * @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; } @@ -137,7 +137,7 @@ public class IndexIntegrityValidator implements IndexValidator { "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"); diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java index 7c81074..c385ce0 100644 --- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java @@ -517,9 +517,9 @@ public class SyncControllerImpl implements SyncController { 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); -- cgit 1.2.3-korg