本文整理匯總了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);
}