本文整理汇总了Java中com.espertech.esper.view.internal.BufferView.setObserver方法的典型用法代码示例。如果您正苦于以下问题:Java BufferView.setObserver方法的具体用法?Java BufferView.setObserver怎么用?Java BufferView.setObserver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.view.internal.BufferView
的用法示例。
在下文中一共展示了BufferView.setObserver方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.espertech.esper.view.internal.BufferView; //导入方法依赖的package包/类
public void setUp() {
bufferViewOne = new BufferView(0);
bufferViewTwo = new BufferView(1);
joinExecutionStrategy = new SupportJoinExecutionStrategy();
this.dispatchable = new JoinExecStrategyDispatchable(joinExecutionStrategy, 2);
bufferViewOne.setObserver(dispatchable);
bufferViewTwo.setObserver(dispatchable);
}
示例2: setUp
import com.espertech.esper.view.internal.BufferView; //导入方法依赖的package包/类
public void setUp()
{
bufferViewOne = new BufferView(0);
bufferViewTwo = new BufferView(1);
joinExecutionStrategy = new SupportJoinExecutionStrategy();
this.dispatchable = new JoinExecStrategyDispatchable(joinExecutionStrategy, 2);
bufferViewOne.setObserver(dispatchable);
bufferViewTwo.setObserver(dispatchable);
}
示例3: handleJoin
import com.espertech.esper.view.internal.BufferView; //导入方法依赖的package包/类
private JoinPlanResult handleJoin(String[] streamNames,
Viewable[] streamViews,
ResultSetProcessor resultSetProcessor,
AgentInstanceContext agentInstanceContext,
List<StopCallback> stopCallbacks,
StreamJoinAnalysisResult joinAnalysisResult,
boolean isRecoveringResilient) {
final JoinSetComposerDesc joinSetComposerDesc = joinSetComposerPrototype.create(streamViews, false, agentInstanceContext, isRecoveringResilient);
stopCallbacks.add(new StopCallback() {
public void stop() {
joinSetComposerDesc.getJoinSetComposer().destroy();
}
});
JoinSetFilter filter = new JoinSetFilter(joinSetComposerDesc.getPostJoinFilterEvaluator());
OutputProcessViewBase indicatorView = outputProcessViewFactory.makeView(resultSetProcessor, agentInstanceContext);
// Create strategy for join execution
JoinExecutionStrategy execution = new JoinExecutionStrategyImpl(joinSetComposerDesc.getJoinSetComposer(), filter, indicatorView, agentInstanceContext);
// The view needs a reference to the join execution to pull iterator values
indicatorView.setJoinExecutionStrategy(execution);
// Hook up dispatchable with buffer and execution strategy
JoinExecStrategyDispatchable joinStatementDispatch = new JoinExecStrategyDispatchable(execution, statementSpec.getStreamSpecs().length);
agentInstanceContext.getEpStatementAgentInstanceHandle().setOptionalDispatchable(joinStatementDispatch);
JoinPreloadMethod preloadMethod;
if (joinAnalysisResult.isUnidirectional()) {
preloadMethod = new JoinPreloadMethodNull();
} else {
if (!joinSetComposerDesc.getJoinSetComposer().allowsInit()) {
preloadMethod = new JoinPreloadMethodNull();
} else {
preloadMethod = new JoinPreloadMethodImpl(streamNames.length, joinSetComposerDesc.getJoinSetComposer());
}
}
// Create buffer for each view. Point buffer to dispatchable for join.
for (int i = 0; i < statementSpec.getStreamSpecs().length; i++) {
BufferView buffer = new BufferView(i);
streamViews[i].addView(buffer);
buffer.setObserver(joinStatementDispatch);
preloadMethod.setBuffer(buffer, i);
}
return new JoinPlanResult(indicatorView, preloadMethod, joinSetComposerDesc);
}
示例4: instantiate
import com.espertech.esper.view.internal.BufferView; //导入方法依赖的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
示例5: handleJoin
import com.espertech.esper.view.internal.BufferView; //导入方法依赖的package包/类
private JoinPlanResult handleJoin(String[] streamNames,
Viewable[] streamViews,
ResultSetProcessor resultSetProcessor,
AgentInstanceContext agentInstanceContext,
List<StopCallback> stopCallbacks,
StreamJoinAnalysisResult joinAnalysisResult)
{
final JoinSetComposerDesc joinSetComposerDesc = joinSetComposerPrototype.create(streamViews, false);
stopCallbacks.add(new StopCallback(){
public void stop()
{
joinSetComposerDesc.getJoinSetComposer().destroy();
}
});
JoinSetFilter filter = new JoinSetFilter(joinSetComposerDesc.getPostJoinFilterEvaluator());
OutputProcessViewBase indicatorView = outputProcessViewFactory.makeView(resultSetProcessor, agentInstanceContext);
// Create strategy for join execution
JoinExecutionStrategy execution = new JoinExecutionStrategyImpl(joinSetComposerDesc.getJoinSetComposer(), filter, indicatorView, agentInstanceContext);
// The view needs a reference to the join execution to pull iterator values
indicatorView.setJoinExecutionStrategy(execution);
// Hook up dispatchable with buffer and execution strategy
JoinExecStrategyDispatchable joinStatementDispatch = new JoinExecStrategyDispatchable(execution, statementSpec.getStreamSpecs().size());
agentInstanceContext.getEpStatementAgentInstanceHandle().setOptionalDispatchable(joinStatementDispatch);
JoinPreloadMethod preloadMethod;
if (joinAnalysisResult.getUnidirectionalStreamNumber() >= 0)
{
preloadMethod = new JoinPreloadMethodNull();
}
else
{
preloadMethod = new JoinPreloadMethodImpl(streamNames.length, joinSetComposerDesc.getJoinSetComposer());
}
// Create buffer for each view. Point buffer to dispatchable for join.
for (int i = 0; i < statementSpec.getStreamSpecs().size(); i++)
{
BufferView buffer = new BufferView(i);
streamViews[i].addView(buffer);
buffer.setObserver(joinStatementDispatch);
preloadMethod.setBuffer(buffer, i);
}
return new JoinPlanResult(indicatorView, preloadMethod, joinSetComposerDesc);
}