public static class OperatorFixture.MockFragmentContext extends BaseFragmentContext
FragmentContext.ExecutorStateINJECTABLE_GETTER_METHODS| Constructor and Description |
|---|
MockFragmentContext(DrillConfig config,
OptionManager options,
BufferAllocator allocator,
ExecutorService scanExecutorService,
ExecutorService scanDecodeExecutorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRuntimeFilter(RuntimeFilterWritable runtimeFilter)
Add a RuntimeFilter when the RuntimeFilter receiver belongs to the same MinorFragment.
|
void |
close() |
AliasRegistryProvider |
getAliasRegistryProvider()
Get an instance of alias registry provider for obtaining aliases.
|
BufferAllocator |
getAllocator() |
protected BufferManager |
getBufferManager() |
CodeCompiler |
getCompiler() |
DrillConfig |
getConfig()
Returns the Drill configuration for this run.
|
ValueHolder |
getConstantValueHolder(String value,
TypeProtos.MinorType type,
org.apache.drill.shaded.guava.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.
|
ExecutionControls |
getExecutionControls()
Return the set of execution controls used to inject faults into running
code for testing.
|
ExecutorService |
getExecutor() |
FragmentContext.ExecutorState |
getExecutorState() |
String |
getFragIdString() |
org.apache.calcite.schema.SchemaPlus |
getFullRootSchema() |
ExecProtos.FragmentHandle |
getHandle() |
MetastoreRegistry |
getMetastoreRegistry()
Get instance of Metastore registry to obtain Metastore instance if needed.
|
BufferAllocator |
getNewChildAllocator(String operatorName,
int operatorId,
long initialReservation,
long maximumReservation) |
OptionManager |
getOptions()
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() |
RuntimeFilterWritable |
getRuntimeFilter(long rfIdentifier) |
RuntimeFilterWritable |
getRuntimeFilter(long rfIdentifier,
long maxWaitTime,
TimeUnit timeUnit)
Get the RuntimeFilter with a blocking wait, if the waiting option is enabled.
|
ExecutorService |
getScanDecodeExecutor() |
ExecutorService |
getScanExecutor() |
boolean |
isImpersonationEnabled() |
OperatorContext |
newOperatorContext(PhysicalOperator popConfig) |
OperatorContext |
newOperatorContext(PhysicalOperator popConfig,
OperatorStats stats) |
void |
requestMemory(RecordBatch requestor)
An operator is experiencing memory pressure.
|
getFunctionRegistry, getImplementationClass, getImplementationClass, getImplementationClass, getImplementationClass, getManagedBuffer, getManagedBuffer, getManagedBufferManager, getQueryId, getQueryIdString, getSQLStatementType, replacepublic MockFragmentContext(DrillConfig config, OptionManager options, BufferAllocator allocator, ExecutorService scanExecutorService, ExecutorService scanDecodeExecutorService)
public OptionManager getOptions()
FragmentContextpublic boolean isImpersonationEnabled()
public ExecutionControls getExecutionControls()
FragmentContextpublic DrillConfig getConfig()
FragmentContextpublic ExecutorService getScanDecodeExecutor()
public ExecutorService getScanExecutor()
public ExecutorService getExecutor()
public FragmentContext.ExecutorState getExecutorState()
public BufferAllocator getNewChildAllocator(String operatorName, int operatorId, long initialReservation, long maximumReservation)
public ExecProtos.FragmentHandle getHandle()
public BufferAllocator getAllocator()
public OperatorContext newOperatorContext(PhysicalOperator popConfig, OperatorStats stats) throws OutOfMemoryException
OutOfMemoryExceptionpublic OperatorContext newOperatorContext(PhysicalOperator popConfig) throws OutOfMemoryException
OutOfMemoryExceptionpublic String getQueryUserName()
getQueryUserName in interface FragmentContextgetQueryUserName in class BaseFragmentContextpublic org.apache.calcite.schema.SchemaPlus getFullRootSchema()
public String getFragIdString()
public CodeCompiler getCompiler()
protected BufferManager getBufferManager()
getBufferManager in class BaseFragmentContextpublic void close()
public void addRuntimeFilter(RuntimeFilterWritable runtimeFilter)
FragmentContextruntimeFilter - runtime filterpublic RuntimeFilterWritable getRuntimeFilter(long rfIdentifier)
public RuntimeFilterWritable getRuntimeFilter(long rfIdentifier, long maxWaitTime, TimeUnit timeUnit)
FragmentContextrfIdentifier - runtime filter identifiermaxWaitTime - max wait timetimeUnit - time unitpublic ContextInformation getContextInformation()
UdfUtilitiespublic PartitionExplorer getPartitionExplorer()
UdfUtilitiesDirectoryExplorers for
example usages of this interface.public ValueHolder getConstantValueHolder(String value, TypeProtos.MinorType type, org.apache.drill.shaded.guava.com.google.common.base.Function<DrillBuf,ValueHolder> holderInitializer)
UdfUtilitiespublic MetastoreRegistry getMetastoreRegistry()
FragmentContextpublic AliasRegistryProvider getAliasRegistryProvider()
FragmentContextpublic void requestMemory(RecordBatch requestor)
FragmentContextOutOfMemoryException.Copyright © 2022 The Apache Software Foundation. All rights reserved.