diff options
author | ARUL NAMBI <arul.nambi@amdocs.com> | 2017-07-25 14:46:08 -0400 |
---|---|---|
committer | ARUL NAMBI <arul.nambi@amdocs.com> | 2017-07-25 14:46:59 -0400 |
commit | d4241a5c945d04e44716851cfd2b7ef427accb48 (patch) | |
tree | 805b432231bca7732ea30af365d2b53f534c0ddd /src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java | |
parent | f8de1f25e7c71380a61b96d5251f224e3a4c821f (diff) |
Fixing the sync issues with AAI
Issue-ID: AAI-73
Change-Id: I5c7df7c24c59c347b112cdb003eea726e239a1ca
Signed-off-by: ARUL NAMBI <arul.nambi@amdocs.com>
Diffstat (limited to 'src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java')
-rw-r--r-- | src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java b/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java index e53c5a7..2715b61 100644 --- a/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java +++ b/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java @@ -28,8 +28,6 @@ package org.openecomp.sparky.synchronizer; import static java.util.concurrent.CompletableFuture.supplyAsync; import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collection; import java.util.Deque; @@ -41,6 +39,7 @@ import java.util.function.Supplier; import org.openecomp.cl.api.Logger; import org.openecomp.cl.eelf.LoggerFactory; +import org.openecomp.cl.mdc.MdcContext; import org.openecomp.sparky.config.oxm.OxmEntityDescriptor; import org.openecomp.sparky.dal.NetworkTransaction; import org.openecomp.sparky.dal.elasticsearch.config.ElasticSearchConfig; @@ -56,7 +55,6 @@ import org.openecomp.sparky.synchronizer.task.StoreDocumentTask; import org.openecomp.sparky.util.NodeUtils; import org.slf4j.MDC; -import org.openecomp.cl.mdc.MdcContext; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; @@ -90,7 +88,7 @@ public class GeoSynchronizer extends AbstractEntitySynchronizer implements Index this.geoDescriptorMap = oxmModelLoader.getGeoEntityDescriptors(); this.aaiEntityStats.initializeCountersFromOxmEntityDescriptors(geoDescriptorMap); this.esEntityStats.initializeCountersFromOxmEntityDescriptors(geoDescriptorMap); - + this.syncDurationInMs = -1; } @@ -126,6 +124,7 @@ public class GeoSynchronizer extends AbstractEntitySynchronizer implements Index } if (geoDescriptorMap.isEmpty()) { + setShouldSkipSync(true); LOG.error(AaiUiMsgs.OXM_FAILED_RETRIEVAL, "geo entities"); return OperationState.ERROR; } @@ -401,8 +400,8 @@ public class GeoSynchronizer extends AbstractEntitySynchronizer implements Index */ @Override public String getStatReport(boolean showFinalReport) { - return this.getStatReport(System.currentTimeMillis() - syncStartedTimeStampInMs, - showFinalReport); + syncDurationInMs = System.currentTimeMillis() - syncStartedTimeStampInMs; + return this.getStatReport(syncDurationInMs, showFinalReport); } /* (non-Javadoc) |