public class FragmentContext extends BaseFragmentContext implements AutoCloseable, UdfUtilities, FragmentContextInterface
| Modifier and Type | Class and Description |
|---|---|
static interface |
FragmentContext.ExecutorState |
INJECTABLE_GETTER_METHODS| Constructor and Description |
|---|
FragmentContext(DrillbitContext dbContext,
BitControl.PlanFragment fragment,
FunctionImplementationRegistry funcRegistry)
Create a FragmentContext instance for non-root fragment.
|
FragmentContext(DrillbitContext dbContext,
BitControl.PlanFragment fragment,
QueryContext queryContext,
UserClientConnection connection,
FunctionImplementationRegistry funcRegistry)
Create a FragmentContext instance for root fragment.
|
FragmentContext(DrillbitContext dbContext,
BitControl.PlanFragment fragment,
UserClientConnection connection,
FunctionImplementationRegistry funcRegistry)
TODO: Remove this constructor when removing the SimpleRootExec (DRILL-2097).
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
fail(Throwable cause) |
BufferAllocator |
getAllocator()
Deprecated.
|
protected BufferManager |
getBufferManager() |
IncomingBuffers |
getBuffers() |
protected CodeCompiler |
getCompiler() |
DrillConfig |
getConfig()
Returns the Drill configuration for this run.
|
ValueHolder |
getConstantValueHolder(String value,
TypeProtos.MinorType type,
com.google.common.base.Function<DrillBuf,ValueHolder> holderInitializer)
Works with value holders cache which holds constant value and its wrapper by type.
|
ContextInformation |
getContextInformation()
Get the context information such as:
- query start time
- root fragment timezone
- query userName
- system userName
- default schema name in current session at the time of query.
|
ControlTunnel |
getControlTunnel(CoordinationProtos.DrillbitEndpoint endpoint) |
AccountingDataTunnel |
getDataTunnel(CoordinationProtos.DrillbitEndpoint endpoint) |
DrillbitContext |
getDrillbitContext()
Drillbit context.
|
ExecutionControls |
getExecutionControls()
Return the set of execution controls used to inject faults into running
code for testing.
|
Executor |
getExecutor() |
Throwable |
getFailureCause()
Deprecated.
|
CoordinationProtos.DrillbitEndpoint |
getForemanEndpoint() |
String |
getFragIdString() |
org.apache.calcite.schema.SchemaPlus |
getFullRootSchema()
This method is only used to construt InfoSchemaReader, it is for the reader to get full schema, so here we
are going to return a fully initialized schema tree.
|
ExecProtos.FragmentHandle |
getHandle()
The FragmentHandle for this Fragment
|
CoordinationProtos.DrillbitEndpoint |
getIdentity()
Get this node's identity.
|
BufferAllocator |
getNewChildAllocator(String operatorName,
int operatorId,
long initialReservation,
long maximumReservation) |
OptionManager |
getOptions() |
OptionSet |
getOptionSet()
Returns a read-only version of the session options.
|
PartitionExplorer |
getPartitionExplorer()
A partition explorer allows UDFs to view the sub-partitions below a
particular partition.
|
String |
getQueryUserName() |
FragmentStats |
getStats() |
AccountingUserConnection |
getUserDataTunnel() |
WorkEventBus |
getWorkEventbus() |
boolean |
isBuffersDone() |
boolean |
isFailed()
Deprecated.
|
boolean |
isImpersonationEnabled() |
boolean |
isOverMemoryLimit() |
OperatorContext |
newOperatorContext(PhysicalOperator popConfig) |
OperatorContext |
newOperatorContext(PhysicalOperator popConfig,
OperatorStats stats) |
void |
setBuffers(IncomingBuffers buffers) |
void |
setExecutorState(FragmentContext.ExecutorState executorState) |
void |
setFragmentLimit(long limit) |
boolean |
shouldContinue()
Tells individual operations whether they should continue.
|
void |
waitForSendComplete()
Wait for ack that all outgoing batches have been sent
|
getFunctionRegistry, getImplementationClass, getImplementationClass, getImplementationClass, getImplementationClass, getManagedBuffer, getManagedBuffer, replaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetManagedBuffergetFunctionRegistry, getImplementationClass, getImplementationClass, getImplementationClass, getImplementationClass, getManagedBuffer, getManagedBuffer, replacepublic FragmentContext(DrillbitContext dbContext, BitControl.PlanFragment fragment, FunctionImplementationRegistry funcRegistry) throws ExecutionSetupException
dbContext - DrillbitContext.fragment - Fragment implementation.funcRegistry - FunctionImplementationRegistry.ExecutionSetupExceptionpublic FragmentContext(DrillbitContext dbContext, BitControl.PlanFragment fragment, QueryContext queryContext, UserClientConnection connection, FunctionImplementationRegistry funcRegistry) throws ExecutionSetupException
dbContext - DrillbitContext.fragment - Fragment implementation.queryContext - QueryContext.connection - UserClientConnection.funcRegistry - FunctionImplementationRegistry.ExecutionSetupExceptionpublic FragmentContext(DrillbitContext dbContext, BitControl.PlanFragment fragment, UserClientConnection connection, FunctionImplementationRegistry funcRegistry) throws ExecutionSetupException
ExecutionSetupExceptionpublic OptionManager getOptions()
public OptionSet getOptionSet()
FragmentContextInterfacegetOptionSet in interface FragmentContextInterfacepublic void setBuffers(IncomingBuffers buffers)
public void setExecutorState(FragmentContext.ExecutorState executorState)
public void fail(Throwable cause)
public boolean shouldContinue()
shouldContinue in interface FragmentContextInterfacepublic DrillbitContext getDrillbitContext()
FragmentContextInterfacegetDrillbitContext in interface FragmentContextInterfacepublic org.apache.calcite.schema.SchemaPlus getFullRootSchema()
public CoordinationProtos.DrillbitEndpoint getIdentity()
public FragmentStats getStats()
public ContextInformation getContextInformation()
UdfUtilitiesgetContextInformation in interface UdfUtilitiespublic CoordinationProtos.DrillbitEndpoint getForemanEndpoint()
public ExecProtos.FragmentHandle getHandle()
public String getFragIdString()
@Deprecated public BufferAllocator getAllocator()
public BufferAllocator getNewChildAllocator(String operatorName, int operatorId, long initialReservation, long maximumReservation) throws OutOfMemoryException
OutOfMemoryExceptionpublic boolean isOverMemoryLimit()
protected CodeCompiler getCompiler()
getCompiler in class BaseFragmentContextpublic AccountingUserConnection getUserDataTunnel()
public ControlTunnel getControlTunnel(CoordinationProtos.DrillbitEndpoint endpoint)
public AccountingDataTunnel getDataTunnel(CoordinationProtos.DrillbitEndpoint endpoint)
public IncomingBuffers getBuffers()
public OperatorContext newOperatorContext(PhysicalOperator popConfig, OperatorStats stats) throws OutOfMemoryException
OutOfMemoryExceptionpublic OperatorContext newOperatorContext(PhysicalOperator popConfig) throws OutOfMemoryException
OutOfMemoryException@Deprecated public Throwable getFailureCause()
@Deprecated public boolean isFailed()
public DrillConfig getConfig()
FragmentContextInterfacegetConfig in interface FragmentContextInterfacepublic void setFragmentLimit(long limit)
public ExecutionControls getExecutionControls()
FragmentContextInterfacegetExecutionControls in interface FragmentContextInterfacepublic String getQueryUserName()
public boolean isImpersonationEnabled()
public void close()
close in interface AutoCloseablepublic PartitionExplorer getPartitionExplorer()
UdfUtilitiesDirectoryExplorers for
example usages of this interface.getPartitionExplorer in interface UdfUtilitiespublic ValueHolder getConstantValueHolder(String value, TypeProtos.MinorType type, com.google.common.base.Function<DrillBuf,ValueHolder> holderInitializer)
UdfUtilitiesgetConstantValueHolder in interface UdfUtilitiespublic Executor getExecutor()
public void waitForSendComplete()
public WorkEventBus getWorkEventbus()
public boolean isBuffersDone()
protected BufferManager getBufferManager()
getBufferManager in class BaseFragmentContextCopyright © 2017 The Apache Software Foundation. All rights reserved.