Skip to content

Commit

Permalink
code review followup
Browse files Browse the repository at this point in the history
  • Loading branch information
pgomulka committed Jul 10, 2024
1 parent 6c13ca7 commit a363a8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ public IndexResult index(Index index) throws IOException {
DocumentSizeAccumulator.EMPTY_INSTANCE
);
ParsedDocument parsedDocument = index.parsedDoc();
DocumentSizeObserver documentSizeObserver = parsedDocument.getDocumentSizeObserver();
documentParsingReporter.onIndexingCompleted(documentSizeObserver);
documentParsingReporter.onIndexingCompleted(parsedDocument);

return result;
}
Expand Down Expand Up @@ -151,8 +150,8 @@ public TestDocumentSizeReporter(String indexName) {
}

@Override
public void onIndexingCompleted(DocumentSizeObserver documentSizeObserver) {
COUNTER.addAndGet(documentSizeObserver.normalisedBytesParsed());
public void onIndexingCompleted(ParsedDocument parsedDocument) {
COUNTER.addAndGet(parsedDocument.getDocumentSizeObserver().normalisedBytesParsed());
assertThat(indexName, equalTo(TEST_INDEX_NAME));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package org.elasticsearch.plugins.internal;

import org.elasticsearch.index.mapper.ParsedDocument;

/**
* An interface to allow performing an action when parsing and indexing has been completed
*/
Expand All @@ -21,10 +23,10 @@ public interface DocumentSizeReporter {
/**
* An action to be performed upon finished indexing.
*/
default void onParsingCompleted(DocumentSizeObserver documentSizeObserver) {}
default void onParsingCompleted(ParsedDocument parsedDocument) {}

/**
* An action to be performed upon finished indexing.
*/
default void onIndexingCompleted(DocumentSizeObserver documentSizeObserver) {}
default void onIndexingCompleted(ParsedDocument parsedDocument) {}
}

0 comments on commit a363a8f

Please sign in to comment.