QueryShardContext
public class QueryRewriteContext
extends java.lang.Object
QueryBuilder
instances into simplified version.Modifier and Type | Field | Description |
---|---|---|
protected Client |
client |
|
protected java.util.function.LongSupplier |
nowInMillis |
Constructor | Description |
---|---|
QueryRewriteContext(NamedXContentRegistry xContentRegistry,
NamedWriteableRegistry writeableRegistry,
Client client,
java.util.function.LongSupplier nowInMillis) |
Modifier and Type | Method | Description |
---|---|---|
QueryShardContext |
convertToShardContext() |
Returns an instance of
QueryShardContext if available of null otherwise |
void |
executeAsyncActions(ActionListener listener) |
Executes all registered async actions and notifies the listener once it's done.
|
NamedWriteableRegistry |
getWriteableRegistry() |
|
NamedXContentRegistry |
getXContentRegistry() |
The registry used to build new
XContentParser s. |
boolean |
hasAsyncActions() |
Returns
true if there are any registered async actions. |
long |
nowInMillis() |
Returns the time in milliseconds that is shared across all resources involved.
|
void |
registerAsyncAction(java.util.function.BiConsumer<Client,ActionListener<?>> asyncAction) |
Registers an async action that must be executed before the next rewrite round in order to make progress.
|
protected final Client client
protected final java.util.function.LongSupplier nowInMillis
public QueryRewriteContext(NamedXContentRegistry xContentRegistry, NamedWriteableRegistry writeableRegistry, Client client, java.util.function.LongSupplier nowInMillis)
public NamedXContentRegistry getXContentRegistry()
XContentParser
s. Contains registered named parsers needed to parse the query.public long nowInMillis()
public NamedWriteableRegistry getWriteableRegistry()
public QueryShardContext convertToShardContext()
QueryShardContext
if available of null otherwisepublic void registerAsyncAction(java.util.function.BiConsumer<Client,ActionListener<?>> asyncAction)
public boolean hasAsyncActions()
true
if there are any registered async actions.public void executeAsyncActions(ActionListener listener)
null
. The list of registered actions is cleared once this method returns.