當前位置: 首頁>>代碼示例>>Java>>正文


Java UniformPair.setSecond方法代碼示例

本文整理匯總了Java中com.espertech.esper.collection.UniformPair.setSecond方法的典型用法代碼示例。如果您正苦於以下問題:Java UniformPair.setSecond方法的具體用法?Java UniformPair.setSecond怎麽用?Java UniformPair.setSecond使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.espertech.esper.collection.UniformPair的用法示例。


在下文中一共展示了UniformPair.setSecond方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: output

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public UniformPair<EventBean[]> output() {
    UniformPair<EventBean[]> newOldEvents = null;
    if (lastEventIStreamForOutputLast != null) {
        EventBean[] istream = new EventBean[]{lastEventIStreamForOutputLast};
        newOldEvents = new UniformPair<>(istream, null);
    }
    if (lastEventRStreamForOutputLast != null) {
        EventBean[] rstream = new EventBean[]{lastEventRStreamForOutputLast};
        if (newOldEvents == null) {
            newOldEvents = new UniformPair<>(null, rstream);
        } else {
            newOldEvents.setSecond(rstream);
        }
    }

    lastEventIStreamForOutputLast = null;
    lastEventRStreamForOutputLast = null;
    return newOldEvents;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:20,代碼來源:ResultSetProcessorRowPerEventOutputLastHelperImpl.java

示例2: update

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPServiceProvider epServiceProvider) {
    UniformPair<EventBean> pair = firstLastPerStmt.get(statement);
    if (pair == null) {
        firstLastPerStmt.put(statement, new UniformPair<>(newEvents[0], null));
    } else {
        pair.setSecond(newEvents[0]);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:9,代碼來源:ExecMTDeployAtomic.java

示例3: update

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
 * The update method is called if the view does not participate in a join.
 *
 * @param newData - new events
 * @param oldData - old events
 */
public void update(EventBean[] newData, EventBean[] oldData) {
    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) {
        log.debug(".update Received update, " +
                "  newData.length==" + ((newData == null) ? 0 : newData.length) +
                "  oldData.length==" + ((oldData == null) ? 0 : oldData.length));
    }

    boolean isGenerateSynthetic = parent.getStatementResultService().isMakeSynthetic();
    boolean isGenerateNatural = parent.getStatementResultService().isMakeNatural();

    UniformPair<EventBean[]> newOldEvents = resultSetProcessor.processViewResult(newData, oldData, isGenerateSynthetic);

    if (!super.checkAfterCondition(newOldEvents, parent.getStatementContext())) {
        return;
    }

    if (parent.isDistinct() && newOldEvents != null) {
        newOldEvents.setFirst(EventBeanUtility.getDistinctByProp(newOldEvents.getFirst(), parent.getEventBeanReader()));
        newOldEvents.setSecond(EventBeanUtility.getDistinctByProp(newOldEvents.getSecond(), parent.getEventBeanReader()));
    }

    if ((!isGenerateSynthetic) && (!isGenerateNatural)) {
        if (AuditPath.isAuditEnabled) {
            OutputStrategyUtil.indicateEarlyReturn(parent.getStatementContext(), newOldEvents);
        }
        return;
    }

    boolean forceOutput = false;
    if ((newData == null) && (oldData == null) &&
            ((newOldEvents == null) || (newOldEvents.getFirst() == null && newOldEvents.getSecond() == null))) {
        forceOutput = true;
    }

    // Child view can be null in replay from named window
    if (childView != null) {
        postProcess(forceOutput, newOldEvents, childView);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:46,代碼來源:OutputProcessViewDirectDistinctOrAfter.java

示例4: process

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
 * This process (update) method is for participation in a join.
 *
 * @param newEvents - new events
 * @param oldEvents - old events
 */
public void process(Set<MultiKey<EventBean>> newEvents, Set<MultiKey<EventBean>> oldEvents, ExprEvaluatorContext exprEvaluatorContext) {
    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) {
        log.debug(".process Received update, " +
                "  newData.length==" + ((newEvents == null) ? 0 : newEvents.size()) +
                "  oldData.length==" + ((oldEvents == null) ? 0 : oldEvents.size()));
    }

    boolean isGenerateSynthetic = parent.getStatementResultService().isMakeSynthetic();
    boolean isGenerateNatural = parent.getStatementResultService().isMakeNatural();

    UniformPair<EventBean[]> newOldEvents = resultSetProcessor.processJoinResult(newEvents, oldEvents, isGenerateSynthetic);

    if (!checkAfterCondition(newOldEvents, parent.getStatementContext())) {
        return;
    }

    if (parent.isDistinct() && newOldEvents != null) {
        newOldEvents.setFirst(EventBeanUtility.getDistinctByProp(newOldEvents.getFirst(), parent.getEventBeanReader()));
        newOldEvents.setSecond(EventBeanUtility.getDistinctByProp(newOldEvents.getSecond(), parent.getEventBeanReader()));
    }

    if ((!isGenerateSynthetic) && (!isGenerateNatural)) {
        if (AuditPath.isAuditEnabled) {
            OutputStrategyUtil.indicateEarlyReturn(parent.getStatementContext(), newOldEvents);
        }
        return;
    }

    if (newOldEvents == null) {
        return;
    }

    // Child view can be null in replay from named window
    if (childView != null) {
        postProcess(false, newOldEvents, childView);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:44,代碼來源:OutputProcessViewDirectDistinctOrAfter.java

示例5: continueOutputProcessingViewAndJoin

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private void continueOutputProcessingViewAndJoin(boolean doOutput, boolean forceUpdate, UniformPair<EventBean[]> newOldEvents) {

        if (parent.isDistinct() && newOldEvents != null) {
            newOldEvents.setFirst(EventBeanUtility.getDistinctByProp(newOldEvents.getFirst(), parent.getEventBeanReader()));
            newOldEvents.setSecond(EventBeanUtility.getDistinctByProp(newOldEvents.getSecond(), parent.getEventBeanReader()));
        }

        if (doOutput) {
            output(forceUpdate, newOldEvents);
        }

        if (InstrumentationHelper.ENABLED) {
            InstrumentationHelper.get().aOutputRateConditionOutputNow(true);
        }
    }
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:16,代碼來源:OutputProcessViewConditionLastAllUnord.java

示例6: continueOutputLimitedLastNonBuffered

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> continueOutputLimitedLastNonBuffered(boolean isSynthesize) {
    EventBean[] events = processor.getSelectListEventsAsArray(true, isSynthesize, false);
    UniformPair<EventBean[]> result = new UniformPair<>(events, null);

    if (processor.isSelectRStream() && lastEventRStreamForOutputLast == null) {
        lastEventRStreamForOutputLast = processor.getSelectListEventsAsArray(false, isSynthesize, false);
    }
    if (lastEventRStreamForOutputLast != null) {
        result.setSecond(lastEventRStreamForOutputLast);
        lastEventRStreamForOutputLast = null;
    }

    return result;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:15,代碼來源:ResultSetProcessorRowForAllOutputLastHelperImpl.java

示例7: update

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
 * The update method is called if the view does not participate in a join.
 *
 * @param newData - new events
 * @param oldData - old events
 */
public void update(EventBean[] newData, EventBean[] oldData) {
    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) {
        log.debug(".update Received update, " +
                "  newData.length==" + ((newData == null) ? 0 : newData.length) +
                "  oldData.length==" + ((oldData == null) ? 0 : oldData.length));
    }

    if (!super.checkAfterCondition(newData, parent.getStatementContext())) {
        return;
    }

    if (!witnessedFirst) {
        boolean isGenerateSynthetic = parent.getStatementResultService().isMakeSynthetic();

        // Process the events and get the result
        viewEventsList.add(new UniformPair<EventBean[]>(newData, oldData));
        UniformPair<EventBean[]> newOldEvents = resultSetProcessor.processOutputLimitedView(viewEventsList, isGenerateSynthetic);
        viewEventsList.clear();

        if (!hasRelevantResults(newOldEvents)) {
            return;
        }

        witnessedFirst = true;

        if (parent.isDistinct()) {
            newOldEvents.setFirst(EventBeanUtility.getDistinctByProp(newOldEvents.getFirst(), parent.getEventBeanReader()));
            newOldEvents.setSecond(EventBeanUtility.getDistinctByProp(newOldEvents.getSecond(), parent.getEventBeanReader()));
        }

        boolean isGenerateNatural = parent.getStatementResultService().isMakeNatural();
        if ((!isGenerateSynthetic) && (!isGenerateNatural)) {
            if (AuditPath.isAuditEnabled) {
                OutputStrategyUtil.indicateEarlyReturn(parent.getStatementContext(), newOldEvents);
            }
            return;
        }

        output(true, newOldEvents);
    } else {
        viewEventsList.add(new UniformPair<EventBean[]>(newData, oldData));
        resultSetProcessor.processOutputLimitedView(viewEventsList, false);
        viewEventsList.clear();
    }

    int newDataLength = 0;
    int oldDataLength = 0;
    if (newData != null) {
        newDataLength = newData.length;
    }
    if (oldData != null) {
        oldDataLength = oldData.length;
    }

    outputCondition.updateOutputCondition(newDataLength, oldDataLength);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:63,代碼來源:OutputProcessViewConditionFirst.java

示例8: process

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
 * This process (update) method is for participation in a join.
 *
 * @param newEvents - new events
 * @param oldEvents - old events
 */
public void process(Set<MultiKey<EventBean>> newEvents, Set<MultiKey<EventBean>> oldEvents, ExprEvaluatorContext exprEvaluatorContext) {
    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) {
        log.debug(".process Received update, " +
                "  newData.length==" + ((newEvents == null) ? 0 : newEvents.size()) +
                "  oldData.length==" + ((oldEvents == null) ? 0 : oldEvents.size()));
    }

    if (!super.checkAfterCondition(newEvents, parent.getStatementContext())) {
        return;
    }

    // add the incoming events to the event batches
    if (!witnessedFirst) {
        addToChangeSet(joinEventsSet, newEvents, oldEvents);
        boolean isGenerateSynthetic = parent.getStatementResultService().isMakeSynthetic();
        UniformPair<EventBean[]> newOldEvents = resultSetProcessor.processOutputLimitedJoin(joinEventsSet, isGenerateSynthetic);
        joinEventsSet.clear();

        if (!hasRelevantResults(newOldEvents)) {
            return;
        }

        witnessedFirst = true;

        if (parent.isDistinct()) {
            newOldEvents.setFirst(EventBeanUtility.getDistinctByProp(newOldEvents.getFirst(), parent.getEventBeanReader()));
            newOldEvents.setSecond(EventBeanUtility.getDistinctByProp(newOldEvents.getSecond(), parent.getEventBeanReader()));
        }

        boolean isGenerateNatural = parent.getStatementResultService().isMakeNatural();
        if ((!isGenerateSynthetic) && (!isGenerateNatural)) {
            if (AuditPath.isAuditEnabled) {
                OutputStrategyUtil.indicateEarlyReturn(parent.getStatementContext(), newOldEvents);
            }
            return;
        }

        output(true, newOldEvents);
    } else {
        addToChangeSet(joinEventsSet, newEvents, oldEvents);

        // Process the events and get the result
        resultSetProcessor.processOutputLimitedJoin(joinEventsSet, false);
        joinEventsSet.clear();
    }

    int newEventsSize = 0;
    if (newEvents != null) {
        newEventsSize = newEvents.size();
    }

    int oldEventsSize = 0;
    if (oldEvents != null) {
        oldEventsSize = oldEvents.size();
    }

    outputCondition.updateOutputCondition(newEventsSize, oldEventsSize);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:65,代碼來源:OutputProcessViewConditionFirst.java

示例9: continueOutputProcessingView

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
 * Called once the output condition has been met.
 * Invokes the result set processor.
 * Used for non-join event data.
 *
 * @param doOutput    - true if the batched events should actually be output as well as processed, false if they should just be processed
 * @param forceUpdate - true if output should be made even when no updating events have arrived
 */
protected void continueOutputProcessingView(boolean doOutput, boolean forceUpdate) {
    if (InstrumentationHelper.ENABLED) {
        InstrumentationHelper.get().qOutputRateConditionOutputNow();
    }

    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) {
        log.debug(".continueOutputProcessingView");
    }

    boolean isGenerateSynthetic = parent.getStatementResultService().isMakeSynthetic();
    boolean isGenerateNatural = parent.getStatementResultService().isMakeNatural();

    // Process the events and get the result
    UniformPair<EventBean[]> newOldEvents = resultSetProcessor.processOutputLimitedView(deltaSet.getViewEventsSet(), isGenerateSynthetic);

    if (parent.isDistinct() && newOldEvents != null) {
        newOldEvents.setFirst(EventBeanUtility.getDistinctByProp(newOldEvents.getFirst(), parent.getEventBeanReader()));
        newOldEvents.setSecond(EventBeanUtility.getDistinctByProp(newOldEvents.getSecond(), parent.getEventBeanReader()));
    }

    if ((!isGenerateSynthetic) && (!isGenerateNatural)) {
        if (AuditPath.isAuditEnabled) {
            OutputStrategyUtil.indicateEarlyReturn(parent.getStatementContext(), newOldEvents);
        }
        resetEventBatches();
        if (InstrumentationHelper.ENABLED) {
            InstrumentationHelper.get().aOutputRateConditionOutputNow(false);
        }
        return;
    }

    if (doOutput) {
        output(forceUpdate, newOldEvents);
    }
    resetEventBatches();

    if (InstrumentationHelper.ENABLED) {
        InstrumentationHelper.get().aOutputRateConditionOutputNow(true);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:49,代碼來源:OutputProcessViewConditionDefault.java

示例10: continueOutputProcessingJoin

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
 * Called once the output condition has been met.
 * Invokes the result set processor.
 * Used for join event data.
 *
 * @param doOutput    - true if the batched events should actually be output as well as processed, false if they should just be processed
 * @param forceUpdate - true if output should be made even when no updating events have arrived
 */
protected void continueOutputProcessingJoin(boolean doOutput, boolean forceUpdate) {
    if (InstrumentationHelper.ENABLED) {
        InstrumentationHelper.get().qOutputRateConditionOutputNow();
    }

    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) {
        log.debug(".continueOutputProcessingJoin");
    }

    boolean isGenerateSynthetic = parent.getStatementResultService().isMakeSynthetic();
    boolean isGenerateNatural = parent.getStatementResultService().isMakeNatural();

    // Process the events and get the result
    UniformPair<EventBean[]> newOldEvents = resultSetProcessor.processOutputLimitedJoin(deltaSet.getJoinEventsSet(), isGenerateSynthetic);

    if (parent.isDistinct() && newOldEvents != null) {
        newOldEvents.setFirst(EventBeanUtility.getDistinctByProp(newOldEvents.getFirst(), parent.getEventBeanReader()));
        newOldEvents.setSecond(EventBeanUtility.getDistinctByProp(newOldEvents.getSecond(), parent.getEventBeanReader()));
    }

    if ((!isGenerateSynthetic) && (!isGenerateNatural)) {
        if (AuditPath.isAuditEnabled) {
            OutputStrategyUtil.indicateEarlyReturn(parent.getStatementContext(), newOldEvents);
        }
        resetEventBatches();
        if (InstrumentationHelper.ENABLED) {
            InstrumentationHelper.get().aOutputRateConditionOutputNow(false);
        }
        return;
    }

    if (doOutput) {
        output(forceUpdate, newOldEvents);
    }
    resetEventBatches();

    if (InstrumentationHelper.ENABLED) {
        InstrumentationHelper.get().aOutputRateConditionOutputNow(true);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:49,代碼來源:OutputProcessViewConditionDefault.java


注:本文中的com.espertech.esper.collection.UniformPair.setSecond方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。