本文整理匯總了Java中com.espertech.esper.collection.UniformPair.setFirst方法的典型用法代碼示例。如果您正苦於以下問題:Java UniformPair.setFirst方法的具體用法?Java UniformPair.setFirst怎麽用?Java UniformPair.setFirst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.espertech.esper.collection.UniformPair
的用法示例。
在下文中一共展示了UniformPair.setFirst方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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);
}
}
示例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 ((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);
}
示例5: 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);
}
示例6: 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);
}
}
示例7: 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);
}
}