本文整理汇总了Java中com.espertech.esper.event.EventBeanUtility.allocatePerStreamShift方法的典型用法代码示例。如果您正苦于以下问题:Java EventBeanUtility.allocatePerStreamShift方法的具体用法?Java EventBeanUtility.allocatePerStreamShift怎么用?Java EventBeanUtility.allocatePerStreamShift使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.event.EventBeanUtility
的用法示例。
在下文中一共展示了EventBeanUtility.allocatePerStreamShift方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluateGetCollEvents
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Collection<EventBean> evaluateGetCollEvents(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext context, ExprSubselectRowNode parent) {
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
ArrayDeque<EventBean> filtered = null;
for (EventBean subselectEvent : matchingEvents) {
events[0] = subselectEvent;
Boolean pass = (Boolean) parent.filterExpr.evaluate(events, true, context);
if ((pass != null) && pass) {
if (filtered == null) {
filtered = new ArrayDeque<EventBean>();
}
filtered.add(subselectEvent);
}
}
return filtered;
}
示例2: evaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object evaluate(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprSubselectRowNode parent) {
AggregationService aggregationService = parent.getSubselectAggregationService().getContextPartitionAggregationService(exprEvaluatorContext.getAgentInstanceId());
Collection<Object> groupKeys = aggregationService.getGroupKeys(exprEvaluatorContext);
if (groupKeys.isEmpty()) {
return null;
}
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
boolean haveResult = false;
Object result = null;
for (Object groupKey : groupKeys) {
aggregationService.setCurrentAccess(groupKey, exprEvaluatorContext.getAgentInstanceId(), null);
Boolean pass = (Boolean) havingClause.evaluate(events, newData, exprEvaluatorContext);
if (pass != null && pass) {
if (haveResult) {
return null;
}
result = super.evaluate(eventsPerStream, newData, matchingEvents, exprEvaluatorContext, parent);
haveResult = true;
}
}
return haveResult ? result : null;
}
开发者ID:espertechinc,项目名称:esper,代码行数:27,代码来源:SubselectEvalStrategyRowUnfilteredSelectedGroupedWHaving.java
示例3: evaluateGetCollEvents
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Collection<EventBean> evaluateGetCollEvents(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext context, ExprSubselectRowNode parent) {
AggregationService aggregationService = parent.getSubselectAggregationService().getContextPartitionAggregationService(context.getAgentInstanceId());
Collection<Object> groupKeys = aggregationService.getGroupKeys(context);
if (groupKeys.isEmpty()) {
return null;
}
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
Collection<EventBean> result = new ArrayDeque<EventBean>(groupKeys.size());
for (Object groupKey : groupKeys) {
aggregationService.setCurrentAccess(groupKey, context.getAgentInstanceId(), null);
Boolean pass = (Boolean) havingClause.evaluate(events, newData, context);
if (pass != null && pass) {
Map<String, Object> row = parent.evaluateRow(events, true, context);
EventBean event = parent.subselectMultirowType.getEventAdapterService().adapterForTypedMap(row, parent.subselectMultirowType.getEventType());
result.add(event);
}
}
return result;
}
开发者ID:espertechinc,项目名称:esper,代码行数:21,代码来源:SubselectEvalStrategyRowUnfilteredSelectedGroupedWHaving.java
示例4: evaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object evaluate(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprSubselectRowNode parent) {
EventBean[] eventsZeroBased = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
EventBean subSelectResult = ExprSubselectRowNodeUtility.evaluateFilterExpectSingleMatch(eventsZeroBased, newData, matchingEvents, exprEvaluatorContext, parent);
if (subSelectResult == null) {
return null;
}
eventsZeroBased[0] = subSelectResult;
Object result;
if (parent.selectClauseEvaluator.length == 1) {
result = parent.selectClauseEvaluator[0].evaluate(eventsZeroBased, true, exprEvaluatorContext);
} else {
// we are returning a Map here, not object-array, preferring the self-describing structure
result = parent.evaluateRow(eventsZeroBased, true, exprEvaluatorContext);
}
return result;
}
示例5: evaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationServiceAnyPartition) {
if (matchingEvents == null || matchingEvents.size() == 0) {
return false;
}
AggregationService aggregationService = aggregationServiceAnyPartition.getContextPartitionAggregationService(exprEvaluatorContext.getAgentInstanceId());
Collection<Object> groupKeys = aggregationService.getGroupKeys(exprEvaluatorContext);
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
for (Object groupKey : groupKeys) {
aggregationService.setCurrentAccess(groupKey, exprEvaluatorContext.getAgentInstanceId(), null);
Boolean pass = (Boolean) havingEval.evaluate(events, true, exprEvaluatorContext);
if ((pass == null) || (!pass)) {
continue;
}
return true;
}
return false;
}
示例6: evaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object evaluate(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprSubselectRowNode parent) {
EventBean[] eventsZeroBased = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
Boolean pass = (Boolean) parent.havingExpr.evaluate(eventsZeroBased, newData, exprEvaluatorContext);
if ((pass == null) || (!pass)) {
return null;
}
Object result;
if (parent.selectClauseEvaluator.length == 1) {
result = parent.selectClauseEvaluator[0].evaluate(eventsZeroBased, true, exprEvaluatorContext);
} else {
// we are returning a Map here, not object-array, preferring the self-describing structure
result = parent.evaluateRow(eventsZeroBased, true, exprEvaluatorContext);
}
return result;
}
示例7: evaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object evaluate(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext,
ExprSubselectRowNode parent) {
if (matchingEvents.size() > 1) {
log.warn(parent.getMultirowMessage());
return null;
}
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
events[0] = EventBeanUtility.getNonemptyFirstEvent(matchingEvents);
Object result;
if (parent.selectClauseEvaluator.length == 1) {
result = parent.selectClauseEvaluator[0].evaluate(events, true, exprEvaluatorContext);
} else {
// we are returning a Map here, not object-array, preferring the self-describing structure
result = parent.evaluateRow(events, true, exprEvaluatorContext);
}
return result;
}
示例8: evaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object evaluate(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprSubselectRowNode parent) {
EventBean[] eventsZeroBased = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
EventBean subSelectResult = ExprSubselectRowNodeUtility.evaluateFilterExpectSingleMatch(eventsZeroBased, newData, matchingEvents, exprEvaluatorContext, parent);
if (subSelectResult == null) {
return null;
}
return subSelectResult.getUnderlying();
}
示例9: evaluateGetCollScalar
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Collection evaluateGetCollScalar(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext context, ExprSubselectRowNode parent) {
List<Object> result = new ArrayList<Object>();
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
for (EventBean subselectEvent : matchingEvents) {
events[0] = subselectEvent;
Boolean pass = (Boolean) parent.filterExpr.evaluate(events, true, context);
if ((pass != null) && pass) {
result.add(parent.selectClauseEvaluator[0].evaluate(events, isNewData, context));
}
}
return result;
}
示例10: typableEvaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object[] typableEvaluate(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprSubselectRowNode parent) {
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
EventBean subSelectResult = ExprSubselectRowNodeUtility.evaluateFilterExpectSingleMatch(events, isNewData, matchingEvents, exprEvaluatorContext, parent);
if (subSelectResult == null) {
return null;
}
events[0] = subSelectResult;
Object[] results = new Object[parent.selectClauseEvaluator.length];
for (int i = 0; i < results.length; i++) {
results[i] = parent.selectClauseEvaluator[i].evaluate(events, isNewData, exprEvaluatorContext);
}
return results;
}
示例11: typableEvaluateMultirow
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object[][] typableEvaluateMultirow(EventBean[] eventsPerStream, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprSubselectRowNode parent) {
Object[][] rows = new Object[matchingEvents.size()][];
int index = -1;
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
for (EventBean matchingEvent : matchingEvents) {
events[0] = matchingEvent;
Boolean pass = (Boolean) parent.filterExpr.evaluate(events, newData, exprEvaluatorContext);
if ((pass != null) && pass) {
index++;
Object[] results = new Object[parent.selectClauseEvaluator.length];
for (int i = 0; i < results.length; i++) {
results[i] = parent.selectClauseEvaluator[i].evaluate(events, newData, exprEvaluatorContext);
}
rows[index] = results;
}
}
if (index == rows.length - 1) {
return rows;
}
if (index == -1) {
return CollectionUtil.OBJECTARRAYARRAY_EMPTY;
}
int access = index + 1;
Object[][] rowArray = new Object[access][];
System.arraycopy(rows, 0, rowArray, 0, rowArray.length);
return rowArray;
}
示例12: evaluateGetEventBean
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public EventBean evaluateGetEventBean(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext context, ExprSubselectRowNode parent) {
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
EventBean subSelectResult = ExprSubselectRowNodeUtility.evaluateFilterExpectSingleMatch(events, isNewData, matchingEvents, context, parent);
if (subSelectResult == null) {
return null;
}
Map<String, Object> row = parent.evaluateRow(events, true, context);
return parent.subselectMultirowType.getEventAdapterService().adapterForTypedMap(row, parent.subselectMultirowType.getEventType());
}
示例13: evaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationService) {
if (matchingEvents == null || matchingEvents.size() == 0) {
return resultWhenNoMatchingEvents;
}
Object leftResult = valueEval.evaluate(eventsPerStream, isNewData, exprEvaluatorContext);
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
return evaluateInternal(leftResult, events, isNewData, matchingEvents, exprEvaluatorContext, aggregationService);
}
示例14: evaluateGetCollScalar
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Collection evaluateGetCollScalar(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext context, ExprSubselectRowNode parent) {
List<Object> result = new ArrayList<Object>();
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
for (EventBean subselectEvent : matchingEvents) {
events[0] = subselectEvent;
result.add(parent.selectClauseEvaluator[0].evaluate(events, isNewData, context));
}
return result;
}
示例15: typableEvaluate
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Object[] typableEvaluate(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprSubselectRowNode parent) {
// take the first match only
EventBean[] events = EventBeanUtility.allocatePerStreamShift(eventsPerStream);
events[0] = EventBeanUtility.getNonemptyFirstEvent(matchingEvents);
Object[] results = new Object[parent.selectClauseEvaluator.length];
for (int i = 0; i < results.length; i++) {
results[i] = parent.selectClauseEvaluator[i].evaluate(events, isNewData, exprEvaluatorContext);
}
return results;
}