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


Java UniformPair.getSecond方法代碼示例

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


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

示例1: hasRelevantResults

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private boolean hasRelevantResults(UniformPair<EventBean[]> newOldEvents) {
    if (newOldEvents == null) {
        return false;
    }
    if (parent.getSelectClauseStreamSelectorEnum() == SelectClauseStreamSelectorEnum.ISTREAM_ONLY) {
        if (newOldEvents.getFirst() == null) {
            return false; // nothing to indicate
        }
    } else if (parent.getSelectClauseStreamSelectorEnum() == SelectClauseStreamSelectorEnum.RSTREAM_ISTREAM_BOTH) {
        if (newOldEvents.getFirst() == null && newOldEvents.getSecond() == null) {
            return false; // nothing to indicate
        }
    } else {
        if (newOldEvents.getSecond() == null) {
            return false; // nothing to indicate
        }
    }
    return true;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:20,代碼來源:OutputProcessViewConditionFirst.java

示例2: assertUnderlyingPerRow

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
 * Assert that the underlying objects of the events (insert and remove pair) match the expected insert and removed objects.
 *
 * @param received                 provides events
 * @param expectedUnderlyingInsert expected underlying object insert stream
 * @param expectedUnderlyingRemove expected underlying object remove stream
 */
public static void assertUnderlyingPerRow(UniformPair<EventBean[]> received, Object[] expectedUnderlyingInsert, Object[] expectedUnderlyingRemove) {
    EventBean[] newEvents = received.getFirst();
    EventBean[] oldEvents = received.getSecond();

    if (expectedUnderlyingInsert != null) {
        ScopeTestHelper.assertEquals(expectedUnderlyingInsert.length, newEvents.length);
        for (int i = 0; i < expectedUnderlyingInsert.length; i++) {
            ScopeTestHelper.assertSame(expectedUnderlyingInsert[i], newEvents[i].getUnderlying());
        }
    } else {
        ScopeTestHelper.assertNull(newEvents);
    }

    if (expectedUnderlyingRemove != null) {
        ScopeTestHelper.assertEquals(expectedUnderlyingRemove.length, oldEvents.length);
        for (int i = 0; i < expectedUnderlyingRemove.length; i++) {
            ScopeTestHelper.assertSame(expectedUnderlyingRemove[i], oldEvents[i].getUnderlying());
        }
    } else {
        ScopeTestHelper.assertNull(oldEvents);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:30,代碼來源:EPAssertionUtil.java

示例3: output

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public void output(boolean forceUpdate, UniformPair<EventBean[]> result, UpdateDispatchView finalView) {
    EventBean[] newEvents = result != null ? result.getFirst() : null;
    EventBean[] oldEvents = result != null ? result.getSecond() : null;

    // route first
    if (parent.isRoute()) {
        if ((newEvents != null) && (parent.getInsertIntoStreamSelector().isSelectsIStream())) {
            route(newEvents, agentInstanceContext);
        }

        if ((oldEvents != null) && (parent.getInsertIntoStreamSelector().isSelectsRStream())) {
            route(oldEvents, agentInstanceContext);
        }
    }

    // discard one side of results
    if (parent.getSelectStreamDirEnum() == SelectClauseStreamSelectorEnum.RSTREAM_ONLY) {
        newEvents = oldEvents;
        oldEvents = null;
    } else if (parent.getSelectStreamDirEnum() == SelectClauseStreamSelectorEnum.ISTREAM_ONLY) {
        oldEvents = null;   // since the insert-into may require rstream
    }

    // dispatch
    if (newEvents != null || oldEvents != null) {
        finalView.newResult(new UniformPair<EventBean[]>(newEvents, oldEvents));
    } else if (forceUpdate) {
        finalView.newResult(new UniformPair<EventBean[]>(null, null));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:31,代碼來源:OutputStrategyPostProcess.java

示例4: processOutputLimitedJoinDefault

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> processOutputLimitedJoinDefault(List<UniformPair<Set<MultiKey<EventBean>>>> joinEventsSet, boolean generateSynthetic) {
    List<EventBean> newEvents = new LinkedList<>();
    List<EventBean> oldEvents = null;
    if (prototype.isSelectRStream()) {
        oldEvents = new LinkedList<>();
    }

    List<Object> newEventsSortKey = null;
    List<Object> oldEventsSortKey = null;
    if (orderByProcessor != null) {
        newEventsSortKey = new LinkedList<>();
        if (prototype.isSelectRStream()) {
            oldEventsSortKey = new LinkedList<>();
        }
    }

    for (UniformPair<Set<MultiKey<EventBean>>> pair : joinEventsSet) {
        Set<MultiKey<EventBean>> newData = pair.getFirst();
        Set<MultiKey<EventBean>> oldData = pair.getSecond();

        Object[] newDataMultiKey = generateGroupKeyArrayJoin(newData, true);
        Object[] oldDataMultiKey = generateGroupKeyArrayJoin(oldData, false);

        if (prototype.isUnidirectional()) {
            this.clear();
        }

        ResultSetProcessorGroupedUtil.applyAggJoinResultKeyedJoin(aggregationService, agentInstanceContext, newData, newDataMultiKey, oldData, oldDataMultiKey);

        if (prototype.isSelectRStream()) {
            generateOutputBatchedJoinUnkeyed(oldData, oldDataMultiKey, false, generateSynthetic, oldEvents, oldEventsSortKey);
        }
        generateOutputBatchedJoinUnkeyed(newData, newDataMultiKey, true, generateSynthetic, newEvents, newEventsSortKey);
    }

    return ResultSetProcessorUtil.finalizeOutputMaySortMayRStream(newEvents, newEventsSortKey, oldEvents, oldEventsSortKey, prototype.isSelectRStream(), orderByProcessor, agentInstanceContext);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:38,代碼來源:ResultSetProcessorAggregateGroupedImpl.java

示例5: output

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public static void output(boolean forceUpdate, UniformPair<EventBean[]> result, UpdateDispatchView finalView) {
    EventBean[] newEvents = result != null ? result.getFirst() : null;
    EventBean[] oldEvents = result != null ? result.getSecond() : null;
    if (newEvents != null || oldEvents != null) {
        finalView.newResult(result);
    } else if (forceUpdate) {
        finalView.newResult(result);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:10,代碼來源:OutputStrategyUtil.java

示例6: indicate

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public void indicate(UniformPair<EventBean[]> results) {
    if (results != null) {
        if ((MetricReportingPath.isMetricsEnabled) && (statementMetricHandle.isEnabled())) {
            int numIStream = (results.getFirst() != null) ? results.getFirst().length : 0;
            int numRStream = (results.getSecond() != null) ? results.getSecond().length : 0;
            this.metricReportingService.accountOutput(statementMetricHandle, numIStream, numRStream);
        }

        if ((results.getFirst() != null) && (results.getFirst().length != 0)) {
            lastResults.get().add(results);
        } else if ((results.getSecond() != null) && (results.getSecond().length != 0)) {
            lastResults.get().add(results);
        }
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:16,代碼來源:StatementResultServiceImpl.java

示例7: rewriteScripts

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private static String rewriteScripts(List<UniformPair<Integer>> ranges, CommonTokenStream tokens) {
    if (ranges.isEmpty()) {
        return tokens.getText();
    }
    StringWriter writer = new StringWriter();
    int rangeIndex = 0;
    UniformPair<Integer> current = ranges.get(rangeIndex);
    for (int i = 0; i < tokens.size(); i++) {
        Token t = tokens.get(i);
        if (t.getType() == EsperEPL2GrammarLexer.EOF) {
            break;
        }
        if (i < current.getFirst()) {
            writer.append(t.getText());
        } else if (i == current.getFirst()) {
            writer.append(t.getText());
            writer.append("'");
        } else if (i == current.getSecond()) {
            writer.append("'");
            writer.append(t.getText());
            rangeIndex++;
            if (ranges.size() > rangeIndex) {
                current = ranges.get(rangeIndex);
            } else {
                current = new UniformPair<Integer>(-1, -1);
            }
        } else if (t.getType() == EsperEPL2GrammarParser.SL_COMMENT || t.getType() == EsperEPL2GrammarParser.ML_COMMENT) {
            writeCommentEscapeSingleQuote(writer, t);
        } else {
            if (t.getType() == EsperEPL2GrammarParser.QUOTED_STRING_LITERAL && i > current.getFirst() && i < current.getSecond()) {
                writer.append("\\'");
                writer.append(t.getText().substring(1, t.getText().length() - 1));
                writer.append("\\'");
            } else {
                writer.append(t.getText());
            }
        }
    }
    return writer.toString();
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:41,代碼來源:ParseHelper.java

示例8: testUpdateAll

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public void testUpdateAll() throws Exception {
    assertNull(ResultSetProcessorUtil.getSelectEventsNoHavingWithOrderBy(null, selectExprProcessor, orderByProcessor, (EventBean[]) null, true, false, null));

    EventBean testEvent1 = makeEvent(10, 5, 6);
    EventBean testEvent2 = makeEvent(11, 6, 7);
    EventBean[] newData = new EventBean[]{testEvent1, testEvent2};

    EventBean testEvent3 = makeEvent(20, 1, 2);
    EventBean testEvent4 = makeEvent(21, 3, 4);
    EventBean[] oldData = new EventBean[]{testEvent3, testEvent4};

    UniformPair<EventBean[]> result = outputProcessorAll.processViewResult(newData, oldData, false);
    EventBean[] newEvents = result.getFirst();
    EventBean[] oldEvents = result.getSecond();

    assertEquals(2, newEvents.length);
    assertEquals(10d, newEvents[0].get("resultOne"));
    assertEquals(30, newEvents[0].get("resultTwo"));

    assertEquals(11d, newEvents[1].get("resultOne"));
    assertEquals(42, newEvents[1].get("resultTwo"));

    assertEquals(2, oldEvents.length);
    assertEquals(20d, oldEvents[0].get("resultOne"));
    assertEquals(2, oldEvents[0].get("resultTwo"));

    assertEquals(21d, oldEvents[1].get("resultOne"));
    assertEquals(12, oldEvents[1].get("resultTwo"));
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:30,代碼來源:TestResultSetProcessorSimple.java

示例9: testProcessAll

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public void testProcessAll() throws Exception {
    assertNull(ResultSetProcessorUtil.getSelectJoinEventsNoHavingWithOrderBy(null, selectExprProcessor, orderByProcessor, new HashSet<MultiKey<EventBean>>(), true, false, null));

    EventBean testEvent1 = makeEvent(10, 5, 6);
    EventBean testEvent2 = makeEvent(11, 6, 7);
    Set<MultiKey<EventBean>> newEventSet = makeEventSet(testEvent1);
    newEventSet.add(new MultiKey<EventBean>(new EventBean[]{testEvent2}));

    EventBean testEvent3 = makeEvent(20, 1, 2);
    EventBean testEvent4 = makeEvent(21, 3, 4);
    Set<MultiKey<EventBean>> oldEventSet = makeEventSet(testEvent3);
    oldEventSet.add(new MultiKey<EventBean>(new EventBean[]{testEvent4}));

    UniformPair<EventBean[]> result = outputProcessorAll.processJoinResult(newEventSet, oldEventSet, false);
    EventBean[] newEvents = result.getFirst();
    EventBean[] oldEvents = result.getSecond();

    assertEquals(2, newEvents.length);
    assertEquals(10d, newEvents[0].get("resultOne"));
    assertEquals(30, newEvents[0].get("resultTwo"));

    assertEquals(11d, newEvents[1].get("resultOne"));
    assertEquals(42, newEvents[1].get("resultTwo"));

    assertEquals(2, oldEvents.length);
    assertEquals(20d, oldEvents[0].get("resultOne"));
    assertEquals(2, oldEvents[0].get("resultTwo"));

    assertEquals(21d, oldEvents[1].get("resultOne"));
    assertEquals(12, oldEvents[1].get("resultTwo"));
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:32,代碼來源:TestResultSetProcessorSimple.java

示例10: apply

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private void apply(UniformPair<EventBean[]> pair) {
    if (pair == null) {
        return;
    }
    if (pair.getFirst() != null && pair.getFirst().length > 0) {
        lastEventIStreamForOutputLast = pair.getFirst()[pair.getFirst().length - 1];
    }
    if (pair.getSecond() != null && pair.getSecond().length > 0) {
        lastEventRStreamForOutputLast = pair.getSecond()[pair.getSecond().length - 1];
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:12,代碼來源:ResultSetProcessorRowPerEventOutputLastHelperImpl.java

示例11: handleOutputLimitDefaultView

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> handleOutputLimitDefaultView(List<UniformPair<EventBean[]>> viewEventsList, boolean generateSynthetic) {

        List<EventBean> newEvents = new ArrayList<>();
        List<Object> newEventsSortKey = null;
        if (orderByProcessor != null) {
            newEventsSortKey = new ArrayList<>();
        }

        List<EventBean> oldEvents = null;
        List<Object> oldEventsSortKey = null;
        if (prototype.isSelectRStream()) {
            oldEvents = new ArrayList<>();
            if (orderByProcessor != null) {
                oldEventsSortKey = new ArrayList<>();
            }
        }

        EventBean[] eventsPerStream = new EventBean[1];
        for (UniformPair<EventBean[]> pair : viewEventsList) {
            EventBean[] newData = pair.getFirst();
            EventBean[] oldData = pair.getSecond();

            resetEventPerGroupBufView();
            Object[][] newDataMultiKey = generateGroupKeysView(newData, eventPerGroupBufView, true);
            Object[][] oldDataMultiKey = generateGroupKeysView(oldData, eventPerGroupBufView, false);

            if (prototype.isSelectRStream()) {
                generateOutputBatchedCollectView(eventPerGroupBufView, false, generateSynthetic, oldEvents, oldEventsSortKey, eventsPerStream);
            }

            ResultSetProcessorGroupedUtil.applyAggViewResultKeyedView(aggregationService, agentInstanceContext, newData, newDataMultiKey, oldData, oldDataMultiKey, eventsPerStream);

            generateOutputBatchedCollectView(eventPerGroupBufView, true, generateSynthetic, newEvents, newEventsSortKey, eventsPerStream);
        }

        return ResultSetProcessorUtil.finalizeOutputMaySortMayRStream(newEvents, newEventsSortKey, oldEvents, oldEventsSortKey, prototype.isSelectRStream(), orderByProcessor, agentInstanceContext);
    }
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:38,代碼來源:ResultSetProcessorRowPerGroupRollupImpl.java

示例12: handleOutputLimitDefaultJoin

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> handleOutputLimitDefaultJoin(List<UniformPair<Set<MultiKey<EventBean>>>> viewEventsList, boolean generateSynthetic) {

        List<EventBean> newEvents = new ArrayList<>();
        List<Object> newEventsSortKey = null;
        if (orderByProcessor != null) {
            newEventsSortKey = new ArrayList<>();
        }

        List<EventBean> oldEvents = null;
        List<Object> oldEventsSortKey = null;
        if (prototype.isSelectRStream()) {
            oldEvents = new ArrayList<>();
            if (orderByProcessor != null) {
                oldEventsSortKey = new ArrayList<>();
            }
        }

        for (UniformPair<Set<MultiKey<EventBean>>> pair : viewEventsList) {
            Set<MultiKey<EventBean>> newData = pair.getFirst();
            Set<MultiKey<EventBean>> oldData = pair.getSecond();

            resetEventPerGroupBufJoin();
            Object[][] newDataMultiKey = generateGroupKeysJoin(newData, eventPerGroupBufJoin, true);
            Object[][] oldDataMultiKey = generateGroupKeysJoin(oldData, eventPerGroupBufJoin, false);

            if (prototype.isSelectRStream()) {
                generateOutputBatchedCollectJoin(eventPerGroupBufJoin, false, generateSynthetic, oldEvents, oldEventsSortKey);
            }

            ResultSetProcessorGroupedUtil.applyAggJoinResultKeyedJoin(aggregationService, agentInstanceContext, newData, newDataMultiKey, oldData, oldDataMultiKey);

            generateOutputBatchedCollectJoin(eventPerGroupBufJoin, true, generateSynthetic, newEvents, newEventsSortKey);
        }

        return ResultSetProcessorUtil.finalizeOutputMaySortMayRStream(newEvents, newEventsSortKey, oldEvents, oldEventsSortKey, prototype.isSelectRStream(), orderByProcessor, agentInstanceContext);
    }
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:37,代碼來源:ResultSetProcessorRowPerGroupRollupImpl.java

示例13: assertStep

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private void assertStep(String timeInSec, int step, Map<Integer, StepDesc> stepAssertions, String[] fields, boolean isAssert, boolean isExpectNullRemoveStream, boolean allowAnyOrder) {

        if (preformatlog.isDebugEnabled()) {
            if (listener.isInvoked()) {
                UniformPair<String[]> received = renderReceived(fields);
                String[] newRows = received.getFirst();
                String[] oldRows = received.getSecond();
                int numMaxRows = (newRows.length > oldRows.length) ? newRows.length : oldRows.length;
                for (int i = 0; i < numMaxRows; i++) {
                    String newRow = (newRows.length > i) ? newRows[i] : "";
                    String oldRow = (oldRows.length > i) ? oldRows[i] : "";
                    preformatlog.debug(String.format("%48s %-18s %-20s", "", newRow, oldRow));
                }
                if (numMaxRows == 0) {
                    preformatlog.debug(String.format("%48s %-18s %-20s", "", "(empty result)", "(empty result)"));
                }
            }
        }

        if (!isAssert) {
            listener.reset();
            return;
        }

        StepDesc stepDesc = null;
        if (stepAssertions != null) {
            stepDesc = stepAssertions.get(step);
        }

        // If there is no assertion, there should be no event received
        if (stepDesc == null) {
            Assert.assertFalse("At time " + timeInSec + " expected no events but received one or more", listener.isInvoked());
        } else {
            // If we do expect remove stream events, asset both
            if (!isExpectNullRemoveStream) {
                String message = "At time " + timeInSec;
                Assert.assertTrue(message + " expected events but received none", listener.isInvoked());
                if (allowAnyOrder) {
                    EPAssertionUtil.assertPropsPerRowAnyOrder(listener.getLastNewData(), expected.getProperties(), stepDesc.getNewDataPerRow());
                    EPAssertionUtil.assertPropsPerRowAnyOrder(listener.getLastOldData(), expected.getProperties(), stepDesc.getOldDataPerRow());
                } else {
                    EPAssertionUtil.assertPropsPerRow(listener.getLastNewData(), expected.getProperties(), stepDesc.getNewDataPerRow(), "newData");
                    EPAssertionUtil.assertPropsPerRow(listener.getLastOldData(), expected.getProperties(), stepDesc.getOldDataPerRow(), "oldData");
                }
            } else {
                // If we don't expect remove stream events (istream only), then asset new data only if there
                // If we do expect new data, assert
                if (stepDesc.getNewDataPerRow() != null) {
                    Assert.assertTrue("At time " + timeInSec + " expected events but received none", listener.isInvoked());
                    if (allowAnyOrder) {
                        EPAssertionUtil.assertPropsPerRowAnyOrder(listener.getLastNewData(), expected.getProperties(), stepDesc.getNewDataPerRow());
                    } else {
                        EPAssertionUtil.assertPropsPerRow(listener.getLastNewData(), expected.getProperties(), stepDesc.getNewDataPerRow(), "newData");
                    }
                } else {
                    // If we don't expect new data, make sure its null
                    Assert.assertNull("At time " + timeInSec + " expected no insert stream events but received some", listener.getLastNewData());
                }

                Assert.assertNull("At time " + timeInSec + " expected no remove stream events but received some(check irstream/istream(default) test case)", listener.getLastOldData());
            }
        }
        listener.reset();
    }
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:65,代碼來源:ResultAssertExecution.java

示例14: processOutputLimitedJoinDefault

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> processOutputLimitedJoinDefault(List<UniformPair<Set<MultiKey<EventBean>>>> joinEventsSet, boolean generateSynthetic) {
    List<EventBean> newEvents = new LinkedList<>();
    List<EventBean> oldEvents = null;
    if (prototype.isSelectRStream()) {
        oldEvents = new LinkedList<>();
    }

    List<Object> newEventsSortKey = null;
    List<Object> oldEventsSortKey = null;
    if (orderByProcessor != null) {
        newEventsSortKey = new LinkedList<>();
        if (prototype.isSelectRStream()) {
            oldEventsSortKey = new LinkedList<>();
        }
    }

    for (UniformPair<Set<MultiKey<EventBean>>> pair : joinEventsSet) {
        Set<MultiKey<EventBean>> newData = pair.getFirst();
        Set<MultiKey<EventBean>> oldData = pair.getSecond();

        if (prototype.isUnidirectional()) {
            this.clear();
        }

        ResultSetProcessorUtil.applyAggJoinResult(aggregationService, exprEvaluatorContext, newData, oldData);

        // generate old events using select expressions
        if (prototype.isSelectRStream()) {
            if (prototype.getOptionalHavingNode() == null) {
                if (orderByProcessor == null) {
                    ResultSetProcessorUtil.populateSelectJoinEventsNoHaving(selectExprProcessor, oldData, false, generateSynthetic, oldEvents, exprEvaluatorContext);
                } else {
                    ResultSetProcessorUtil.populateSelectJoinEventsNoHavingWithOrderBy(selectExprProcessor, orderByProcessor, oldData, false, generateSynthetic, oldEvents, oldEventsSortKey, exprEvaluatorContext);
                }
            } else {
                // generate old events using having then select
                if (orderByProcessor == null) {
                    ResultSetProcessorUtil.populateSelectJoinEventsHaving(selectExprProcessor, oldData, prototype.getOptionalHavingNode(), false, generateSynthetic, oldEvents, exprEvaluatorContext);
                } else {
                    ResultSetProcessorUtil.populateSelectJoinEventsHavingWithOrderBy(selectExprProcessor, orderByProcessor, oldData, prototype.getOptionalHavingNode(), false, generateSynthetic, oldEvents, oldEventsSortKey, exprEvaluatorContext);
                }
            }
        }

        // generate new events using select expressions
        if (prototype.getOptionalHavingNode() == null) {
            if (orderByProcessor == null) {
                ResultSetProcessorUtil.populateSelectJoinEventsNoHaving(selectExprProcessor, newData, true, generateSynthetic, newEvents, exprEvaluatorContext);
            } else {
                ResultSetProcessorUtil.populateSelectJoinEventsNoHavingWithOrderBy(selectExprProcessor, orderByProcessor, newData, true, generateSynthetic, newEvents, newEventsSortKey, exprEvaluatorContext);
            }
        } else {
            if (orderByProcessor == null) {
                ResultSetProcessorUtil.populateSelectJoinEventsHaving(selectExprProcessor, newData, prototype.getOptionalHavingNode(), true, generateSynthetic, newEvents, exprEvaluatorContext);
            } else {
                ResultSetProcessorUtil.populateSelectJoinEventsHavingWithOrderBy(selectExprProcessor, orderByProcessor, newData, prototype.getOptionalHavingNode(), true, generateSynthetic, newEvents, newEventsSortKey, exprEvaluatorContext);
            }
        }
    }

    return ResultSetProcessorUtil.finalizeOutputMaySortMayRStream(newEvents, newEventsSortKey, oldEvents, oldEventsSortKey, prototype.isSelectRStream(), orderByProcessor, exprEvaluatorContext);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:63,代碼來源:ResultSetProcessorRowPerEventImpl.java

示例15: processOutputLimitedViewLast

import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> processOutputLimitedViewLast(List<UniformPair<EventBean[]>> viewEventsList, boolean generateSynthetic) {
    Map<Object, EventBean> lastPerGroupNew = new LinkedHashMap<>();
    Map<Object, EventBean> lastPerGroupOld = null;
    if (prototype.isSelectRStream()) {
        lastPerGroupOld = new LinkedHashMap<>();
    }

    Map<Object, Object> newEventsSortKey = null; // group key to sort key
    Map<Object, Object> oldEventsSortKey = null;
    if (orderByProcessor != null) {
        newEventsSortKey = new LinkedHashMap<>();
        if (prototype.isSelectRStream()) {
            oldEventsSortKey = new LinkedHashMap<>();
        }
    }

    EventBean[] eventsPerStream = new EventBean[1];
    for (UniformPair<EventBean[]> pair : viewEventsList) {
        EventBean[] newData = pair.getFirst();
        EventBean[] oldData = pair.getSecond();

        Object[] newDataMultiKey = generateGroupKeyArrayView(newData, true);
        Object[] oldDataMultiKey = generateGroupKeyArrayView(oldData, false);

        ResultSetProcessorGroupedUtil.applyAggViewResultKeyedView(aggregationService, agentInstanceContext, newData, newDataMultiKey, oldData, oldDataMultiKey, eventsPerStream);

        if (prototype.isSelectRStream()) {
            generateOutputBatchedViewPerKey(oldData, oldDataMultiKey, false, generateSynthetic, lastPerGroupOld, oldEventsSortKey, eventsPerStream);
        }
        generateOutputBatchedViewPerKey(newData, newDataMultiKey, true, generateSynthetic, lastPerGroupNew, newEventsSortKey, eventsPerStream);
    }

    EventBean[] newEventsArr = CollectionUtil.toArrayNullForEmptyValueEvents(lastPerGroupNew);
    EventBean[] oldEventsArr = null;
    if (prototype.isSelectRStream()) {
        oldEventsArr = CollectionUtil.toArrayNullForEmptyValueEvents(lastPerGroupOld);
    }

    if (orderByProcessor != null) {
        Object[] sortKeysNew = CollectionUtil.toArrayNullForEmptyValueValues(newEventsSortKey);
        newEventsArr = orderByProcessor.sortWOrderKeys(newEventsArr, sortKeysNew, agentInstanceContext);
        if (prototype.isSelectRStream()) {
            Object[] sortKeysOld = CollectionUtil.toArrayNullForEmptyValueValues(oldEventsSortKey);
            oldEventsArr = orderByProcessor.sortWOrderKeys(oldEventsArr, sortKeysOld, agentInstanceContext);
        }
    }

    return ResultSetProcessorUtil.toPairNullIfAllNull(newEventsArr, oldEventsArr);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:50,代碼來源:ResultSetProcessorAggregateGroupedImpl.java


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