Skip to content

Commit

Permalink
void on setNormalisedBytesParsedOn
Browse files Browse the repository at this point in the history
  • Loading branch information
pgomulka committed Jul 8, 2024
1 parent 444835c commit 8529895
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public long normalisedBytesParsed() {
}

@Override
public IndexRequest setNormalisedBytesParsedOn(IndexRequest indexRequest) {
return indexRequest.setNormalisedBytesParsed(mapCounter);
public void setNormalisedBytesParsedOn(IndexRequest indexRequest) {
indexRequest.setNormalisedBytesParsed(mapCounter);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ public long normalisedBytesParsed() {
}

@Override
public IndexRequest setNormalisedBytesParsedOn(IndexRequest indexRequest) {
return indexRequest.setNormalisedBytesParsed(counter);
public void setNormalisedBytesParsedOn(IndexRequest indexRequest) {
indexRequest.setNormalisedBytesParsed(counter);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Result prepareUpdateScriptRequest(ShardId shardId, UpdateRequest request, GetRes
.waitForActiveShards(request.waitForActiveShards())
.timeout(request.timeout())
.setRefreshPolicy(request.getRefreshPolicy());
indexRequest = documentSizeObserver.setNormalisedBytesParsedOn(indexRequest);
documentSizeObserver.setNormalisedBytesParsedOn(indexRequest);
return new Result(indexRequest, DocWriteResponse.Result.UPDATED, updatedSourceAsMap, updateSourceContentType);
}
case DELETE -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ public long normalisedBytesParsed() {
*/
long normalisedBytesParsed();

default IndexRequest setNormalisedBytesParsedOn(IndexRequest indexRequest) {
return indexRequest;
}
default void setNormalisedBytesParsedOn(IndexRequest indexRequest) {}

default boolean isUpdateByScript() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1189,9 +1189,9 @@ public long normalisedBytesParsed() {
}

@Override
public IndexRequest setNormalisedBytesParsedOn(IndexRequest indexRequest) {
public void setNormalisedBytesParsedOn(IndexRequest indexRequest) {
parsedValueWasUsed.incrementAndGet();
return indexRequest.setNormalisedBytesParsed(0L);
indexRequest.setNormalisedBytesParsed(0L);
}
};
}
Expand Down

0 comments on commit 8529895

Please sign in to comment.