正则表达式动态注解(提案)

mycat 功能提交联系讨论 qq:294712221
动态注解

属性名数量限制
annotations多个动态注解配置
annotation-typesingle(暂时只支持单节点)1
annotation-name动态注解名字1
annotation-column-name-list分片字段名列表,以英文逗号
分隔多个(正则表达式)
annotation-column-value-list分片字段值列表,以英文逗号
分隔多个(正则表达式)
annotation-table-name分片逻辑表名字1
annotation-additional-list供路由算法使用的额外信息


*single 类型下 annotation-column-name-list 和 annotation-column-value-list 只支持写一个
annotation-name,
annotation-column-name-list,
annotation-column-value-list,
annotation-table-name,
annotation-additional-list
最终参数值都是正则表达式
Mycat 接收 MySQL 客户端报文,得出 SQL 字符串,然后把此 SQL 作为动态注解的参数和当前
schema,调用动态注解,然后动态注解返回上表信息
配置样例:
annotations:
- annotation:
type: single
name: annotation-name
columnNameList: id
columnValueList: ^[1-9]\d*$
tableName: travelrecord
additional:
- param1: ^[1-9]\d*$
- param2: ^[1-9]\d*$
例子: https://gist.github.com/junwen12221/d3edc3d9c0973effc99a918b445b8eff
性能要求:不包含括号的 SQL 解析,单线程不少于每秒 35W 次调用
void processSQL(CharSequence sql, String schema) throws ParseException;
第一个参数的类型可以是 byte[],ByteBuffer,CharBuffer,甚至是指向堆外的指针 long 以及它的长度
int

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值