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.
|
ENABLE_BINDABLE
Returns a boolean value, whether the return convention should be
BindableConvention . |
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.
|
PLANNER
Called with the created planner.
|
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.
|
REL_BUILDER_SIMPLIFY
Returns a boolean value, whether RelBuilder should simplify expressions.
|
STANDARD_STREAMS
Called to get stdin, stdout, stderr.
|
STRING_TO_QUERY
Converts a SQL string to a
CalcitePrepare.Query object. |
SUB
Called by the planner after substituting a materialization.
|
TRIMMED
Called after de-correlation and field trimming, but before
optimization.
|
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.util.function.Consumer<java.lang.Object>> |
handlers |
private java.lang.ThreadLocal<java.util.List<java.util.function.Consumer<java.lang.Object>>> |
threadHandlers |
Modifier and Type | Method and Description |
---|---|
<T> Hook.Closeable |
add(java.util.function.Consumer<T> handler)
Adds a handler for this Hook.
|
<T,R> Hook.Closeable |
add(java.util.function.Function<T,R> handler)
Deprecated.
Use
add(Consumer) . |
<T> Hook.Closeable |
addThread(java.util.function.Consumer<T> handler)
Adds a handler for this thread.
|
<T,R> Hook.Closeable |
addThread(com.google.common.base.Function<T,R> handler)
Deprecated.
Use
addThread(Consumer) . |
<V> V |
get(V defaultValue)
Returns the value of a property hook.
|
static <V> com.google.common.base.Function<Holder<V>,java.lang.Void> |
property(V v)
Deprecated.
Use
propertyJ(V) . |
static <V> java.util.function.Consumer<Holder<V>> |
propertyJ(V v)
Returns a function that, when a hook is called, will "return" a given
value.
|
private boolean |
remove(java.util.function.Consumer handler)
Removes a handler from this Hook.
|
private boolean |
removeThread(java.util.function.Consumer handler)
Removes a thread handler from this Hook.
|
void |
run(java.lang.Object arg)
Runs all handlers registered for this Hook, with the given argument.
|
static Hook |
valueOf(java.lang.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 STANDARD_STREAMS
public static final Hook REL_BUILDER_SIMPLIFY
public static final Hook ENABLE_BINDABLE
BindableConvention
.
Default false.public static final Hook PARSE_TREE
public static final Hook STRING_TO_QUERY
CalcitePrepare.Query
object. This hook is
an opportunity to execute a RelNode
query
plan in the JDBC driver rather than the usual SQL string.public static final Hook JAVA_PLAN
public static final Hook CONVERTED
public static final Hook PLANNER
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
private final java.util.List<java.util.function.Consumer<java.lang.Object>> handlers
private final java.lang.ThreadLocal<java.util.List<java.util.function.Consumer<java.lang.Object>>> threadHandlers
public static Hook[] values()
for (Hook c : Hook.values()) System.out.println(c);
public static Hook valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic <T> Hook.Closeable add(java.util.function.Consumer<T> 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(); }
@Deprecated public <T,R> Hook.Closeable add(java.util.function.Function<T,R> handler)
add(Consumer)
.private boolean remove(java.util.function.Consumer handler)
public <T> Hook.Closeable addThread(java.util.function.Consumer<T> handler)
@Deprecated public <T,R> Hook.Closeable addThread(com.google.common.base.Function<T,R> handler)
addThread(Consumer)
.private boolean removeThread(java.util.function.Consumer handler)
@Deprecated public static <V> com.google.common.base.Function<Holder<V>,java.lang.Void> property(V v)
propertyJ(V)
.public static <V> java.util.function.Consumer<Holder<V>> propertyJ(V v)
Holder
.public void run(java.lang.Object arg)
public <V> V get(V defaultValue)
Holder
as an argument.)Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.