diff --git a/server/src/internalClusterTest/java/org/elasticsearch/plugins/internal/DocumentSizeObserverIT.java b/server/src/internalClusterTest/java/org/elasticsearch/plugins/internal/DocumentSizeObserverIT.java index 1ec20e358c879..cd5c34199ebe2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/plugins/internal/DocumentSizeObserverIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/plugins/internal/DocumentSizeObserverIT.java @@ -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; } @@ -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)); } } diff --git a/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeReporter.java b/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeReporter.java index ff968e8d5b7fc..3b9d0e75b7b1f 100644 --- a/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeReporter.java +++ b/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeReporter.java @@ -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 */ @@ -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) {} }