Esper事件处理引擎_17_EPL 语法_9_Schema 声明数据类型
来源:互联网 发布:淘宝店铺流量软件app 编辑:程序博客网 时间:2024/06/06 03:59
官方地址:http://www.espertech.com
Esper 事件引擎栏目:http://blog.csdn.net/xiaohulunb/article/category/2436609
EPL 语法代码见-GitHub代码地址:点击打开链接
涉及 Javabean,Listener,main 以 GitHub 包下为最新更,注释解释排版有问题可参考源码
EPL_9_Schema
package com.framework_technology.esper.epl;import com.java.annotation.document.Keyword;import com.java.annotation.document.Undigested;/** * API - 5.16. Declaring an Event Type: Create Schema * * @author wei.Li by 14-8-21. */public class EPL_9_Schema { /** * 声明一个提供事件类型的名称和数据类型 * <p> * 语法: * <p> * create [map | objectarray] schema schema_name [as] * (property_name property_type [,property_name property_type [,...]) * [inherits inherited_event_type[, inherited_event_type] [,...]] * [starttimestamp timestamp_property_name] * [endtimestamp timestamp_property_name] * [copyfrom copy_type_name [, copy_type_name] [,...]] * <p> * 1.任何Java类名,完全合格或引入简单的类名配置。 * 2.添加左右方括号[]到任何类型来表示一个数组类型的事件属性。 * 3.使用事件类型名称作为属性类型。 * <p> * * @return epl[] */ protected static String declareSchema() { // Declare type SecurityEvent String epl1 = "create schema SecurityEvent as (ipAddress string, userId String, numAttempts int)"; // 声明指定字段名称和数据类型 与 POJO[hostinfo] String epl2 = "create schema AuthorizationEvent(group String, roles String[], hostinfo com.mycompany.HostNameInfo)"; // 声明一个有其他 schema 数组类型的字段innerEvents String epl3 = "create schema CompositeEvent(group String, innerEvents SecurityEvent[])"; // 声明类型WebPageVisitEvent继承自PageHitEvent所有属性 @Keyword(keyWord = "inherits", Description = "继承") String epl4 = "create schema WebPageVisitEvent(userId String) inherits PageHitEvent"; // 声明一个类型的起始和结束时间戳(即事件与持续时间)(i.e. event with duration) String epl5 = "create schema RoboticArmMovement (robotId string, startts long, endts long)" + "starttimestamp startts endtimestamp endts"; //创建具有SecurityEvent的所有属性加一个用户名属性类型 @Keyword(keyWord = "copyfrom", Description = "复制") String epl6 = "create schema ExtendedSecurityEvent (userName string) copyfrom SecurityEvent"; //创建具有SecurityEvent的所有属性类型 String epl7 = "create schema SimilarSecurityEvent () copyfrom SecurityEvent"; //创建具有SecurityEvent和WebPageVisitEvent的所有属性加一个用户名属性类型 String epl8 = "create schema WebSecurityEvent (userName string) copyfrom SecurityEvent, WebPageVisitEvent"; // 显示完整的包名 LoginEvent event type String epl9 = "create schema LoginEvent as com.mycompany.LoginValue"; // 当把包名配置后,无需加包名 String epl10 = "create schema LogoutEvent as SignoffValue"; return epl1; } /** * 使用实例 * * @return epl */ protected static String useSchema() { String epl1 = "create schema SecurityData (name String, roles String[])"; String epl2 = "create window SecurityEvent.win:time(30 sec) " + " (ipAddress string, userId String, secData SecurityData, historySecData SecurityData[])"; return epl1; }}
0 0
- Esper事件处理引擎_17_EPL 语法_9_Schema 声明数据类型
- Esper事件处理引擎_16_EPL 语法_8_NamedWindow
- Esper事件处理引擎_5_EPL 语法_1_基本语法
- Esper事件处理引擎_7_EPL 语法_3_Output 输出条件语法
- Esper事件处理引擎_6_EPL 语法_2_Context 上下文_1_simple
- Esper事件处理引擎_12_EPL 语法_5_Subqueries子查询
- Esper事件处理引擎_13_EPL 语法_6_Annotation注解使用
- Esper事件处理引擎_14_EPL 语法_7_Patterns_1_模式匹配
- Esper事件处理引擎_15_EPL 语法_7_Patterns_2_模式匹配
- Esper事件处理引擎_1_JavaBean 数据结构处理
- Esper事件处理引擎_2_Map 数据结构处理
- Esper事件处理引擎_4_XML 数据结构处理
- Esper事件处理引擎_10_EPL 语法___View 窗口视图条件语法
- 复杂事件处理引擎—Esper入门
- esper(复杂事件处理引擎)简介
- Esper事件处理引擎_8_EPL 语法_2_Context 上下文_2_条件控制
- Esper事件处理引擎_9_EPL 语法_2_Context 上下文_3_过滤条件
- Esper事件处理引擎_11_EPL 语法_4_InsertInto 流对流的插入操作
- ios 点击空白处 收回键盘
- Convert Sorted Array to Binary Search Tree 将有序数组转化为平衡二叉排序树(重重)
- 定时任务(3)--ScheduledExecutorService类
- hdu1848 Fibonacci again and again,SG函数
- 【开源夏令营】PFIF公益寻人平台(七)
- Esper事件处理引擎_17_EPL 语法_9_Schema 声明数据类型
- LINUX 安装64位后只能认到32G内存
- JAVA学习笔记-抽象类,接口和内部类
- SQLite的增删改查操作
- git stash用法
- Codeforces Round #135 (Div. 2)C. Color Stripe
- java利用HashMap统计文件中的单词数
- Kaka's Matrix Travels
- 系统文件默认打开方式锁定