本文整理了Java中com.dremio.exec.ops.QueryContext.getExecutionControls
方法的一些代码示例,展示了QueryContext.getExecutionControls
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryContext.getExecutionControls
方法的具体详情如下:
包路径:com.dremio.exec.ops.QueryContext
类名称:QueryContext
方法名:getExecutionControls
暂无
代码示例来源:origin: dremio/dremio-oss
/**
* Resume a paused query
*/
public void resume() {
queryContext.getExecutionControls().unpauseAll();
}
代码示例来源:origin: dremio/dremio-oss
/**
* Method that injects an IOException with a site description of THROWS_IOEXCEPTION.
*
* @throws IOException
*/
public void throwsIOException() throws IOException {
// ... code ...
// simulated IOException
injector.injectChecked(context.getExecutionControls(), THROWS_IOEXCEPTION, IOException.class);
// ... code ...
}
}
代码示例来源:origin: dremio/dremio-oss
/**
* Method that injects an unchecked exception with the given site description.
*
* @param desc the injection site description
*/
public void descPassthroughMethod(final String desc) {
// ... code ...
// simulated unchecked exception
injector.injectUnchecked(context.getExecutionControls(), desc);
// ... code ...
}
代码示例来源:origin: dremio/dremio-oss
/**
* Method that pauses.
*
* @return how long the method paused in milliseconds
*/
public long pauses() {
// ... code ...
latch.countDown();
final long startTime = System.currentTimeMillis();
// simulated pause
injector.injectPause(context.getExecutionControls(), PAUSES, logger);
final long endTime = System.currentTimeMillis();
// ... code ...
return (endTime - startTime);
}
}
代码示例来源:origin: dremio/dremio-oss
@Override
public void run() {
latch.awaitUninterruptibly();
try {
Thread.sleep(millis);
} catch (final InterruptedException ex) {
this.ex.value = ex;
}
context.getExecutionControls().unpauseAll();
}
}
代码示例来源:origin: dremio/dremio-oss
/**
* Method that initializes and waits for "count" number of count down (from those many threads)
*/
public long initAndWait() throws InterruptedException {
// ... code ...
injector.getLatch(context.getExecutionControls(), LATCH_NAME).initialize(count);
// ... code ...
latch.countDown(); // trigger threads spawn
final long startTime = System.currentTimeMillis();
// simulated wait for "count" threads to count down on the same latch
injector.getLatch(context.getExecutionControls(), LATCH_NAME).await();
final long endTime = System.currentTimeMillis();
// ... code ...
return (endTime - startTime);
}
代码示例来源:origin: dremio/dremio-oss
public void countDown() {
// ... code ...
injector.getLatch(context.getExecutionControls(), LATCH_NAME).countDown();
// ... code ...
}
}
代码示例来源:origin: dremio/dremio-oss
protected QueryContext mockQueryContext(SabotContext dbContext) throws Exception {
final UserSession userSession = UserSession.Builder.newBuilder().withOptionManager(dbContext.getOptionManager()).build();
final SessionOptionManager sessionOptions = (SessionOptionManager) userSession.getOptions();
final QueryOptionManager queryOptions = new QueryOptionManager(sessionOptions);
final ExecutionControls executionControls = new ExecutionControls(queryOptions, NodeEndpoint.getDefaultInstance());
final OperatorTable table = new OperatorTable(FUNCTIONS());
final LogicalPlanPersistence lp = dbContext.getLpPersistence();
final CatalogService registry = dbContext.getCatalogService();
final QueryContext context = Mockito.mock(QueryContext.class);
when(context.getSession()).thenReturn(userSession);
when(context.getLpPersistence()).thenReturn(lp);
when(context.getCatalogService()).thenReturn(registry);
when(context.getFunctionRegistry()).thenReturn(FUNCTIONS());
when(context.getSession()).thenReturn(UserSession.Builder.newBuilder().setSupportComplexTypes(true).build());
when(context.getCurrentEndpoint()).thenReturn(NodeEndpoint.getDefaultInstance());
when(context.getActiveEndpoints()).thenReturn(ImmutableList.of(NodeEndpoint.getDefaultInstance()));
when(context.getPlannerSettings()).thenReturn(new PlannerSettings(dbContext.getConfig(), queryOptions, dbContext.getClusterResourceInformation()));
when(context.getOptions()).thenReturn(queryOptions);
when(context.getConfig()).thenReturn(DEFAULT_SABOT_CONFIG);
when(context.getOperatorTable()).thenReturn(table);
when(context.getAllocator()).thenReturn(allocator);
when(context.getExecutionControls()).thenReturn(executionControls);
when(context.getMaterializationProvider()).thenReturn(Mockito.mock(MaterializationDescriptorProvider.class));
return context;
}
代码示例来源:origin: dremio/dremio-oss
injector.injectPause(queryContext.getExecutionControls(), "foreman-cleanup", logger);
代码示例来源:origin: dremio/dremio-oss
injector.injectChecked(queryContext.getExecutionControls(), "run-try-beginning", ForemanException.class);
injector.injectChecked(queryContext.getExecutionControls(), "run-try-end", ForemanException.class);
} catch (ResourceUnavailableException e) {
代码示例来源:origin: dremio/dremio-oss
public CommandRunner<?> toCommand() throws ForemanException {
injector.injectChecked(context.getExecutionControls(), "run-try-beginning", ForemanException.class);
switch(request.getType()){
case GET_CATALOGS:
代码示例来源:origin: dremio/dremio-oss
context.getScanResult());
injector.injectChecked(context.getExecutionControls(), "sql-parsing", ForemanSetupException.class);
final DremioCatalogReader reader = parser.getCatalogReader();
final Catalog catalog = context.getCatalog();
内容来源于网络,如有侵权,请联系作者删除!