本文整理汇总了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");
}
}
示例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");
}
}