Module org.elasticsearch.server
Package org.elasticsearch.index.query
Class QueryRewriteAsyncAction<T,U extends QueryRewriteAsyncAction<T,U>>
java.lang.Object
org.elasticsearch.index.query.QueryRewriteAsyncAction<T,U>
- Direct Known Subclasses:
QueryRewriteRemoteAsyncAction
public abstract class QueryRewriteAsyncAction<T,U extends QueryRewriteAsyncAction<T,U>>
extends Object
Represents a unique action that needs to be executed asynchronously during query rewriting.
A
QueryRewriteAsyncAction is registered using
QueryRewriteContext.registerUniqueAsyncAction(QueryRewriteAsyncAction, Consumer).
This is useful when we want to remove duplicate and costly async actions that take part in query rewriting, such as generating
embeddings for semantic search.
Since we need to determine whether an action has already been registered, we require implementors to provide implementations for
hashCode() and equals(Object),-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanabstract intbooleanfinal voidexecute(Client client, ActionListener<?> listener, List<Consumer<?>> consumers) The execute method will: - Execute the action usingexecute(Client, ActionListener)- Pass the action result to the consumers and execute the consumers - Call the final listenerprotected abstract voidexecute(Client client, ActionListener<T> listener) This method will execute the async action and pass its result to the listener.inthashCode()
-
Constructor Details
-
QueryRewriteAsyncAction
public QueryRewriteAsyncAction()
-
-
Method Details
-
execute
The execute method will: - Execute the action usingexecute(Client, ActionListener)- Pass the action result to the consumers and execute the consumers - Call the final listener- Parameters:
client- An internal client that can be used during execution.listener- The listener that will be called after the action and consumers have been executed.consumers- A list of consumer that expect the result of the action.
-
execute
This method will execute the async action and pass its result to the listener.- Parameters:
client- An internal client that can be used during execution.listener- The listener that will be called with the action result
-
hashCode
public int hashCode() -
doHashCode
public abstract int doHashCode() -
equals
-
doEquals
-