Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ public class SchoolListReader {
*/
@Inject
public SchoolListReader(final ISearchProvider searchProvider) {
log.info("Initializing SchoolListReader");
log.debug("Initializing SchoolListReader");
this.searchProvider = searchProvider;

String modificationDate;
try {
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");
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/uk/ac/cam/cl/dtg/segue/etl/ETLManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ boolean addOrMoveIndexAlias(final String aliasBase, final String indexBaseTarget
final List<String> indexTypeTargets) {
String indexWithPrevious = null; // This is the index that has the <alias>_previous alias
String indexWithCurrent = null; // This is the index that has the <alias> 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);
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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;
}
Expand Down
Loading