Module org.elasticsearch.server
Package org.elasticsearch.index.engine
Interface Engine.FlushResultListener
- All Superinterfaces:
ActionListener<Engine.FlushResult>
- Enclosing class:
Engine
An
ActionListener for flush operations that provides a callback to execute while the flush lock is still held.
This allows callers to perform operations such as acquiring an index commit that is guaranteed to be the one created
by the flush.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterFlushWithLock(long generation) Called while the flush lock is still held, after the flush request has been processed.static Engine.FlushResultListenerwrap(ActionListener<Engine.FlushResult> delegate) static Engine.FlushResultListenerwrap(ActionListener<Engine.FlushResult> delegate, LongConsumer afterFlushWithLock) Wraps a plainActionListenerinto aEngine.FlushResultListenerwith the given callback forafterFlushWithLock(long).Methods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateFailureIgnoreResponseAndWrap, delegateResponse, map, onFailure, onResponse, safeMap
-
Field Details
-
NOOP
-
-
Method Details
-
afterFlushWithLock
default void afterFlushWithLock(long generation) Called while the flush lock is still held, after the flush request has been processed. It is invoked regardless of whether a new commit was actually created, with the generation of the last committed segment infos. It is NOT called when the flush lock was never acquired, e.g. the request was skipped due to not waiting for the lock (i.e.waitIfOngoing==false) or if the engine does not use a flush lock at all.- Parameters:
generation- the segment generation of the latest committed segment infos
-
wrap
-
wrap
static Engine.FlushResultListener wrap(ActionListener<Engine.FlushResult> delegate, LongConsumer afterFlushWithLock) Wraps a plainActionListenerinto aEngine.FlushResultListenerwith the given callback forafterFlushWithLock(long).
-