本文整理汇总了Java中com.espertech.esper.epl.spec.OnTriggerType类的典型用法代码示例。如果您正苦于以下问题:Java OnTriggerType类的具体用法?Java OnTriggerType怎么用?Java OnTriggerType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnTriggerType类属于com.espertech.esper.epl.spec包,在下文中一共展示了OnTriggerType类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void update(EventBean[] newData, EventBean[] oldData) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qInfraOnAction(OnTriggerType.ON_MERGE, newData, CollectionUtil.EVENTBEANARRAY_EMPTY);
}
if (newData == null) {
return;
}
OneEventCollection newColl = new OneEventCollection();
factory.getNamedWindowOnMergeHelper().getInsertUnmatched().apply(null, newData, newColl, null, exprEvaluatorContext);
NamedWindowOnMergeView.applyDelta(newColl, null, factory, rootView, this);
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
}
示例2: handleMatching
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void handleMatching(EventBean[] triggerEvents, EventBean[] matchingEvents) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qInfraOnAction(OnTriggerType.ON_DELETE, triggerEvents, matchingEvents);
}
if ((matchingEvents != null) && (matchingEvents.length > 0)) {
// Events to delete are indicated via old data
this.rootView.update(null, matchingEvents);
// The on-delete listeners receive the events deleted, but only if there is interest
if (parent.getStatementResultService().isMakeNatural() || parent.getStatementResultService().isMakeSynthetic()) {
updateChildren(matchingEvents, null);
}
}
// Keep the last delete records
lastResult = matchingEvents;
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
}
示例3: update
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void update(EventBean[] newData, EventBean[] oldData) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qInfraOnAction(OnTriggerType.ON_MERGE, newData, CollectionUtil.EVENTBEANARRAY_EMPTY);
}
boolean postResultsToListeners = parent.getStatementResultService().isMakeNatural() || parent.getStatementResultService().isMakeSynthetic();
TableOnMergeViewChangeHandler changeHandlerAdded = null;
if (postResultsToListeners) {
changeHandlerAdded = new TableOnMergeViewChangeHandler(parent.getTableMetadata());
}
parent.getOnMergeHelper().getInsertUnmatched().apply(null, newData, tableStateInstance, changeHandlerAdded, null, exprEvaluatorContext);
// The on-delete listeners receive the events deleted, but only if there is interest
if (postResultsToListeners) {
EventBean[] postedNew = changeHandlerAdded.getEvents();
if (postedNew != null) {
updateChildren(postedNew, null);
}
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
}
示例4: handleMatching
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void handleMatching(EventBean[] triggerEvents, EventBean[] matchingEvents) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qInfraOnAction(OnTriggerType.ON_DELETE, triggerEvents, matchingEvents);
}
if ((matchingEvents != null) && (matchingEvents.length > 0)) {
for (EventBean event : matchingEvents) {
tableStateInstance.deleteEvent(event);
}
// The on-delete listeners receive the events deleted, but only if there is interest
if (parent.getStatementResultService().isMakeNatural() || parent.getStatementResultService().isMakeSynthetic()) {
EventBean[] posted = TableOnViewUtil.toPublic(matchingEvents, parent.getTableMetadata(), triggerEvents, true, super.getExprEvaluatorContext());
updateChildren(posted, null);
}
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
}
示例5: handleMatching
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void handleMatching(EventBean[] triggerEvents, EventBean[] matchingEvents) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qInfraOnAction(OnTriggerType.ON_UPDATE, triggerEvents, matchingEvents);
}
EventBean[] eventsPerStream = new EventBean[3];
boolean postUpdates = parent.getStatementResultService().isMakeNatural() || parent.getStatementResultService().isMakeSynthetic();
EventBean[] postedOld = null;
if (postUpdates) {
postedOld = TableOnViewUtil.toPublic(matchingEvents, parent.getTableMetadata(), triggerEvents, false, super.getExprEvaluatorContext());
}
TableUpdateStrategy tableUpdateStrategy = parent.getTableUpdateStrategy();
for (EventBean triggerEvent : triggerEvents) {
eventsPerStream[1] = triggerEvent;
tableUpdateStrategy.updateTable(Arrays.asList(matchingEvents), tableStateInstance, eventsPerStream, exprEvaluatorContext);
}
// The on-delete listeners receive the events deleted, but only if there is interest
if (postUpdates) {
EventBean[] postedNew = TableOnViewUtil.toPublic(matchingEvents, parent.getTableMetadata(), triggerEvents, true, super.getExprEvaluatorContext());
updateChildren(postedNew, postedOld);
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
}
示例6: determineFinalOutputView
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public View determineFinalOutputView(AgentInstanceContext agentInstanceContext, View onExprView) {
if ((statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_DELETE) ||
(statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_UPDATE) ||
(statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_MERGE)) {
ResultSetProcessor outputResultSetProcessor = outputResultSetProcessorPrototype.getResultSetProcessorFactory().instantiate(null, null, agentInstanceContext);
View outputView = outputProcessViewFactory.makeView(outputResultSetProcessor, agentInstanceContext);
onExprView.addView(outputView);
return outputView;
}
return onExprView;
}
示例7: determineFinalOutputView
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public View determineFinalOutputView(AgentInstanceContext agentInstanceContext, View onExprView) {
if ((statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_DELETE) ||
(statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_UPDATE) ||
(statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_MERGE)) {
ResultSetProcessor outputResultSetProcessor = outputResultSetProcessorPrototype.getResultSetProcessorFactory().instantiate(null, null, agentInstanceContext);
View outputView = outputProcessViewFactory.makeView(outputResultSetProcessor, agentInstanceContext);
onExprView.addView(outputView);
return outputView;
}
return onExprView;
}
示例8: handleMatching
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void handleMatching(EventBean[] triggerEvents, EventBean[] matchingEvents) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qInfraOnAction(OnTriggerType.ON_UPDATE, triggerEvents, matchingEvents);
}
if ((matchingEvents == null) || (matchingEvents.length == 0)) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
return;
}
EventBean[] eventsPerStream = new EventBean[3];
OneEventCollection newData = new OneEventCollection();
OneEventCollection oldData = new OneEventCollection();
for (EventBean triggerEvent : triggerEvents) {
eventsPerStream[1] = triggerEvent;
for (EventBean matchingEvent : matchingEvents) {
EventBean copy = parent.getUpdateHelper().updateWCopy(matchingEvent, eventsPerStream, super.getExprEvaluatorContext());
newData.add(copy);
oldData.add(matchingEvent);
}
}
if (!newData.isEmpty()) {
// Events to delete are indicated via old data
this.rootView.update(newData.toArray(), oldData.toArray());
// The on-delete listeners receive the events deleted, but only if there is interest
if (parent.getStatementResultService().isMakeNatural() || parent.getStatementResultService().isMakeSynthetic()) {
updateChildren(newData.toArray(), oldData.toArray());
}
}
// Keep the last delete records
lastResult = matchingEvents;
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
}
示例9: handleMatching
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void handleMatching(EventBean[] triggerEvents, EventBean[] matchingEvents) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qInfraOnAction(OnTriggerType.ON_SELECT, triggerEvents, matchingEvents);
}
EventBean[] newData;
// clear state from prior results
resultSetProcessor.clear();
// build join result
// use linked hash set to retain order of join results for last/first/window to work most intuitively
Set<MultiKey<EventBean>> newEvents = NamedWindowOnSelectView.buildJoinResult(triggerEvents, matchingEvents);
// process matches
UniformPair<EventBean[]> pair = resultSetProcessor.processJoinResult(newEvents, Collections.<MultiKey<EventBean>>emptySet(), false);
newData = pair != null ? pair.getFirst() : null;
if (parent.isDistinct()) {
newData = EventBeanUtility.getDistinctByProp(newData, parent.getEventBeanReader());
}
if (parent.getInternalEventRouter() != null) {
if (newData != null) {
for (int i = 0; i < newData.length; i++) {
if (audit) {
AuditPath.auditInsertInto(getExprEvaluatorContext().getEngineURI(), getExprEvaluatorContext().getStatementName(), newData[i]);
}
parent.getInternalEventRouter().route(newData[i], parent.getStatementHandle(), parent.getInternalEventRouteDest(), getExprEvaluatorContext(), false);
}
}
}
// The on-select listeners receive the events selected
if ((newData != null) && (newData.length > 0)) {
// And post only if we have listeners/subscribers that need the data
if (parent.getStatementResultService().isMakeNatural() || parent.getStatementResultService().isMakeSynthetic()) {
updateChildren(newData, null);
}
}
// clear state from prior results
resultSetProcessor.clear();
// Events to delete are indicated via old data
if (deleteAndSelect) {
for (EventBean event : matchingEvents) {
tableStateInstance.deleteEvent(event);
}
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aInfraOnAction();
}
}
示例10: getStatementType
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public static StatementType getStatementType(StatementSpecRaw statementSpec, boolean pattern) {
// determine statement type
StatementType statementType = null;
if (statementSpec.getCreateVariableDesc() != null) {
statementType = StatementType.CREATE_VARIABLE;
} else if (statementSpec.getCreateTableDesc() != null) {
statementType = StatementType.CREATE_TABLE;
} else if (statementSpec.getCreateWindowDesc() != null) {
statementType = StatementType.CREATE_WINDOW;
} else if (statementSpec.getOnTriggerDesc() != null) {
if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_DELETE) {
statementType = StatementType.ON_DELETE;
} else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_UPDATE) {
statementType = StatementType.ON_UPDATE;
} else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_SELECT) {
if (statementSpec.getInsertIntoDesc() != null) {
statementType = StatementType.ON_INSERT;
} else {
statementType = StatementType.ON_SELECT;
}
} else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_SET) {
statementType = StatementType.ON_SET;
} else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_MERGE) {
statementType = StatementType.ON_MERGE;
} else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_SPLITSTREAM) {
statementType = StatementType.ON_SPLITSTREAM;
}
} else if (statementSpec.getInsertIntoDesc() != null) {
statementType = StatementType.INSERT_INTO;
} else if (pattern) {
statementType = StatementType.PATTERN;
} else if (statementSpec.getUpdateDesc() != null) {
statementType = StatementType.UPDATE;
} else if (statementSpec.getCreateIndexDesc() != null) {
statementType = StatementType.CREATE_INDEX;
} else if (statementSpec.getCreateContextDesc() != null) {
statementType = StatementType.CREATE_CONTEXT;
} else if (statementSpec.getCreateSchemaDesc() != null) {
statementType = StatementType.CREATE_SCHEMA;
} else if (statementSpec.getCreateDataFlowDesc() != null) {
statementType = StatementType.CREATE_DATAFLOW;
} else if (statementSpec.getCreateExpressionDesc() != null) {
statementType = StatementType.CREATE_EXPRESSION;
}
if (statementType == null) {
statementType = StatementType.SELECT;
}
return statementType;
}
示例11: getStatementType
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public static StatementType getStatementType(StatementSpecRaw statementSpec, boolean pattern) {
// determine statement type
StatementType statementType = null;
if (statementSpec.getCreateVariableDesc() != null) {
statementType = StatementType.CREATE_VARIABLE;
}
else if (statementSpec.getCreateWindowDesc() != null) {
statementType = StatementType.CREATE_WINDOW;
}
else if (statementSpec.getOnTriggerDesc() != null) {
if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_DELETE) {
statementType = StatementType.ON_DELETE;
}
else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_UPDATE) {
statementType = StatementType.ON_UPDATE;
}
else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_SELECT) {
if (statementSpec.getInsertIntoDesc() != null) {
statementType = StatementType.ON_INSERT;
}
else {
statementType = StatementType.ON_SELECT;
}
}
else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_SET) {
statementType = StatementType.ON_SET;
}
else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_MERGE) {
statementType = StatementType.ON_MERGE;
}
else if (statementSpec.getOnTriggerDesc().getOnTriggerType() == OnTriggerType.ON_SPLITSTREAM) {
statementType = StatementType.ON_SPLITSTREAM;
}
}
else if (statementSpec.getInsertIntoDesc() != null) {
statementType = StatementType.INSERT_INTO;
}
else if (pattern) {
statementType = StatementType.PATTERN;
}
else if (statementSpec.getUpdateDesc() != null) {
statementType = StatementType.UPDATE;
}
else if (statementSpec.getCreateIndexDesc() != null) {
statementType = StatementType.CREATE_INDEX;
}
else if (statementSpec.getCreateContextDesc() != null) {
statementType = StatementType.CREATE_CONTEXT;
}
else if (statementSpec.getCreateSchemaDesc() != null) {
statementType = StatementType.CREATE_SCHEMA;
}
else if (statementSpec.getCreateDataFlowDesc() != null) {
statementType = StatementType.CREATE_GRAPH;
}
else if (statementSpec.getCreateExpressionDesc() != null) {
statementType = StatementType.CREATE_EXPRESSION;
}
if (statementType == null) {
statementType = StatementType.SELECT;
}
return statementType;
}
示例12: qInfraOnAction
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void qInfraOnAction(OnTriggerType triggerType, EventBean[] triggerEvents, EventBean[] matchingEvents) {
}
示例13: qInfraOnAction
import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
void qInfraOnAction(OnTriggerType triggerType, EventBean[] triggerEvents, EventBean[] matchingEvents);