diff --git a/src/main/java/uk/ac/cam/cl/dtg/segue/dao/schools/SchoolListReader.java b/src/main/java/uk/ac/cam/cl/dtg/segue/dao/schools/SchoolListReader.java index 8b722c4d09..f455c7be48 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/segue/dao/schools/SchoolListReader.java +++ b/src/main/java/uk/ac/cam/cl/dtg/segue/dao/schools/SchoolListReader.java @@ -68,7 +68,7 @@ public class SchoolListReader { */ @Inject public SchoolListReader(final ISearchProvider searchProvider) { - log.info("Initializing SchoolListReader"); + log.debug("Initializing SchoolListReader"); this.searchProvider = searchProvider; String modificationDate; @@ -76,13 +76,13 @@ public SchoolListReader(final ISearchProvider searchProvider) { modificationDate = searchProvider.getById( SCHOOLS_INDEX_BASE, SchoolsIndexType.METADATA.toString(), "sourceFile").getSource().get("lastModified") .toString(); - log.info("School list data source modification date: {}", modificationDate); + log.debug("School list data source modification date: {}", modificationDate); } catch (SegueSearchException | ElasticsearchStatusException e) { log.error("Failed to retrieve school list modification date", e); modificationDate = "unknown"; } dataSourceModificationDate = modificationDate; - log.info("SchoolListReader initialized successfully"); + log.debug("SchoolListReader initialized successfully"); } /** diff --git a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java index 582f9a6a79..cc2eef4482 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java +++ b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java @@ -121,7 +121,7 @@ void loadAndIndexContent(final String version) throws Exception, VersionLockedEx throw new VersionLockedException(version); } - log.info("Acquired lock for version " + sanitiseInternalLogValue(version) + ". Indexing."); + log.debug("Acquired lock for version " + sanitiseInternalLogValue(version) + ". Indexing."); try { @@ -131,7 +131,7 @@ void loadAndIndexContent(final String version) throws Exception, VersionLockedEx // The case where only some of the content types have been successfully indexed for this version, should // never happen but is covered by an expunge at the start of #buildElasticSearchIndex(...). if (allContentTypesAreIndexedForVersion(version)) { - log.info("Content already indexed: " + sanitiseInternalLogValue(version)); + log.debug("Content already indexed: " + sanitiseInternalLogValue(version)); return; } diff --git a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ETLManager.java b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ETLManager.java index 77e9264878..382e913d07 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ETLManager.java +++ b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ETLManager.java @@ -55,10 +55,10 @@ class ETLManager { } void setNamedVersion(final String alias, final String version) throws Exception { - log.info("Requested aliased version: {} - {}", alias, version); + log.debug("Requested aliased version: {} - {}", alias, version); indexer.loadAndIndexContent(version); indexer.setNamedVersion(alias, version); - log.info("Version {} with alias '{}' is successfully indexed.", version, alias); + log.debug("Version {} with alias '{}' is successfully indexed.", version, alias); } // Indexes all content in idempotent fashion. If the content is already indexed no action is taken. @@ -95,13 +95,13 @@ private class ContentIndexerTask implements Runnable { @Override public void run() { - log.info("Starting content indexer thread."); + log.debug("Starting content indexer thread."); try { indexContent(); } catch (Exception e) { log.error("ContentIndexerTask failed.", e); } - log.info("Content indexer thread complete, waiting for next scheduled run."); + log.debug("Content indexer thread complete, waiting for next scheduled run."); } } } diff --git a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java index c5dba09c59..7207c6475d 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java +++ b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java @@ -191,6 +191,7 @@ boolean addOrMoveIndexAlias(final String aliasBase, final String indexBaseTarget final List indexTypeTargets) { String indexWithPrevious = null; // This is the index that has the _previous alias String indexWithCurrent = null; // This is the index that has the alias. + int alreadyCorrectCount = 0; // Count of aliases that don't need moving (reduces log noise) for (String indexTypeTarget : indexTypeTargets) { String typedAlias = ElasticSearchProvider.produceTypedIndexName(aliasBase, indexTypeTarget); @@ -242,8 +243,7 @@ boolean addOrMoveIndexAlias(final String aliasBase, final String indexBaseTarget } if (indexWithCurrent != null && indexWithCurrent.equals(typedIndexTarget)) { - log.info("Not moving alias '" + sanitiseInternalLogValue(typedAlias) - + "' - it already points to the right index."); + alreadyCorrectCount++; } else { IndicesAliasesRequest request = new IndicesAliasesRequest(); @@ -284,6 +284,7 @@ boolean addOrMoveIndexAlias(final String aliasBase, final String indexBaseTarget } } + log.debug("{}/{} aliases already correct, no moves needed.", alreadyCorrectCount, indexTypeTargets.size()); this.expungeOldIndices(); return true; }