Package org.apache.drill.exec.ops
Class BaseFragmentContext
java.lang.Object
org.apache.drill.exec.ops.BaseFragmentContext
- All Implemented Interfaces:
AutoCloseable
,FragmentContext
,UdfUtilities
- Direct Known Subclasses:
FragmentContextImpl
Common implementation for both the test and production versions
of the fragment context.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.ops.FragmentContext
FragmentContext.ExecutorState
-
Field Summary
Fields inherited from interface org.apache.drill.exec.ops.UdfUtilities
INJECTABLE_GETTER_METHODS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BufferManager
Returns the UDF registry.<T> T
Generates code for a class given aClassGenerator
, and returns a single instance of the generated class.<T> List<T>
getImplementationClass
(ClassGenerator<T> cg, int instanceCount) Generates code for a class given aClassGenerator
, and returns the specified number of instances of the generated class.<T> T
Generates code for a class given aCodeGenerator
, and returns a single instance of the generated class.<T> List<T>
getImplementationClass
(CodeGenerator<T> cg, int instanceCount) Get this node's identity.For UDFs to allocate general purpose intermediate buffers we provide the DrillBuf type as an injectable, which provides access to an off-heap buffer that can be tracked by Drill and re-allocated as needed.getManagedBuffer
(int size) Returns the statement type (e.g.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.ops.FragmentContext
addRuntimeFilter, close, getAliasRegistryProvider, getAllocator, getCompiler, getConfig, getExecutionControls, getExecutor, getExecutorState, getFragIdString, getFullRootSchema, getHandle, getMetastoreRegistry, getNewChildAllocator, getOptions, getRuntimeFilter, getRuntimeFilter, getScanDecodeExecutor, getScanExecutor, isImpersonationEnabled, newOperatorContext, newOperatorContext, requestMemory
Methods inherited from interface org.apache.drill.exec.ops.UdfUtilities
getConstantValueHolder, getContextInformation, getDrillbitContext, getPartitionExplorer, getResultSetLoader
-
Constructor Details
-
BaseFragmentContext
-
-
Method Details
-
getFunctionRegistry
Description copied from interface:FragmentContext
Returns the UDF registry.- Specified by:
getFunctionRegistry
in interfaceFragmentContext
- Returns:
- the UDF registry
-
getImplementationClass
Description copied from interface:FragmentContext
Generates code for a class given aClassGenerator
, and returns a single instance of the generated class. (Note that the name is a misnomer, it would be better called getImplementationInstance.)- Specified by:
getImplementationClass
in interfaceFragmentContext
- Parameters:
cg
- the class generator- Returns:
- an instance of the generated class
-
getImplementationClass
Description copied from interface:FragmentContext
Generates code for a class given aCodeGenerator
, and returns a single instance of the generated class. (Note that the name is a misnomer, it would be better called getImplementationInstance.)- Specified by:
getImplementationClass
in interfaceFragmentContext
- Parameters:
cg
- the code generator- Returns:
- an instance of the generated class
-
getImplementationClass
Description copied from interface:FragmentContext
Generates code for a class given aClassGenerator
, and returns the specified number of instances of the generated class. (Note that the name is a misnomer, it would be better called getImplementationInstances.)- Specified by:
getImplementationClass
in interfaceFragmentContext
- Parameters:
cg
- the class generator- Returns:
- list of instances of the generated class
-
getImplementationClass
Description copied from interface:FragmentContext
Get this node's identity.- Specified by:
getImplementationClass
in interfaceFragmentContext
- Returns:
- A DrillbitEndpoint object.
-
getBufferManager
-
replace
- Specified by:
replace
in interfaceFragmentContext
-
getManagedBuffer
Description copied from interface:UdfUtilities
For UDFs to allocate general purpose intermediate buffers we provide the DrillBuf type as an injectable, which provides access to an off-heap buffer that can be tracked by Drill and re-allocated as needed.- Specified by:
getManagedBuffer
in interfaceFragmentContext
- Specified by:
getManagedBuffer
in interfaceUdfUtilities
- Returns:
- - a buffer managed by Drill, connected to the fragment allocator for memory management
-
getManagedBuffer
- Specified by:
getManagedBuffer
in interfaceFragmentContext
-
getQueryUserName
- Specified by:
getQueryUserName
in interfaceFragmentContext
-
getQueryId
- Specified by:
getQueryId
in interfaceFragmentContext
- Returns:
- ID
UUID
of the current query
-
getQueryIdString
- Specified by:
getQueryIdString
in interfaceFragmentContext
- Returns:
- The string representation of the ID
UUID
of the current query
-
getSQLStatementType
Description copied from interface:FragmentContext
Returns the statement type (e.g. SELECT, CTAS, ANALYZE) from the query context.- Specified by:
getSQLStatementType
in interfaceFragmentContext
- Returns:
- query statement type
QueryContext.SqlStatementType
, if known.
-
getManagedBufferManager
- Specified by:
getManagedBufferManager
in interfaceFragmentContext
-