public enum Hook extends Enum<Hook>
For testing and debugging rather than for end-users.
| Modifier and Type | Class and Description |
|---|---|
static interface |
Hook.Closeable
Removes a Hook after use.
|
| Enum Constant and Description |
|---|
CONVERTED
Called with the output of sql-to-rel-converter.
|
CREATE_MATERIALIZATION
Called when materialization is created.
|
CURRENT_TIME
Called to get the current time.
|
EXPRESSION_REDUCER
Called when a constant expression is being reduced.
|
JAVA_PLAN
Called with the generated Java plan, just before it is compiled by
Janino.
|
PARSE_TREE
Called with the SQL string and parse tree, in an array.
|
PROGRAM
Called to create a Program to optimize the statement.
|
QUERY_PLAN
Called with a query that has been generated to send to a back-end system.
|
SUB
Called by the planner after substituting a materialization.
|
TRIMMED
Called after de-correlation and field trimming, but before
optimization.
|
| Modifier and Type | Method and Description |
|---|---|
<T,R> Hook.Closeable |
add(com.google.common.base.Function<T,R> handler)
Adds a handler for this Hook.
|
<T,R> Hook.Closeable |
addThread(com.google.common.base.Function<T,R> handler)
Adds a handler for this thread.
|
void |
run(Object arg)
Runs all handlers registered for this Hook, with the given argument.
|
static Hook |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Hook[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Hook CURRENT_TIME
public static final Hook PARSE_TREE
public static final Hook JAVA_PLAN
public static final Hook CONVERTED
public static final Hook TRIMMED
public static final Hook SUB
public static final Hook EXPRESSION_REDUCER
public static final Hook PROGRAM
public static final Hook CREATE_MATERIALIZATION
public static final Hook QUERY_PLAN
public static Hook[] values()
for (Hook c : Hook.values()) System.out.println(c);
public static Hook valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant
with the specified nameNullPointerException - if the argument is nullpublic <T,R> Hook.Closeable add(com.google.common.base.Function<T,R> handler)
Returns a Hook.Closeable so that you can use the following
try-finally pattern to prevent leaks:
final Hook.Closeable closeable = Hook.FOO.add(HANDLER);
try {
...
} finally {
closeable.close();
}
public <T,R> Hook.Closeable addThread(com.google.common.base.Function<T,R> handler)
public void run(Object arg)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.