当前位置: 首页>>代码示例>>Java>>正文


Java OnTriggerType类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:17,代码来源:NamedWindowOnMergeInsertUnmatched.java

示例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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:23,代码来源:NamedWindowOnDeleteView.java

示例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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:26,代码来源:TableOnMergeInsertUnmatched.java

示例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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:22,代码来源:TableOnDeleteView.java

示例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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:31,代码来源:TableOnUpdateView.java

示例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;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:14,代码来源:StatementAgentInstanceFactoryOnTriggerTable.java

示例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;
    }
 
开发者ID:espertechinc,项目名称:esper,代码行数:15,代码来源:StatementAgentInstanceFactoryOnTriggerNamedWindow.java

示例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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:43,代码来源:NamedWindowOnUpdateView.java

示例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();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:56,代码来源:TableOnSelectView.java

示例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;
    }
 
开发者ID:espertechinc,项目名称:esper,代码行数:51,代码来源:StatementMetadataFactoryDefault.java

示例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;
    }
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:65,代码来源:StatementMetadataFactoryDefault.java

示例12: qInfraOnAction

import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
public void qInfraOnAction(OnTriggerType triggerType, EventBean[] triggerEvents, EventBean[] matchingEvents) {

    }
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:InstrumentationDefault.java

示例13: qInfraOnAction

import com.espertech.esper.epl.spec.OnTriggerType; //导入依赖的package包/类
void qInfraOnAction(OnTriggerType triggerType, EventBean[] triggerEvents, EventBean[] matchingEvents); 
开发者ID:espertechinc,项目名称:esper,代码行数:2,代码来源:Instrumentation.java


注:本文中的com.espertech.esper.epl.spec.OnTriggerType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。