本文整理汇总了Java中com.alibaba.cobar.manager.parser.ManagerParseReload类的典型用法代码示例。如果您正苦于以下问题:Java ManagerParseReload类的具体用法?Java ManagerParseReload怎么用?Java ManagerParseReload使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ManagerParseReload类属于com.alibaba.cobar.manager.parser包,在下文中一共展示了ManagerParseReload类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handle
import com.alibaba.cobar.manager.parser.ManagerParseReload; //导入依赖的package包/类
public static void handle(String stmt, ManagerConnection c, int offset) {
int rs = ManagerParseReload.parse(stmt, offset);
switch (rs) {
case ManagerParseReload.CONFIG:
ReloadConfig.execute(c);
break;
case ManagerParseReload.ROUTE:
c.writeErrMessage(ErrorCode.ER_YES, "Unsupported statement");
break;
case ManagerParseReload.USER:
ReloadUser.execute(c);
break;
default:
c.writeErrMessage(ErrorCode.ER_YES, "Unsupported statement");
}
}
示例2: testReloadConfig
import com.alibaba.cobar.manager.parser.ManagerParseReload; //导入依赖的package包/类
@Test
public void testReloadConfig() {
Assert.assertEquals(ManagerParseReload.CONFIG, ManagerParseReload.parse("reload @@config", 7));
Assert.assertEquals(ManagerParseReload.CONFIG, ManagerParseReload.parse(" RELOAD @@CONFIG ", 7));
Assert.assertEquals(ManagerParseReload.CONFIG, ManagerParseReload.parse(" RELOAD @@config ", 7));
}
示例3: testReloadRoute
import com.alibaba.cobar.manager.parser.ManagerParseReload; //导入依赖的package包/类
@Test
public void testReloadRoute() {
Assert.assertEquals(ManagerParseReload.ROUTE, ManagerParseReload.parse("reload @@route", 7));
Assert.assertEquals(ManagerParseReload.ROUTE, ManagerParseReload.parse(" RELOAD @@ROUTE ", 7));
Assert.assertEquals(ManagerParseReload.ROUTE, ManagerParseReload.parse(" RELOAD @@route ", 7));
}
示例4: testReloadUser
import com.alibaba.cobar.manager.parser.ManagerParseReload; //导入依赖的package包/类
@Test
public void testReloadUser() {
Assert.assertEquals(ManagerParseReload.USER, ManagerParseReload.parse("reload @@user", 7));
Assert.assertEquals(ManagerParseReload.USER, ManagerParseReload.parse(" RELOAD @@USER ", 7));
Assert.assertEquals(ManagerParseReload.USER, ManagerParseReload.parse(" RELOAD @@user ", 7));
}