Skip to content

Commit a0a0c8e

Browse files
committed
Add withEngineOrNullIfBeingReset
And deprecate old style getEngine/OrNull methods. Apply new functionality to several methods that do not need to wait for the engine being reset and can do with a null engine. These pertain typically to periodic operations that can skip a shard being reset and revisit it next time. Also return empty stats for a few stats in case the engine is being reset. These are stats that are already returned empty from a hollow engine. Relates ES-11457
1 parent d3f47c6 commit a0a0c8e

File tree

3 files changed

+302
-104
lines changed

3 files changed

+302
-104
lines changed

server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ public FlushRequest(StreamInput in) throws IOException {
4545
}
4646

4747
/**
48-
* Returns {@code true} iff a flush should block
49-
* if a another flush operation is already running. Otherwise {@code false}
48+
* Returns {@code true} iff a flush should block (e.g., if the engine is being reset or
49+
* if a another flush operation is already running). Otherwise {@code false}
5050
*/
5151
public boolean waitIfOngoing() {
5252
return this.waitIfOngoing;
5353
}
5454

5555
/**
56-
* if set to {@code true} the flush will block
57-
* if a another flush operation is already running until the flush can be performed.
56+
* if set to {@code true} the flush will block (e.g., if the engine is being reset or
57+
* if a another flush operation is already running) until the flush can be performed.
5858
* The default is <code>true</code>
5959
*/
6060
public FlushRequest waitIfOngoing(boolean waitIfOngoing) {

0 commit comments

Comments
 (0)