2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.onap.aai.sparky.autosuggestion.sync;
25 import static java.util.concurrent.CompletableFuture.supplyAsync;
27 import java.io.IOException;
28 import java.util.ArrayList;
29 import java.util.Arrays;
30 import java.util.Collection;
31 import java.util.Deque;
32 import java.util.EnumSet;
33 import java.util.HashMap;
34 import java.util.Iterator;
35 import java.util.List;
37 import java.util.concurrent.ConcurrentHashMap;
38 import java.util.concurrent.ConcurrentLinkedDeque;
39 import java.util.concurrent.ExecutorService;
40 import java.util.concurrent.atomic.AtomicInteger;
41 import java.util.function.Supplier;
43 import org.onap.aai.cl.api.Logger;
44 import org.onap.aai.cl.eelf.LoggerFactory;
45 import org.onap.aai.cl.mdc.MdcContext;
46 import org.onap.aai.restclient.client.OperationResult;
47 import org.onap.aai.sparky.config.oxm.OxmEntityDescriptor;
48 import org.onap.aai.sparky.config.oxm.OxmEntityLookup;
49 import org.onap.aai.sparky.config.oxm.SuggestionEntityDescriptor;
50 import org.onap.aai.sparky.config.oxm.SuggestionEntityLookup;
51 import org.onap.aai.sparky.dal.ActiveInventoryAdapter;
52 import org.onap.aai.sparky.dal.NetworkTransaction;
53 import org.onap.aai.sparky.dal.rest.HttpMethod;
54 import org.onap.aai.sparky.logging.AaiUiMsgs;
55 import org.onap.aai.sparky.search.filters.config.FiltersConfig;
56 import org.onap.aai.sparky.sync.AbstractEntitySynchronizer;
57 import org.onap.aai.sparky.sync.IndexSynchronizer;
58 import org.onap.aai.sparky.sync.SynchronizerConstants;
59 import org.onap.aai.sparky.sync.config.ElasticSearchSchemaConfig;
60 import org.onap.aai.sparky.sync.config.NetworkStatisticsConfig;
61 import org.onap.aai.sparky.sync.entity.SelfLinkDescriptor;
62 import org.onap.aai.sparky.sync.entity.SuggestionSearchEntity;
63 import org.onap.aai.sparky.sync.enumeration.OperationState;
64 import org.onap.aai.sparky.sync.enumeration.SynchronizerState;
65 import org.onap.aai.sparky.sync.task.PerformActiveInventoryRetrieval;
66 import org.onap.aai.sparky.sync.task.PerformElasticSearchPut;
67 import org.onap.aai.sparky.sync.task.PerformElasticSearchRetrieval;
68 import org.onap.aai.sparky.util.NodeUtils;
69 import org.onap.aai.sparky.util.SuggestionsPermutation;
72 import com.fasterxml.jackson.core.JsonProcessingException;
73 import com.fasterxml.jackson.databind.JsonNode;
74 import com.fasterxml.jackson.databind.node.ArrayNode;
77 * The Class AutosuggestionSynchronizer.
79 public class AutosuggestionSynchronizer extends AbstractEntitySynchronizer
80 implements IndexSynchronizer {
82 private class RetrySuggestionEntitySyncContainer {
83 NetworkTransaction txn;
84 SuggestionSearchEntity ssec;
87 * Instantiates a new RetrySuggestionEntitySyncContainer.
90 * @param icer the icer
92 public RetrySuggestionEntitySyncContainer(NetworkTransaction txn, SuggestionSearchEntity icer) {
97 public NetworkTransaction getNetworkTransaction() {
101 public SuggestionSearchEntity getSuggestionSearchEntity() {
106 private static final Logger LOG =
107 LoggerFactory.getInstance().getLogger(AutosuggestionSynchronizer.class);
108 private static final String INSERTION_DATE_TIME_FORMAT = "yyyyMMdd'T'HHmmssZ";
110 private boolean allWorkEnumerated;
111 private Deque<SelfLinkDescriptor> selflinks;
112 private ConcurrentHashMap<String, AtomicInteger> entityCounters;
113 private boolean syncInProgress;
114 private Map<String, String> contextMap;
115 protected ExecutorService esPutExecutor;
116 private Deque<RetrySuggestionEntitySyncContainer> retryQueue;
117 private Map<String, Integer> retryLimitTracker;
118 private OxmEntityLookup oxmEntityLookup;
119 private SuggestionEntityLookup suggestionEntityLookup;
120 private FiltersConfig filtersConfig;
123 * Instantiates a new historical entity summarizer.
125 * @param indexName the index name
126 * @throws Exception the exception
128 public AutosuggestionSynchronizer(ElasticSearchSchemaConfig schemaConfig, int internalSyncWorkers,
129 int aaiWorkers, int esWorkers, NetworkStatisticsConfig aaiStatConfig,
130 NetworkStatisticsConfig esStatConfig, OxmEntityLookup oxmEntityLookup,
131 SuggestionEntityLookup suggestionEntityLookup, FiltersConfig filtersConfig) throws Exception {
133 super(LOG, "ASES-" + schemaConfig.getIndexName().toUpperCase(), internalSyncWorkers, aaiWorkers,
134 esWorkers, schemaConfig.getIndexName(), aaiStatConfig, esStatConfig);
136 this.oxmEntityLookup = oxmEntityLookup;
137 this.suggestionEntityLookup = suggestionEntityLookup;
138 this.allWorkEnumerated = false;
139 this.selflinks = new ConcurrentLinkedDeque<SelfLinkDescriptor>();
140 this.entityCounters = new ConcurrentHashMap<String, AtomicInteger>();
141 this.synchronizerName = "Autosuggestion Entity Synchronizer";
142 this.enabledStatFlags = EnumSet.of(StatFlag.AAI_REST_STATS, StatFlag.ES_REST_STATS);
143 this.syncInProgress = false;
144 this.contextMap = MDC.getCopyOfContextMap();
145 this.esPutExecutor = NodeUtils.createNamedExecutor("SUES-ES-PUT", 5, LOG);
146 this.syncDurationInMs = -1;
147 this.filtersConfig = filtersConfig;
151 * Collect all the work.
153 * @return the operation state
155 private OperationState collectAllTheWork() {
156 final Map<String, String> contextMap = MDC.getCopyOfContextMap();
157 Map<String, SuggestionEntityDescriptor> descriptorMap =
158 suggestionEntityLookup.getSuggestionSearchEntityDescriptors();
160 if (descriptorMap.isEmpty()) {
161 LOG.error(AaiUiMsgs.ERROR_LOADING_OXM_SUGGESTIBLE_ENTITIES);
162 LOG.info(AaiUiMsgs.ERROR_LOADING_OXM_SUGGESTIBLE_ENTITIES);
163 return OperationState.ERROR;
166 Collection<String> syncTypes = descriptorMap.keySet();
171 * launch a parallel async thread to process the documents for each entity-type (to max the of
172 * the configured executor anyway)
175 aaiWorkOnHand.set(syncTypes.size());
177 for (String key : syncTypes) {
179 supplyAsync(new Supplier<Void>() {
183 MDC.setContextMap(contextMap);
184 OperationResult typeLinksResult = null;
186 typeLinksResult = aaiAdapter.getSelfLinksByEntityType(key);
187 aaiWorkOnHand.decrementAndGet();
188 processEntityTypeSelfLinks(typeLinksResult);
189 } catch (Exception exc) {
190 // TODO -> LOG, what should be logged here?
196 }, aaiExecutor).whenComplete((result, error) -> {
199 LOG.error(AaiUiMsgs.ERROR_GENERIC,
200 "An error occurred getting data from AAI. Error = " + error.getMessage());
206 while (aaiWorkOnHand.get() != 0) {
208 if (LOG.isDebugEnabled()) {
209 LOG.debug(AaiUiMsgs.WAIT_FOR_ALL_SELFLINKS_TO_BE_COLLECTED);
215 aaiWorkOnHand.set(selflinks.size());
216 allWorkEnumerated = true;
219 while (!isSyncDone()) {
225 * Make sure we don't hang on to retries that failed which could cause issues during future
228 retryLimitTracker.clear();
230 } catch (Exception exc) {
231 // TODO -> LOG, waht should be logged here?
234 return OperationState.OK;
241 * @see org.openecomp.sparky.synchronizer.IndexSynchronizer#doSync()
244 public OperationState doSync() {
245 this.syncDurationInMs = -1;
246 syncStartedTimeStampInMs = System.currentTimeMillis();
247 String txnID = NodeUtils.getRandomTxnId();
248 MdcContext.initialize(txnID, "AutosuggestionSynchronizer", "", "Sync", "");
250 return collectAllTheWork();
254 * Process entity type self links.
256 * @param operationResult the operation result
258 private void processEntityTypeSelfLinks(OperationResult operationResult) {
260 JsonNode rootNode = null;
262 final String jsonResult = operationResult.getResult();
264 if (jsonResult != null && jsonResult.length() > 0 && operationResult.wasSuccessful()) {
267 rootNode = mapper.readTree(jsonResult);
268 } catch (IOException exc) {
269 String message = "Could not deserialize JSON (representing operation result) as node tree. "
270 + "Operation result = " + jsonResult + ". " + exc.getLocalizedMessage();
271 LOG.error(AaiUiMsgs.JSON_PROCESSING_ERROR, message);
274 JsonNode resultData = rootNode.get("result-data");
275 ArrayNode resultDataArrayNode = null;
277 if (resultData.isArray()) {
278 resultDataArrayNode = (ArrayNode) resultData;
280 Iterator<JsonNode> elementIterator = resultDataArrayNode.elements();
281 JsonNode element = null;
283 while (elementIterator.hasNext()) {
284 element = elementIterator.next();
286 final String resourceType = NodeUtils.getNodeFieldAsText(element, "resource-type");
287 final String resourceLink = NodeUtils.getNodeFieldAsText(element, "resource-link");
289 OxmEntityDescriptor descriptor = null;
291 if (resourceType != null && resourceLink != null) {
293 descriptor = oxmEntityLookup.getEntityDescriptors().get(resourceType);
295 if (descriptor == null) {
296 LOG.error(AaiUiMsgs.MISSING_ENTITY_DESCRIPTOR, resourceType);
297 // go to next element in iterator
300 selflinks.add(new SelfLinkDescriptor(resourceLink,
301 SynchronizerConstants.NODES_ONLY_MODIFIER, resourceType));
313 private void syncEntityTypes() {
315 while (selflinks.peek() != null) {
317 SelfLinkDescriptor linkDescriptor = selflinks.poll();
318 aaiWorkOnHand.decrementAndGet();
320 OxmEntityDescriptor descriptor = null;
322 if (linkDescriptor.getSelfLink() != null && linkDescriptor.getEntityType() != null) {
324 descriptor = oxmEntityLookup.getEntityDescriptors().get(linkDescriptor.getEntityType());
326 if (descriptor == null) {
327 LOG.error(AaiUiMsgs.MISSING_ENTITY_DESCRIPTOR, linkDescriptor.getEntityType());
328 // go to next element in iterator
332 NetworkTransaction txn = new NetworkTransaction();
333 txn.setDescriptor(descriptor);
334 txn.setLink(linkDescriptor.getSelfLink());
335 txn.setOperationType(HttpMethod.GET);
336 txn.setEntityType(linkDescriptor.getEntityType());
338 aaiWorkOnHand.incrementAndGet();
340 supplyAsync(new PerformActiveInventoryRetrieval(txn, aaiAdapter), aaiExecutor)
341 .whenComplete((result, error) -> {
343 aaiWorkOnHand.decrementAndGet();
346 LOG.error(AaiUiMsgs.AAI_RETRIEVAL_FAILED_GENERIC, error.getLocalizedMessage());
348 if (result == null) {
349 LOG.error(AaiUiMsgs.AAI_RETRIEVAL_FAILED_FOR_SELF_LINK,
350 linkDescriptor.getSelfLink());
352 updateActiveInventoryCounters(result);
353 fetchDocumentForUpsert(result);
364 * Return a set of valid suggestion attributes for the provided entityName
365 * that are present in the JSON
366 * @param node JSON node in which the attributes should be found
367 * @param entityName Name of the entity
368 * @return List of all valid suggestion attributes(key's)
370 public List<String> getSuggestableAttrNamesFromReponse(JsonNode node, String entityName) {
371 List<String> suggestableAttr = new ArrayList<String>();
372 HashMap<String, String> desc =
373 suggestionEntityLookup.getSuggestionSearchEntityOxmModel().get(entityName);
374 String attr = desc.get("suggestibleAttributes");
375 suggestableAttr = Arrays.asList(attr.split(","));
376 List<String> suggestableValue = new ArrayList<>();
377 for (String attribute : suggestableAttr) {
378 if (node.get(attribute) != null && node.get(attribute).asText().length() > 0) {
379 suggestableValue.add(attribute);
382 return suggestableValue;
386 * Fetch all the documents for upsert. Based on the number of permutations that are available the
387 * number of documents will be different
391 private void fetchDocumentForUpsert(NetworkTransaction txn) {
392 if (!txn.getOperationResult().wasSuccessful()) {
393 String message = "Self link failure. Result - " + txn.getOperationResult().getResult();
394 LOG.error(AaiUiMsgs.ERROR_GENERIC, message);
398 final String jsonResult = txn.getOperationResult().getResult();
400 if (jsonResult != null && jsonResult.length() > 0) {
402 // Step 1: Calculate the number of possible permutations of attributes
403 String entityName = txn.getDescriptor().getEntityName();
404 JsonNode entityNode = mapper.readTree(jsonResult);
406 List<String> availableSuggestableAttrName =
407 getSuggestableAttrNamesFromReponse(entityNode, entityName);
409 ArrayList<ArrayList<String>> uniqueLists =
410 SuggestionsPermutation.getNonEmptyUniqueLists(availableSuggestableAttrName);
411 // Now we have a list of all possible permutations for the status that are
412 // defined for this entity type. Try inserting a document for every combination.
413 for (ArrayList<String> uniqueList : uniqueLists) {
415 SuggestionSearchEntity sse = new SuggestionSearchEntity(filtersConfig, suggestionEntityLookup);
416 sse.setSuggestableAttr(uniqueList);
417 sse.setFilterBasedPayloadFromResponse(entityNode, entityName, uniqueList);
418 sse.setLink(ActiveInventoryAdapter.extractResourcePath(txn.getLink()));
419 populateSuggestionSearchEntityDocument(sse, jsonResult, txn);
420 // The unique id for the document will be created at derive fields
422 // Insert the document only if it has valid statuses
423 if (sse.isSuggestableDoc()) {
426 link = elasticSearchAdapter.buildElasticSearchGetDocUrl(getIndexName(), sse.getId());
427 } catch (Exception exc) {
428 LOG.error(AaiUiMsgs.ES_FAILED_TO_CONSTRUCT_QUERY, exc.getLocalizedMessage());
432 NetworkTransaction n2 = new NetworkTransaction();
434 n2.setEntityType(txn.getEntityType());
435 n2.setDescriptor(txn.getDescriptor());
436 n2.setOperationType(HttpMethod.GET);
438 esWorkOnHand.incrementAndGet();
440 supplyAsync(new PerformElasticSearchRetrieval(n2, elasticSearchAdapter), esExecutor)
441 .whenComplete((result, error) -> {
443 esWorkOnHand.decrementAndGet();
446 LOG.error(AaiUiMsgs.ES_RETRIEVAL_FAILED, error.getLocalizedMessage());
448 updateElasticSearchCounters(result);
449 performDocumentUpsert(result, sse);
456 } catch (JsonProcessingException exc) {
457 // TODO -> LOG, waht should be logged here?
458 } catch (IOException exc) {
459 // TODO -> LOG, waht should be logged here?
463 protected void populateSuggestionSearchEntityDocument(SuggestionSearchEntity sse, String result,
464 NetworkTransaction txn) throws JsonProcessingException, IOException {
466 OxmEntityDescriptor resultDescriptor = txn.getDescriptor();
468 sse.setEntityType(resultDescriptor.getEntityName());
470 JsonNode entityNode = mapper.readTree(result);
472 List<String> primaryKeyValues = new ArrayList<String>();
473 String pkeyValue = null;
475 for (String keyName : resultDescriptor.getPrimaryKeyAttributeNames()) {
476 pkeyValue = NodeUtils.getNodeFieldAsText(entityNode, keyName);
477 if (pkeyValue != null) {
478 primaryKeyValues.add(pkeyValue);
480 String message = "populateSuggestionSearchEntityDocument(),"
481 + " pKeyValue is null for entityType = " + resultDescriptor.getEntityName();
482 LOG.warn(AaiUiMsgs.WARN_GENERIC, message);
486 final String primaryCompositeKeyValue = NodeUtils.concatArray(primaryKeyValues, "/");
487 sse.setEntityPrimaryKeyValue(primaryCompositeKeyValue);
488 sse.generateSuggestionInputPermutations();
491 protected void performDocumentUpsert(NetworkTransaction esGetTxn, SuggestionSearchEntity sse) {
495 * As part of the response processing we need to do the following:
496 * <li>1. Extract the version (if present), it will be the ETAG when we use the
497 * Search-Abstraction-Service
498 * <li>2. Spawn next task which is to do the PUT operation into elastic with or with the version
500 * <li>a) if version is null or RC=404, then standard put, no _update with version tag
501 * <li>b) if version != null, do PUT with _update?version= versionNumber in the URI to elastic
507 link = elasticSearchAdapter.buildElasticSearchGetDocUrl(getIndexName(), sse.getId());
508 } catch (Exception exc) {
509 LOG.error(AaiUiMsgs.ES_LINK_UPSERT, exc.getLocalizedMessage());
513 boolean wasEntryDiscovered = false;
514 if (esGetTxn.getOperationResult().getResultCode() == 404) {
515 LOG.info(AaiUiMsgs.ES_SIMPLE_PUT, sse.getEntityPrimaryKeyValue());
516 } else if (esGetTxn.getOperationResult().getResultCode() == 200) {
517 wasEntryDiscovered = true;
520 * Not being a 200 does not mean a failure. eg 201 is returned for created. and 500 for es not
521 * found TODO -> Should we return.
523 LOG.error(AaiUiMsgs.ES_OPERATION_RETURN_CODE,
524 String.valueOf(esGetTxn.getOperationResult().getResultCode()));
527 // Insert a new document only if the paylod is different.
528 // This is determined by hashing the payload and using it as a id for the document
530 if (!wasEntryDiscovered) {
532 String jsonPayload = null;
534 jsonPayload = sse.getAsJson();
535 if (link != null && jsonPayload != null) {
537 NetworkTransaction updateElasticTxn = new NetworkTransaction();
538 updateElasticTxn.setLink(link);
539 updateElasticTxn.setEntityType(esGetTxn.getEntityType());
540 updateElasticTxn.setDescriptor(esGetTxn.getDescriptor());
541 updateElasticTxn.setOperationType(HttpMethod.PUT);
543 esWorkOnHand.incrementAndGet();
544 supplyAsync(new PerformElasticSearchPut(jsonPayload, updateElasticTxn, elasticSearchAdapter),
545 esPutExecutor).whenComplete((result, error) -> {
547 esWorkOnHand.decrementAndGet();
550 String message = "Suggestion search entity sync UPDATE PUT error - "
551 + error.getLocalizedMessage();
552 LOG.error(AaiUiMsgs.ES_SUGGESTION_SEARCH_ENTITY_SYNC_ERROR, message);
554 updateElasticSearchCounters(result);
555 processStoreDocumentResult(result, esGetTxn, sse);
559 } catch (Exception exc) {
561 "Exception caught during suggestion search entity sync PUT operation. Message - "
562 + exc.getLocalizedMessage();
563 LOG.error(AaiUiMsgs.ES_SUGGESTION_SEARCH_ENTITY_SYNC_ERROR, message);
568 private void processStoreDocumentResult(NetworkTransaction esPutResult,
569 NetworkTransaction esGetResult, SuggestionSearchEntity sse) {
571 OperationResult or = esPutResult.getOperationResult();
573 if (!or.wasSuccessful()) {
574 if (or.getResultCode() == VERSION_CONFLICT_EXCEPTION_CODE) {
576 if (shouldAllowRetry(sse.getId())) {
577 esWorkOnHand.incrementAndGet();
579 RetrySuggestionEntitySyncContainer rssec =
580 new RetrySuggestionEntitySyncContainer(esGetResult, sse);
581 retryQueue.push(rssec);
583 String message = "Store document failed during suggestion search entity synchronization"
584 + " due to version conflict. Entity will be re-synced.";
585 LOG.warn(AaiUiMsgs.ES_SUGGESTION_SEARCH_ENTITY_SYNC_ERROR, message);
589 "Store document failed during suggestion search entity synchronization with result code "
590 + or.getResultCode() + " and result message " + or.getResult();
591 LOG.error(AaiUiMsgs.ES_SUGGESTION_SEARCH_ENTITY_SYNC_ERROR, message);
597 * Perform retry sync.
599 private void performRetrySync() {
600 while (retryQueue.peek() != null) {
602 RetrySuggestionEntitySyncContainer susc = retryQueue.poll();
605 SuggestionSearchEntity sus = susc.getSuggestionSearchEntity();
606 NetworkTransaction txn = susc.getNetworkTransaction();
611 * In this retry flow the se object has already derived its fields
613 link = elasticSearchAdapter.buildElasticSearchGetDocUrl(getIndexName(), sus.getId());
614 } catch (Exception exc) {
615 LOG.error(AaiUiMsgs.ES_FAILED_TO_CONSTRUCT_URI, exc.getLocalizedMessage());
619 NetworkTransaction retryTransaction = new NetworkTransaction();
620 retryTransaction.setLink(link);
621 retryTransaction.setEntityType(txn.getEntityType());
622 retryTransaction.setDescriptor(txn.getDescriptor());
623 retryTransaction.setOperationType(HttpMethod.GET);
626 * IMPORTANT - DO NOT incrementAndGet the esWorkOnHand as this is a retry flow! We already
627 * called incrementAndGet when queuing the failed PUT!
630 supplyAsync(new PerformElasticSearchRetrieval(retryTransaction, elasticSearchAdapter),
631 esExecutor).whenComplete((result, error) -> {
633 esWorkOnHand.decrementAndGet();
636 LOG.error(AaiUiMsgs.ES_RETRIEVAL_FAILED_RESYNC, error.getLocalizedMessage());
638 updateElasticSearchCounters(result);
639 performDocumentUpsert(result, sus);
649 * Should allow retry.
652 * @return true, if successful
654 private boolean shouldAllowRetry(String id) {
655 boolean isRetryAllowed = true;
656 if (retryLimitTracker.get(id) != null) {
657 Integer currentCount = retryLimitTracker.get(id);
658 if (currentCount.intValue() >= RETRY_COUNT_PER_ENTITY_LIMIT.intValue()) {
659 isRetryAllowed = false;
660 String message = "Searchable entity re-sync limit reached for " + id
661 + ", re-sync will no longer be attempted for this entity";
662 LOG.error(AaiUiMsgs.ES_SEARCHABLE_ENTITY_SYNC_ERROR, message);
664 Integer newCount = new Integer(currentCount.intValue() + 1);
665 retryLimitTracker.put(id, newCount);
668 Integer firstRetryCount = new Integer(1);
669 retryLimitTracker.put(id, firstRetryCount);
672 return isRetryAllowed;
678 public SynchronizerState getState() {
681 return SynchronizerState.PERFORMING_SYNCHRONIZATION;
684 return SynchronizerState.IDLE;
691 * @see org.openecomp.sparky.synchronizer.IndexSynchronizer#getStatReport(boolean)
694 public String getStatReport(boolean showFinalReport) {
695 syncDurationInMs = System.currentTimeMillis() - syncStartedTimeStampInMs;
696 return getStatReport(syncDurationInMs, showFinalReport);
702 * @see org.openecomp.sparky.synchronizer.IndexSynchronizer#shutdown()
705 public void shutdown() {
706 this.shutdownExecutors();
710 protected boolean isSyncDone() {
712 int totalWorkOnHand = aaiWorkOnHand.get() + esWorkOnHand.get();
714 if (LOG.isDebugEnabled()) {
715 LOG.debug(AaiUiMsgs.DEBUG_GENERIC, indexName + ", isSyncDone(), totalWorkOnHand = "
716 + totalWorkOnHand + " all work enumerated = " + allWorkEnumerated);
719 if (totalWorkOnHand > 0 || !allWorkEnumerated) {
723 this.syncInProgress = false;
731 * @see org.openecomp.sparky.synchronizer.AbstractEntitySynchronizer#clearCache()
734 public void clearCache() {
736 if (syncInProgress) {
737 LOG.debug(AaiUiMsgs.DEBUG_GENERIC,
738 "Autosuggestion Entity Summarizer in progress, request to clear cache ignored");
743 this.resetCounters();
744 if (entityCounters != null) {
745 entityCounters.clear();
748 allWorkEnumerated = false;