summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorTian Lee <TianL@amdocs.com>2017-09-21 08:39:15 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-21 08:39:15 +0000
commit949b35357f72491967fd905bc2123aa75a10b3f5 (patch)
tree4db716fb513d07245421bcf84c9ccbedddbb8ff3 /src/main
parentbc100947079d79c552cf254a5efadede4344a2ff (diff)
parente4ec0393447f52276aa246dad29f116487c9bb28 (diff)
Merge "Fix Blocker/Critical sonar issues"
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java b/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java
index b23764c..9ef4fe6 100644
--- a/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java
+++ b/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java
@@ -521,11 +521,6 @@ public class ElasticSearchIndexCleaner implements IndexCleaner {
}
JsonNode rootNode = parseElasticSearchResult(opResult.getResult());
- boolean timedOut = Boolean.parseBoolean(getFieldValue(rootNode, "timed_out"));
- final String tookStr = getFieldValue(rootNode, "took");
- int tookInMs = (tookStr == null) ? 0 : Integer.parseInt(tookStr);
-
- JsonNode hitsNode = rootNode.get("hits");
/*
* Check the result for success / failure, and enumerate all the index ids that resulted in
@@ -533,6 +528,11 @@ public class ElasticSearchIndexCleaner implements IndexCleaner {
*/
if (rootNode != null) {
+ boolean timedOut = Boolean.parseBoolean(getFieldValue(rootNode, "timed_out"));
+ final String tookStr = getFieldValue(rootNode, "took");
+ int tookInMs = (tookStr == null) ? 0 : Integer.parseInt(tookStr);
+
+ JsonNode hitsNode = rootNode.get("hits");
if (timedOut) {
LOG.info(AaiUiMsgs.COLLECT_TIME_WITH_ERROR, "Scroll Context", String.valueOf(tookInMs));
@@ -576,6 +576,9 @@ public class ElasticSearchIndexCleaner implements IndexCleaner {
}
}
+ } else {
+ // scroll context get failed, nothing else to do
+ LOG.error(AaiUiMsgs.ERROR_GENERIC, opResult.toString());
}
return OperationState.OK;