本文整理汇总了Java中com.espertech.esper.view.ViewServiceCreateResult类的典型用法代码示例。如果您正苦于以下问题:Java ViewServiceCreateResult类的具体用法?Java ViewServiceCreateResult怎么用?Java ViewServiceCreateResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewServiceCreateResult类属于com.espertech.esper.view包,在下文中一共展示了ViewServiceCreateResult类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: instantiate
import com.espertech.esper.view.ViewServiceCreateResult; //导入依赖的package包/类
public SubSelectStrategyRealization instantiate(final EPServicesContext services,
Viewable viewableRoot,
final AgentInstanceContext agentInstanceContext,
List<StopCallback> stopCallbackList) {
List<ViewFactory> viewFactoryChain = subSelectHolder.getViewFactoryChain().getViewFactoryChain();
// add "prior" view factory
boolean hasPrior = viewResourceDelegate.getPerStream()[0].getPriorRequests() != null && !viewResourceDelegate.getPerStream()[0].getPriorRequests().isEmpty();
if (hasPrior) {
PriorEventViewFactory priorEventViewFactory = EPStatementStartMethodHelperPrior.getPriorEventViewFactory(agentInstanceContext.getStatementContext(), 1024 + subqueryNumber, viewFactoryChain.size() + 1, viewFactoryChain.isEmpty());
viewFactoryChain = new ArrayList<ViewFactory>(viewFactoryChain);
viewFactoryChain.add(priorEventViewFactory);
}
// create factory chain context to hold callbacks specific to "prior" and "prev"
AgentInstanceViewFactoryChainContext viewFactoryChainContext = AgentInstanceViewFactoryChainContext.create(viewFactoryChain, agentInstanceContext, viewResourceDelegate.getPerStream()[0]);
ViewServiceCreateResult createResult = services.getViewService().createViews(viewableRoot, viewFactoryChain, viewFactoryChainContext, false);
final Viewable subselectView = createResult.getFinalViewable();
// create index/holder table
final EventTable index = pair.getFirst().makeEventTable();
stopCallbackList.add(new SubqueryStopCallback(index));
// create strategy
SubordTableLookupStrategy strategy = pair.getSecond().makeStrategy(index);
SubselectAggregationPreprocessor subselectAggregationPreprocessor = null;
// handle "prior" nodes and their strategies
Map<ExprPriorNode, ExprPriorEvalStrategy> priorNodeStrategies = EPStatementStartMethodHelperPrior.compilePriorNodeStrategies(viewResourceDelegate, new AgentInstanceViewFactoryChainContext[]{viewFactoryChainContext});
// handle "previous" nodes and their strategies
Map<ExprPreviousNode, ExprPreviousEvalStrategy> previousNodeStrategies = EPStatementStartMethodHelperPrevious.compilePreviousNodeStrategies(viewResourceDelegate, new AgentInstanceViewFactoryChainContext[]{viewFactoryChainContext});
AggregationService aggregationService = null;
if (aggregationServiceFactory != null) {
aggregationService = aggregationServiceFactory.getAggregationServiceFactory().makeService(agentInstanceContext, agentInstanceContext.getStatementContext().getMethodResolutionService());
if (!correlatedSubquery) {
SubselectAggregatorView aggregatorView = new SubselectAggregatorView(aggregationService, filterExprEval, agentInstanceContext);
subselectView.addView(aggregatorView);
preload(services, null, aggregatorView, agentInstanceContext);
return new SubSelectStrategyRealization(NULL_ROW_STRATEGY, null, aggregationService, priorNodeStrategies, previousNodeStrategies, subselectView, null);
}
else {
subselectAggregationPreprocessor = new SubselectAggregationPreprocessor(aggregationService, filterExprEval);
}
}
// preload
preload(services, index, subselectView, agentInstanceContext);
StatementAgentInstancePostLoad postLoad = new StatementAgentInstancePostLoad() {
public void executePostLoad() {
preload(services, index, subselectView, agentInstanceContext);
}
};
BufferView bufferView = new BufferView(subSelectHolder.getStreamNumber());
bufferView.setObserver(new SubselectBufferObserver(index));
subselectView.addView(bufferView);
return new SubSelectStrategyRealization(strategy, subselectAggregationPreprocessor, aggregationService, priorNodeStrategies, previousNodeStrategies, subselectView, postLoad);
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:67,代码来源:SubSelectStrategyFactoryLocalViewPreloaded.java