Skip to content

Commit

Permalink
HSEARCH-5180 Make log message on completed indexing include the numbe…
Browse files Browse the repository at this point in the history
…r of indexed documents

previously it was reporting the "expected" total number of entities, and if the mass indexer fails, that number would not reflect the number of actually indexed entities...
  • Loading branch information
marko-bekhta committed Sep 6, 2024
1 parent c69b5d1 commit d77d624
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ public interface Log extends BasicLogger {
@Message(id = ID_OFFSET_LEGACY_ENGINE + 27, value = "Mass indexing is going to index %d entities.")
void indexingEntities(long count);

@LogMessage(level = INFO)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 28, value = "Mass indexing complete. Indexed %1$d entities.")
void indexingEntitiesCompleted(long nbrOfEntities);

@LogMessage(level = ERROR)
@Message(id = ID_OFFSET_LEGACY_ENGINE + 62, value = "Mass indexing received interrupt signal: aborting.")
void interruptedBatchIndexing();
Expand Down Expand Up @@ -1036,4 +1032,8 @@ void indexingProgress(long doneCount, long totalCount, long typesToIndex, long e
value = "Mass indexing progress: indexed %6$.2f%% %1$d/%2$d entities in %3$d ms. Mass indexing speed: %4$f documents/second since last message, %5$f documents/second since start.")
void indexingProgress(long doneCount, long totalCount, long elapsedMs, float currentSpeed, float estimateSpeed,
float estimatePercentileComplete);

@LogMessage(level = INFO)
@Message(id = ID_OFFSET + 167, value = "Mass indexing complete. Indexed %1$d/%2$s entities.")
void indexingEntitiesCompleted(long indexed, String total);
}
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ protected void notifyInterrupted(InterruptedException exception) {
@Override
protected void notifyFailure(RuntimeException exception) {
super.notifyFailure( exception );
// TODO HSEARCH-3729 Call a different method when indexing failed?
getNotifier().reportIndexingCompleted();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ public void addToTotalCount(long count) {

@Override
public void indexingCompleted() {
log.indexingEntitiesCompleted( totalCounter.longValue() );
log.indexingEntitiesCompleted( documentsDoneCounter.longValue(),
groupsWithUnknownTotal.get() != 0 ? "?" : Long.toString( totalCounter.longValue() ) );
}

protected int getStatusMessagePeriod() {
Expand Down

0 comments on commit d77d624

Please sign in to comment.