本文整理汇总了Java中com.espertech.esper.view.internal.PriorEventViewFactory类的典型用法代码示例。如果您正苦于以下问题:Java PriorEventViewFactory类的具体用法?Java PriorEventViewFactory怎么用?Java PriorEventViewFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PriorEventViewFactory类属于com.espertech.esper.view.internal包,在下文中一共展示了PriorEventViewFactory类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inspectViewFactoriesForPrevious
import com.espertech.esper.view.internal.PriorEventViewFactory; //导入依赖的package包/类
private static boolean inspectViewFactoriesForPrevious(List<ViewFactory> viewFactories) {
// We allow the capability only if
// - 1 view
// - 2 views and the first view is a group-by (for window-per-group access)
if (viewFactories.size() == 1) {
return true;
}
if (viewFactories.size() == 2) {
if (viewFactories.get(0) instanceof GroupByViewFactory) {
return true;
}
if (viewFactories.get(1) instanceof PriorEventViewFactory) {
return true;
}
return false;
}
return true;
}
示例2: inspectViewFactoriesForPrevious
import com.espertech.esper.view.internal.PriorEventViewFactory; //导入依赖的package包/类
private static boolean inspectViewFactoriesForPrevious(List<ViewFactory> viewFactories)
{
// We allow the capability only if
// - 1 view
// - 2 views and the first view is a group-by (for window-per-group access)
if (viewFactories.size() == 1)
{
return true;
}
if (viewFactories.size() == 2)
{
if (viewFactories.get(0) instanceof GroupByViewFactory)
{
return true;
}
if (viewFactories.get(1) instanceof PriorEventViewFactory) {
return true;
}
return false;
}
return true;
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:23,代码来源:EPStatementStartMethodHelperViewResources.java
示例3: create
import com.espertech.esper.view.internal.PriorEventViewFactory; //导入依赖的package包/类
public static AgentInstanceViewFactoryChainContext create(List<ViewFactory> viewFactoryChain, AgentInstanceContext agentInstanceContext, ViewResourceDelegateVerifiedStream viewResourceDelegate) {
Object previousNodeGetter = null;
if (viewResourceDelegate.getPreviousRequests() != null && !viewResourceDelegate.getPreviousRequests().isEmpty()) {
DataWindowViewWithPrevious factoryFound = EPStatementStartMethodHelperPrevious.findPreviousViewFactory(viewFactoryChain);
previousNodeGetter = factoryFound.makePreviousGetter();
}
ViewUpdatedCollection priorViewUpdatedCollection = null;
if (viewResourceDelegate.getPriorRequests() != null && !viewResourceDelegate.getPriorRequests().isEmpty()) {
PriorEventViewFactory priorEventViewFactory = EPStatementStartMethodHelperPrior.findPriorViewFactory(viewFactoryChain);
SortedMap<Integer, List<ExprPriorNode>> callbacksPerIndex = viewResourceDelegate.getPriorRequests();
priorViewUpdatedCollection = priorEventViewFactory.makeViewUpdatedCollection(callbacksPerIndex, agentInstanceContext.getAgentInstanceId());
}
boolean removedStream = false;
if (viewFactoryChain.size() > 1) {
int countDataWindow = 0;
for (ViewFactory viewFactory : viewFactoryChain) {
if (viewFactory instanceof DataWindowViewFactory) {
countDataWindow++;
}
}
removedStream = countDataWindow > 1;
}
return new AgentInstanceViewFactoryChainContext(agentInstanceContext, removedStream, previousNodeGetter, priorViewUpdatedCollection);
}
示例4: findPriorViewFactory
import com.espertech.esper.view.internal.PriorEventViewFactory; //导入依赖的package包/类
public static PriorEventViewFactory findPriorViewFactory(List<ViewFactory> factories) {
ViewFactory factoryFound = null;
for (ViewFactory factory : factories) {
if (factory instanceof PriorEventViewFactory) {
factoryFound = factory;
break;
}
}
if (factoryFound == null) {
throw new RuntimeException("Failed to find 'prior'-handling view factory"); // was verified earlier, should not occur
}
return (PriorEventViewFactory) factoryFound;
}
示例5: instantiate
import com.espertech.esper.view.internal.PriorEventViewFactory; //导入依赖的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