public interface Rewriteable<T>
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_REWRITE_ROUNDS |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Rewriteable<T>> |
rewrite(java.util.List<T> rewritables,
QueryRewriteContext context)
Rewrites each element of the list until it doesn't change and returns a new list iff there is at least one element of the list that
changed during it's rewrite.
|
T |
rewrite(QueryRewriteContext ctx)
Rewrites this instance based on the provided context.
|
static <T extends Rewriteable<T>> |
rewrite(T original,
QueryRewriteContext context)
Rewrites the given
Rewriteable into its primitive form. |
static <T extends Rewriteable<T>> |
rewrite(T original,
QueryRewriteContext context,
boolean assertNoAsyncTasks)
Rewrites the given
Rewriteable into its primitive form. |
static <T extends Rewriteable<T>> |
rewriteAndFetch(T original,
QueryRewriteContext context,
ActionListener<T> rewriteResponse)
Rewrites the given rewriteable and fetches pending async tasks for each round before rewriting again.
|
static <T extends Rewriteable<T>> |
rewriteAndFetch(T original,
QueryRewriteContext context,
ActionListener<T> rewriteResponse,
int iteration)
Rewrites the given rewriteable and fetches pending async tasks for each round before rewriting again.
|
static final int MAX_REWRITE_ROUNDS
T rewrite(QueryRewriteContext ctx) throws java.io.IOException
java.io.IOExceptionstatic <T extends Rewriteable<T>> T rewrite(T original, QueryRewriteContext context) throws java.io.IOException
Rewriteable into its primitive form. Rewriteables that for instance fetch resources from remote hosts or
can simplify / optimize itself should do their heavy lifting during rewrite(QueryRewriteContext). This method
rewrites the rewriteable until it doesn't change anymore.original - the original rewriteable to rewritecontext - the rewrite context to usejava.io.IOException - if an IOException occursstatic <T extends Rewriteable<T>> T rewrite(T original, QueryRewriteContext context, boolean assertNoAsyncTasks) throws java.io.IOException
Rewriteable into its primitive form. Rewriteables that for instance fetch resources from remote hosts or
can simplify / optimize itself should do their heavy lifting during
rewriteAndFetch(Rewriteable, QueryRewriteContext, ActionListener) (QueryRewriteContext)}. This method rewrites the
rewriteable until it doesn't change anymore.original - the original rewriteable to rewritecontext - the rewrite context to useassertNoAsyncTasks - if true the rewrite will fail if there are any pending async tasks on the context after the
rewrite. See QueryRewriteContext.executeAsyncActions(ActionListener) for detalsjava.io.IOException - if an IOException occursstatic <T extends Rewriteable<T>> void rewriteAndFetch(T original, QueryRewriteContext context, ActionListener<T> rewriteResponse)
static <T extends Rewriteable<T>> void rewriteAndFetch(T original, QueryRewriteContext context, ActionListener<T> rewriteResponse, int iteration)
static <T extends Rewriteable<T>> java.util.List<T> rewrite(java.util.List<T> rewritables, QueryRewriteContext context) throws java.io.IOException
java.io.IOException