本文整理汇总了Java中com.espertech.esper.filter.FilterSpecCompiler类的典型用法代码示例。如果您正苦于以下问题:Java FilterSpecCompiler类的具体用法?Java FilterSpecCompiler怎么用?Java FilterSpecCompiler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterSpecCompiler类属于com.espertech.esper.filter包,在下文中一共展示了FilterSpecCompiler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import com.espertech.esper.filter.FilterSpecCompiler; //导入依赖的package包/类
public void open(DataFlowOpOpenContext openContext) {
FilterValueSet valueSet;
try {
List<ExprNode> filters = Collections.emptyList();
if (filter != null) {
filters = Collections.singletonList(filter);
}
FilterSpecCompiled spec = FilterSpecCompiler.makeFilterSpec(eventType, eventType.getName(), filters, null,
null, null, new StreamTypeServiceImpl(eventType, eventType.getName(), true, agentInstanceContext.getEngineURI()), null, agentInstanceContext.getStatementContext(), new ArrayList<Integer>());
valueSet = spec.getValueSet(null, agentInstanceContext, null);
}
catch (ExprValidationException ex) {
throw new EPException("Failed to open filter: " + ex.getMessage(), ex);
}
EPStatementAgentInstanceHandle handle = new EPStatementAgentInstanceHandle(agentInstanceContext.getStatementContext().getEpStatementHandle(), agentInstanceContext.getAgentInstanceLock(), 0, new StatementAgentInstanceFilterVersion());
callbackHandle = new EPStatementHandleCallback(handle, this);
agentInstanceContext.getStatementContext().getFilterService().add(valueSet, callbackHandle);
}
示例2: getBoolExprFilterItem
import com.espertech.esper.filter.FilterSpecCompiler; //导入依赖的package包/类
public static SupportFilterItem getBoolExprFilterItem() {
return new SupportFilterItem(FilterSpecCompiler.PROPERTY_NAME_BOOLEAN_EXPRESSION, FilterOperator.BOOLEAN_EXPRESSION);
}
示例3: runAssertionOptimizableInspectFilter
import com.espertech.esper.filter.FilterSpecCompiler; //导入依赖的package包/类
private void runAssertionOptimizableInspectFilter(EPServiceProvider epService) {
String epl;
epService.getEPAdministrator().getConfiguration().addPlugInSingleRowFunction("funcOne", MyLib.class.getName(), "libSplit", ConfigurationPlugInSingleRowFunction.FilterOptimizable.DISABLED);
epl = "select * from SupportBean(funcOne(theString) = 0)";
assertFilterSingle(epService, epl, FilterSpecCompiler.PROPERTY_NAME_BOOLEAN_EXPRESSION, FilterOperator.BOOLEAN_EXPRESSION);
epService.getEPAdministrator().getConfiguration().addPlugInSingleRowFunction("funcOneWDefault", MyLib.class.getName(), "libSplit");
epl = "select * from SupportBean(funcOneWDefault(theString) = 0)";
assertFilterSingle(epService, epl, "funcOneWDefault(theString)", FilterOperator.EQUAL);
epService.getEPAdministrator().getConfiguration().addPlugInSingleRowFunction("funcTwo", MyLib.class.getName(), "libSplit", ConfigurationPlugInSingleRowFunction.FilterOptimizable.ENABLED);
epl = "select * from SupportBean(funcTwo(theString) = 0)";
assertFilterSingle(epService, epl, "funcTwo(theString)", FilterOperator.EQUAL);
epl = "select * from SupportBean(libE1True(theString))";
assertFilterSingle(epService, epl, "libE1True(theString)", FilterOperator.EQUAL);
epl = "select * from SupportBean(funcTwo( theString ) > 10)";
assertFilterSingle(epService, epl, "funcTwo(theString)", FilterOperator.GREATER);
epService.getEPAdministrator().createEPL("create expression thesplit {theString => funcOne(theString)}");
epl = "select * from SupportBean(thesplit(*) = 0)";
assertFilterSingle(epService, epl, "thesplit(*)", FilterOperator.EQUAL);
epl = "select * from SupportBean(libE1True(theString))";
assertFilterSingle(epService, epl, "libE1True(theString)", FilterOperator.EQUAL);
epl = "select * from SupportBean(thesplit(*) > 10)";
assertFilterSingle(epService, epl, "thesplit(*)", FilterOperator.GREATER);
epl = "expression housenumber alias for {10} select * from SupportBean(intPrimitive = housenumber)";
assertFilterSingle(epService, epl, "intPrimitive", FilterOperator.EQUAL);
epl = "expression housenumber alias for {intPrimitive*10} select * from SupportBean(intPrimitive = housenumber)";
assertFilterSingle(epService, epl, ".boolean_expression", FilterOperator.BOOLEAN_EXPRESSION);
epl = "select * from SupportBean(typeof(e) = 'SupportBean') as e";
assertFilterSingle(epService, epl, "typeof(e)", FilterOperator.EQUAL);
}