public void waitForIndexationCompletion(DimensionIndex di, int timeOutInSec) throws InterruptedException { logger.info("Checking indexation completion for index " + di.getDimensionName()); synchronized (di) { if (di.getStatus() != Status.DONE) { Thread.sleep(timeOutInSec * 1000); if (!lastIndexedDimension.containsKey(di.getDimension().getId()) && !lastIndexedCorrelation.containsKey(di.getDimension().getId())) { // handle empty index di.setDone(); } else { if (!di.isCorrelationIndexationDone( lastIndexedCorrelation.get(di.getDimension().getId()))) { logger.info("timeout during correlation indexing " + di.getDimensionName()); di.setPermanentError("timeout during correlation indexing"); } if (di.isDimensionIndexationDone(lastIndexedDimension.get(di.getDimension().getId()))) { logger.info("indexing ok " + di.getDimensionName()); di.setDone(); } else { logger.info("timeout during indexing " + di.getDimensionName()); di.setPermanentError("timeout during indexing"); } } } } }
public ExecuteHierarchyQueryResult( HashMap<DimensionIndex, String> dimensions, HashMap<DimensionIndex, String> correlations) { this.lastIndexedDimension = new HashMap<DimensionPK, String>(); for (DimensionIndex di : dimensions.keySet()) { this.lastIndexedDimension.put(di.getDimension().getId(), dimensions.get(di)); } this.lastIndexedCorrelation = new HashMap<DimensionPK, String>(); for (DimensionIndex di : correlations.keySet()) { this.lastIndexedCorrelation.put(di.getDimension().getId(), correlations.get(di)); } }