com.alibaba.druid.stat.TableStat.Mode Java Examples
The following examples show how to use
com.alibaba.druid.stat.TableStat.Mode.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MycatSchemaStatVisitor.java From Mycat2 with GNU General Public License v3.0 | 6 votes |
public boolean visit(MySqlDeleteStatement x) { setAliasMap(); setMode(x, Mode.Delete); accept(x.getFrom()); accept(x.getUsing()); x.getTableSource().accept(this); if (x.getTableSource() instanceof SQLExprTableSource) { SQLName tableName = (SQLName) ((SQLExprTableSource) x.getTableSource()).getExpr(); String ident = tableName.toString(); setCurrentTable(x, ident); TableStat stat = this.getTableStat(ident,ident); stat.incrementDeleteCount(); } accept(x.getWhere()); accept(x.getOrderBy()); accept(x.getLimit()); return false; }
Example #2
Source File: SqlVisitor.java From baymax with Apache License 2.0 | 6 votes |
@Override public boolean visit(MySqlDeleteStatement x) { setAliasMap(); setMode(x, Mode.Delete); accept(x.getFrom()); accept(x.getUsing()); x.getTableSource().accept(this); if (x.getTableSource() instanceof SQLExprTableSource) { SQLName tableName = (SQLName) ((SQLExprTableSource) x.getTableSource()).getExpr(); String ident = tableName.toString(); setCurrentTable(x, ident); // 和父类只有这行不同 TableStat stat = this.getTableStat(ident,ident); stat.incrementDeleteCount(); } accept(x.getWhere()); accept(x.getOrderBy()); accept(x.getLimit()); return false; }
Example #3
Source File: MycatSchemaStatVisitor.java From Mycat2 with GNU General Public License v3.0 | 5 votes |
public boolean visit(SQLUpdateStatement x) { setAliasMap(); setMode(x, Mode.Update); SQLName identName = x.getTableName(); if (identName != null) { String ident = identName.toString(); String alias = x.getTableSource().getAlias(); setCurrentTable(ident); TableStat stat = getTableStat(ident); stat.incrementUpdateCount(); Map<String, String> aliasMap = getAliasMap(); aliasMap.put(ident, ident); if(alias != null) { aliasMap.put(alias, ident); } } else { x.getTableSource().accept(this); } accept(x.getItems()); accept(x.getWhere()); return false; }
Example #4
Source File: SqlVisitor.java From baymax with Apache License 2.0 | 5 votes |
@Override public boolean visit(SQLUpdateStatement x) { setAliasMap(); setMode(x, Mode.Update); SQLName identName = x.getTableName(); if (identName != null) { String ident = identName.toString(); // String alias = x.getTableSource().getAlias(); setCurrentTable(ident); TableStat stat = getTableStat(ident); stat.incrementUpdateCount(); Map<String, String> aliasMap = getAliasMap(); aliasMap.put(ident, ident); // if(alias != null) { aliasMap.put(alias, ident); } } else { x.getTableSource().accept(this); } accept(x.getItems()); accept(x.getWhere()); return false; }