当前位置: 首页>>代码示例>>Java>>正文


Java SelectHandler类代码示例

本文整理汇总了Java中com.alibaba.cobar.manager.handler.SelectHandler的典型用法代码示例。如果您正苦于以下问题:Java SelectHandler类的具体用法?Java SelectHandler怎么用?Java SelectHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SelectHandler类属于com.alibaba.cobar.manager.handler包,在下文中一共展示了SelectHandler类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: query

import com.alibaba.cobar.manager.handler.SelectHandler; //导入依赖的package包/类
@Override
public void query(String sql) {
    ManagerConnection c = this.source;
    if (logger.isDebugEnabled()) {
        logger.debug(new StringBuilder().append(sql).toString());
    }
    int rs = ManagerParse.parse(sql);
    switch (rs & 0xff) {
        case ManagerParse.SELECT:
            SelectHandler.handle(sql, c, rs >>> 8);
            break;
        case ManagerParse.SET:
            c.write(c.writeToBuffer(OkPacket.OK, c.allocate()));
            break;
        case ManagerParse.SHOW:
            ShowHandler.handle(sql, c, rs >>> 8);
            break;
        case ManagerParse.KILL_CONN:
            KillConnection.response(sql, rs >>> 8, c);
            break;
        case ManagerParse.OFFLINE:
            Offline.execute(sql, c);
            break;
        case ManagerParse.ONLINE:
            Online.execute(sql, c);
            break;
        case ManagerParse.CLEAR:
            ClearHandler.handle(sql, c, rs >>> 8);
            break;
        case ManagerParse.KILL_QUERY:
            KillQueryHandler.handle(sql, rs >>> 8, c);
            break;
        default:
            c.writeErrMessage(ErrorCode.ER_YES, "Unsupported statement");
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:37,代码来源:ManagerQueryHandler.java

示例2: query

import com.alibaba.cobar.manager.handler.SelectHandler; //导入依赖的package包/类
@Override
public void query(String sql) {
    ManagerConnection c = this.source;
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(new StringBuilder().append(c).append(sql).toString());
    }
    int rs = ManagerParse.parse(sql);
    switch (rs & 0xff) {
    case ManagerParse.SELECT:
        SelectHandler.handle(sql, c, rs >>> 8);
        break;
    case ManagerParse.SET:
        c.write(c.writeToBuffer(OkPacket.OK, c.allocate()));
        break;
    case ManagerParse.SHOW:
        ShowHandler.handle(sql, c, rs >>> 8);
        break;
    case ManagerParse.SWITCH:
        SwitchHandler.handler(sql, c, rs >>> 8);
        break;
    case ManagerParse.KILL_CONN:
        KillConnection.response(sql, rs >>> 8, c);
        break;
    case ManagerParse.OFFLINE:
        Offline.execute(sql, c);
        break;
    case ManagerParse.ONLINE:
        Online.execute(sql, c);
        break;
    case ManagerParse.STOP:
        StopHandler.handle(sql, c, rs >>> 8);
        break;
    case ManagerParse.RELOAD:
        ReloadHandler.handle(sql, c, rs >>> 8);
        break;
    case ManagerParse.ROLLBACK:
        RollbackHandler.handle(sql, c, rs >>> 8);
        break;
    case ManagerParse.CLEAR:
        ClearHandler.handle(sql, c, rs >>> 8);
        break;
    default:
        c.writeErrMessage(ErrorCode.ER_YES, "Unsupported statement");
    }
}
 
开发者ID:alibaba,项目名称:cobar,代码行数:46,代码来源:ManagerQueryHandler.java


注:本文中的com.alibaba.cobar.manager.handler.SelectHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。