本文整理匯總了Java中com.espertech.esper.collection.UniformPair.getFirst方法的典型用法代碼示例。如果您正苦於以下問題:Java UniformPair.getFirst方法的具體用法?Java UniformPair.getFirst怎麽用?Java UniformPair.getFirst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.espertech.esper.collection.UniformPair
的用法示例。
在下文中一共展示了UniformPair.getFirst方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: mayRouteCurrentEvent
import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
boolean mayRouteCurrentEvent(int index, ExprEvaluatorContext exprEvaluatorContext) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qSplitStreamRoute(index);
}
UniformPair<EventBean[]> result = processors[index].processViewResult(eventsPerStream, null, false);
boolean routed = false;
if ((result != null) && (result.getFirst() != null) && (result.getFirst().length > 0)) {
route(result.getFirst()[0], index, exprEvaluatorContext);
routed = true;
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aSplitStreamRoute();
}
return routed;
}
示例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));
}
}
示例4: 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 (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qOutputProcessNonBuffered(newData, oldData);
}
boolean isGenerateSynthetic = parent.getStatementResultService().isMakeSynthetic();
boolean isGenerateNatural = parent.getStatementResultService().isMakeNatural();
UniformPair<EventBean[]> newOldEvents = resultSetProcessor.processViewResult(newData, oldData, isGenerateSynthetic);
if ((!isGenerateSynthetic) && (!isGenerateNatural)) {
if (AuditPath.isAuditEnabled) {
OutputStrategyUtil.indicateEarlyReturn(parent.getStatementContext(), newOldEvents);
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aOutputProcessNonBuffered();
}
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);
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aOutputProcessNonBuffered();
}
}
示例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);
}
}
示例6: 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);
}
示例7: processOutputLimitedViewDefault
import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> processOutputLimitedViewDefault(List<UniformPair<EventBean[]>> viewEventsList, 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<>();
}
}
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()) {
generateOutputBatchedViewUnkeyed(oldData, oldDataMultiKey, false, generateSynthetic, oldEvents, oldEventsSortKey, eventsPerStream);
}
generateOutputBatchedViewUnkeyed(newData, newDataMultiKey, true, generateSynthetic, newEvents, newEventsSortKey, eventsPerStream);
}
return ResultSetProcessorUtil.finalizeOutputMaySortMayRStream(newEvents, newEventsSortKey, oldEvents, oldEventsSortKey, prototype.isSelectRStream(), orderByProcessor, agentInstanceContext);
}
示例8: processOutputLimitedViewDefault
import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> processOutputLimitedViewDefault(List<UniformPair<EventBean[]>> viewEventsList, 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<>();
}
}
Map<Object, EventBean> keysAndEvents = new HashMap<>();
EventBean[] eventsPerStream = new EventBean[1];
for (UniformPair<EventBean[]> pair : viewEventsList) {
EventBean[] newData = pair.getFirst();
EventBean[] oldData = pair.getSecond();
Object[] newDataMultiKey = generateGroupKeysKeepEvent(newData, keysAndEvents, true, eventsPerStream);
Object[] oldDataMultiKey = generateGroupKeysKeepEvent(oldData, keysAndEvents, false, eventsPerStream);
if (prototype.isSelectRStream()) {
generateOutputBatchedRowFromMap(keysAndEvents, false, generateSynthetic, oldEvents, oldEventsSortKey, agentInstanceContext);
}
ResultSetProcessorGroupedUtil.applyAggViewResultKeyedView(aggregationService, agentInstanceContext, newData, newDataMultiKey, oldData, oldDataMultiKey, eventsPerStream);
generateOutputBatchedRowFromMap(keysAndEvents, true, generateSynthetic, newEvents, newEventsSortKey, agentInstanceContext);
keysAndEvents.clear();
}
return ResultSetProcessorUtil.finalizeOutputMaySortMayRStream(newEvents, newEventsSortKey, oldEvents, oldEventsSortKey, prototype.isSelectRStream(), orderByProcessor, agentInstanceContext);
}
示例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"));
}
示例10: getIterator
import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
public Iterator<EventBean> getIterator(Set<MultiKey<EventBean>> joinSet) {
// Process join results set as a regular join, includes sorting and having-clause filter
UniformPair<EventBean[]> result = processJoinResult(joinSet, Collections.emptySet(), true);
return new ArrayEventIterator(result.getFirst());
}
示例11: 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);
}
示例12: handleMatching
import com.espertech.esper.collection.UniformPair; //導入方法依賴的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();
}
}
示例13: execute
import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
/**
* Executes the prepared query.
*
* @return query results
*/
public EPPreparedQueryResult execute(ContextPartitionSelector[] contextPartitionSelectors) {
try {
int numStreams = processors.length;
if (contextPartitionSelectors != null && contextPartitionSelectors.length != numStreams) {
throw new IllegalArgumentException("Number of context partition selectors does not match the number of named windows in the from-clause");
}
// handle non-context case
if (statementSpec.getOptionalContextName() == null) {
Collection<EventBean>[] snapshots = new Collection[numStreams];
for (int i = 0; i < numStreams; i++) {
ContextPartitionSelector selector = contextPartitionSelectors == null ? null : contextPartitionSelectors[i];
snapshots[i] = getStreamFilterSnapshot(i, selector);
}
resultSetProcessor.clear();
return process(snapshots);
}
List<ContextPartitionResult> contextPartitionResults = new ArrayList<ContextPartitionResult>();
ContextPartitionSelector singleSelector = contextPartitionSelectors != null && contextPartitionSelectors.length > 0 ? contextPartitionSelectors[0] : null;
// context partition runtime query
Collection<Integer> agentInstanceIds = EPPreparedExecuteMethodHelper.getAgentInstanceIds(processors[0], singleSelector, services.getContextManagementService(), statementSpec.getOptionalContextName());
// collect events and agent instances
for (int agentInstanceId : agentInstanceIds) {
FireAndForgetInstance processorInstance = processors[0].getProcessorInstanceContextById(agentInstanceId);
if (processorInstance != null) {
EPPreparedExecuteTableHelper.assignTableAccessStrategies(services, statementSpec.getTableNodes(), processorInstance.getAgentInstanceContext());
Collection<EventBean> coll = processorInstance.snapshotBestEffort(this, queryGraph, statementSpec.getAnnotations());
contextPartitionResults.add(new ContextPartitionResult(coll, processorInstance.getAgentInstanceContext()));
}
}
// process context partitions
ArrayDeque<EventBean[]> events = new ArrayDeque<EventBean[]>();
for (ContextPartitionResult contextPartitionResult : contextPartitionResults) {
Collection<EventBean> snapshot = contextPartitionResult.getEvents();
if (statementSpec.getFilterRootNode() != null) {
snapshot = getFiltered(snapshot, Collections.singletonList(statementSpec.getFilterRootNode()));
}
EventBean[] rows = snapshot.toArray(new EventBean[snapshot.size()]);
resultSetProcessor.setAgentInstanceContext(contextPartitionResult.getContext());
UniformPair<EventBean[]> results = resultSetProcessor.processViewResult(rows, null, true);
if (results != null && results.getFirst() != null && results.getFirst().length > 0) {
events.add(results.getFirst());
}
}
return new EPPreparedQueryResult(resultEventType, EventBeanUtility.flatten(events));
} finally {
if (hasTableAccess) {
services.getTableService().getTableExprEvaluatorContext().releaseAcquiredLocks();
}
}
}
示例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);
}
示例15: processOutputLimitedViewDefault
import com.espertech.esper.collection.UniformPair; //導入方法依賴的package包/類
private UniformPair<EventBean[]> processOutputLimitedViewDefault(List<UniformPair<EventBean[]>> viewEventsList, 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<>();
}
}
EventBean[] eventsPerStream = new EventBean[1];
for (UniformPair<EventBean[]> pair : viewEventsList) {
EventBean[] newData = pair.getFirst();
EventBean[] oldData = pair.getSecond();
ResultSetProcessorUtil.applyAggViewResult(aggregationService, exprEvaluatorContext, newData, oldData, eventsPerStream);
// generate old events using select expressions
if (prototype.isSelectRStream()) {
if (prototype.getOptionalHavingNode() == null) {
if (orderByProcessor == null) {
ResultSetProcessorUtil.populateSelectEventsNoHaving(selectExprProcessor, oldData, false, generateSynthetic, oldEvents, exprEvaluatorContext);
} else {
ResultSetProcessorUtil.populateSelectEventsNoHavingWithOrderBy(selectExprProcessor, orderByProcessor, oldData, false, generateSynthetic, oldEvents, oldEventsSortKey, exprEvaluatorContext);
}
} else {
// generate old events using having then select
if (orderByProcessor == null) {
ResultSetProcessorUtil.populateSelectEventsHaving(selectExprProcessor, oldData, prototype.getOptionalHavingNode(), false, generateSynthetic, oldEvents, exprEvaluatorContext);
} else {
ResultSetProcessorUtil.populateSelectEventsHavingWithOrderBy(selectExprProcessor, orderByProcessor, oldData, prototype.getOptionalHavingNode(), false, generateSynthetic, oldEvents, oldEventsSortKey, exprEvaluatorContext);
}
}
}
// generate new events using select expressions
if (prototype.getOptionalHavingNode() == null) {
if (orderByProcessor == null) {
ResultSetProcessorUtil.populateSelectEventsNoHaving(selectExprProcessor, newData, true, generateSynthetic, newEvents, exprEvaluatorContext);
} else {
ResultSetProcessorUtil.populateSelectEventsNoHavingWithOrderBy(selectExprProcessor, orderByProcessor, newData, true, generateSynthetic, newEvents, newEventsSortKey, exprEvaluatorContext);
}
} else {
if (orderByProcessor == null) {
ResultSetProcessorUtil.populateSelectEventsHaving(selectExprProcessor, newData, prototype.getOptionalHavingNode(), true, generateSynthetic, newEvents, exprEvaluatorContext);
} else {
ResultSetProcessorUtil.populateSelectEventsHavingWithOrderBy(selectExprProcessor, orderByProcessor, newData, prototype.getOptionalHavingNode(), true, generateSynthetic, newEvents, newEventsSortKey, exprEvaluatorContext);
}
}
}
return ResultSetProcessorUtil.finalizeOutputMaySortMayRStream(newEvents, newEventsSortKey, oldEvents, oldEventsSortKey, prototype.isSelectRStream(), orderByProcessor, exprEvaluatorContext);
}