本文整理了Java中com.dremio.exec.ops.QueryContext.getAccelerationManager
方法的一些代码示例,展示了QueryContext.getAccelerationManager
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryContext.getAccelerationManager
方法的具体详情如下:
包路径:com.dremio.exec.ops.QueryContext
类名称:QueryContext
方法名:getAccelerationManager
暂无
代码示例来源:origin: dremio/dremio-oss
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
// Boilerplate
AccelerationManager accelerationManager = mock(AccelerationManager.class);
AccelerationDetailsPopulator populator = mock(AccelerationDetailsPopulator.class);
when(populator.computeAcceleration()).thenReturn(ByteString.EMPTY_BYTE_ARRAY);
when(accelerationManager.newPopulator()).thenReturn(populator);
when(context.getAccelerationManager()).thenReturn(accelerationManager);
when(context.getQueryUserName()).thenReturn("myuser");
when(context.getSession()).thenReturn(UserSession.Builder.newBuilder().build());
when(context.getNonDefaultOptions()).thenReturn(new OptionList());
when(catalog.getMetadataStatsCollector()).thenReturn(new MetadataStatsCollector());
}
代码示例来源:origin: dremio/dremio-oss
@Override
public List<SimpleCommandResult> toResult(String sql, SqlNode sqlNode) throws Exception {
final SqlLoadMaterialization load = SqlNodeUtil.unwrap(sqlNode, SqlLoadMaterialization.class);
if(!SystemUser.SYSTEM_USERNAME.equals(context.getQueryUserName())) {
throw SqlExceptionHelper.parseError("$LOAD MATERIALIZATION not supported.", sql, load.getParserPosition()).build(logger);
}
final ReflectionService service = Preconditions.checkNotNull(context.getAccelerationManager().unwrap(ReflectionService.class),
"Couldn't unwrap ReflectionService");
final List<String> components = normalizeComponents(load.getMaterializationPath());
if (components == null) {
throw SqlExceptionHelper.parseError("Invalid materialization path.", sql, load.getParserPosition()).build(logger);
}
final ReflectionId reflectionId = new ReflectionId(components.get(0));
final Optional<ReflectionGoal> goalOptional = service.getGoal(reflectionId);
if (!goalOptional.isPresent()) {
throw SqlExceptionHelper.parseError("Unknown reflection id.", sql, load.getParserPosition()).build(logger);
}
final ReflectionGoal goal = goalOptional.get();
final MaterializationId materializationId = new MaterializationId(components.get(1));
final Optional<Materialization> materializationOpt = service.getMaterialization(materializationId);
if (!materializationOpt.isPresent()) {
throw SqlExceptionHelper.parseError("Unknown materialization id.", sql, load.getParserPosition()).build(logger);
}
final Materialization materialization = materializationOpt.get();
// if the user already made changes to the reflection goal, let's stop right here
Preconditions.checkState(Objects.equals(goal.getTag(), materialization.getReflectionGoalVersion()),
"materialization no longer matches its goal");
refreshMetadata(goal, materialization);
return Collections.singletonList(SimpleCommandResult.successful("Materialization metadata loaded."));
}
代码示例来源:origin: dremio/dremio-oss
public QueryManager(
final QueryId queryId,
final QueryContext context,
final CoordToExecTunnelCreator tunnelCreator,
final CompletionListener completionListener,
final Pointer<QueryId> prepareId,
final AttemptObservers observers,
final boolean verboseProfiles,
final boolean includeDatasetProfiles,
final Catalog catalog) {
this.queryId = queryId;
this.tunnelCreator = tunnelCreator;
this.completionListener = completionListener;
this.context = context;
this.prepareId = prepareId;
this.catalog = catalog;
this.nonDefaultOptions = context.getNonDefaultOptions();
resourceAllocationResultObserver = new ResourceAllocationResultObserver();
observers.add(resourceAllocationResultObserver);
capturer = new PlanCaptureAttemptObserver(verboseProfiles, includeDatasetProfiles, context.getFunctionRegistry(),
context.getAccelerationManager().newPopulator());
observers.add(capturer);
observers.add(new TimeMarker());
}
代码示例来源:origin: dremio/dremio-oss
ReflectionService service = config.getContext().getAccelerationManager().unwrap(ReflectionService.class);
代码示例来源:origin: dremio/dremio-oss
ReflectionService service = config.getContext().getAccelerationManager().unwrap(ReflectionService.class);
代码示例来源:origin: dremio/dremio-oss
return direct.create(new UseSchemaHandler(context.getSession(), catalog));
} else if (sqlNode instanceof SqlCreateReflection) {
return direct.create(new AccelCreateReflectionHandler(catalog, context.getAccelerationManager()));
} else if (sqlNode instanceof SqlAddExternalReflection) {
return direct.create(new AccelAddExternalReflectionHandler(catalog, context.getAccelerationManager()));
} else if (sqlNode instanceof SqlAccelToggle) {
return direct.create(new AccelToggleHandler(catalog, context.getAccelerationManager()));
} else if (sqlNode instanceof SqlDropReflection) {
return direct.create(new AccelDropReflectionHandler(catalog, context.getAccelerationManager()));
} else if (sqlNode instanceof SqlForgetTable) {
return direct.create(new ForgetTableHandler(catalog, context.getNamespaceService()));
内容来源于网络,如有侵权,请联系作者删除!