Search in sources :

Example 1 with Name

use of com.alibaba.druid.stat.TableStat.Name in project Mycat-Server by MyCATApache.

the class DruidShardingParseInfo method addTables.

public void addTables(Map<Name, TableStat> map) {
    int dotIndex;
    for (Name _name : map.keySet()) {
        String _tableName = _name.getName().toString().toUpperCase();
        //系统表直接跳过,路由到默认datanode
        if (RouterUtil.isSystemSchema(_tableName)) {
            continue;
        }
        if ((dotIndex = _tableName.indexOf('.')) != -1) {
            _tableName = _tableName.substring(dotIndex + 1);
        }
        addTable(_tableName);
    }
}
Also used : Name(com.alibaba.druid.stat.TableStat.Name)

Example 2 with Name

use of com.alibaba.druid.stat.TableStat.Name in project Mycat-Server by MyCATApache.

the class DruidUpdateParser method getUpdateTableCount.

/**
     * 获取更新的表数
     * @author lian
     * @date 2016年11月2日
     * @return
     */
private int getUpdateTableCount() {
    Map<Name, TableStat> tableMap = this.ctx.getVisitor().getTables();
    int updateTableCount = 0;
    for (Name _name : tableMap.keySet()) {
        TableStat ts = tableMap.get(_name);
        updateTableCount += ts.getUpdateCount();
    }
    return updateTableCount;
}
Also used : TableStat(com.alibaba.druid.stat.TableStat) Name(com.alibaba.druid.stat.TableStat.Name)

Aggregations

Name (com.alibaba.druid.stat.TableStat.Name)2 TableStat (com.alibaba.druid.stat.TableStat)1