Skip to content

Commit

Permalink
HSEARCH-5249 Move a MassIndexingTypeGroupMonitor#indexingCompleted ca…
Browse files Browse the repository at this point in the history
…ll to right before the indexing completed log message
  • Loading branch information
marko-bekhta committed Sep 27, 2024
1 parent 4defce7 commit 98c7f0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
class MassIndexingStreamingLoaderIT {

private static final int BOOK_COUNT = 500;
private static final int ARTICLE_COUNT = 1500;
private static final int ARTICLE_COUNT = 5500;

@RegisterExtension
public final BackendMock backendMock = BackendMock.create();
Expand Down Expand Up @@ -75,7 +75,7 @@ void oneAtATime() {

logged.expectEvent( Level.INFO, "Mass indexed ", ". Speed", "instant, ", "since start",
"Remaining: unknown, 1 type(s) pending" );
logged.expectEvent( Level.INFO, "Mass indexed", "/2000. Speed", "Remaining: ", ", approx. PT" );
logged.expectEvent( Level.INFO, "Mass indexed", "/6000. Speed", "Remaining: ", ", approx. PT" );

try {
mapping.scope( Object.class ).massIndexer()
Expand Down Expand Up @@ -108,7 +108,7 @@ void allTogether() {
expectIndexingWorks();

logged.expectEvent( Level.INFO, "Mass indexed ", ". Speed", "instant, ", "since start", "Remaining: unknown" );
logged.expectEvent( Level.INFO, "Mass indexed", "/2000. Speed", "Remaining: ", ", approx. PT" );
logged.expectEvent( Level.INFO, "Mass indexed", "/6000. Speed", "Remaining: ", ", approx. PT" );

try {
mapping.scope( Object.class ).massIndexer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public void runWithFailureHandler() throws InterruptedException {
allFutures.addAll( identifierProducingFutures );
allFutures.addAll( indexingFutures );
Futures.unwrappedExceptionGet( Futures.firstFailureOrAllOf( allFutures ) );
typeGroupMonitor.indexingCompleted();
log.debugf( "Indexing for %s is done", typeGroup.notifiedGroupName() );
}

Expand Down Expand Up @@ -144,8 +145,6 @@ massIndexingContext, getMassIndexingEnvironment(),
for ( int i = 0; i < entityExtractingThreads; i++ ) {
indexingFutures.add( Futures.runAsync( runnable, indexingExecutor ) );
}
CompletableFuture.allOf( indexingFutures.toArray( CompletableFuture[]::new ) )
.thenRun( typeGroupMonitor::indexingCompleted );
}
finally {
indexingExecutor.shutdown();
Expand Down

0 comments on commit 98c7f0f

Please sign in to comment.