Examples of TableStat


Examples of com.alibaba.druid.stat.TableStat

        if (x.getTableName() instanceof SQLIdentifierExpr) {
            String ident = ((SQLIdentifierExpr) x.getTableName()).getName();
            currentTableLocal.set(ident);
            x.putAttribute("_old_local_", originalTable);

            TableStat stat = tableStats.get(ident);
            if (stat == null) {
                stat = new TableStat();
                tableStats.put(new TableStat.Name(ident), stat);
            }
            stat.incrementInsertCount();

            Map<String, String> aliasMap = aliasLocal.get();
            if (aliasMap != null) {
                if (x.getAlias() != null) {
                    aliasMap.put(x.getAlias(), ident);
View Full Code Here

Examples of com.alibaba.druid.stat.TableStat

        if (x.getTableSource() instanceof SQLExprTableSource) {
            SQLName tableName = (SQLName) ((SQLExprTableSource) x.getTableSource()).getExpr();
            String ident = tableName.toString();
            setCurrentTable(x, ident);

            TableStat stat = this.getTableStat(ident);
            stat.incrementDeleteCount();
        }

        accept(x.getWhere());

        accept(x.getOrderBy());
View Full Code Here

Examples of com.alibaba.druid.stat.TableStat

        if (x.getTableName() instanceof SQLIdentifierExpr) {
            String ident = ((SQLIdentifierExpr) x.getTableName()).getName();
            setCurrentTable(x, ident);

            TableStat stat = getTableStat(ident);
            stat.incrementInsertCount();

            Map<String, String> aliasMap = getAliasMap();
            if (aliasMap != null) {
                if (x.getAlias() != null) {
                    aliasMap.put(x.getAlias(), ident);
View Full Code Here

Examples of com.alibaba.druid.stat.TableStat

        if (variants.containsKey(tableName)) {
            return null;
        }

        tableName = handleName(tableName);
        TableStat stat = tableStats.get(tableName);
        if (stat == null) {
            stat = new TableStat();
            tableStats.put(new TableStat.Name(tableName), stat);
            if (alias != null) {
                aliasMap.put(alias, tableName);
            }
        }
View Full Code Here

Examples of com.alibaba.druid.stat.TableStat

            String ident = name.toString();
            setCurrentTable(ident);
            x.putAttribute("_old_local_", originalTable);

            TableStat stat = getTableStat(ident);
            stat.incrementDeleteCount();

            Map<String, String> aliasMap = getAliasMap();
            if (aliasMap != null) {
                aliasMap.put(ident, ident);
            }
View Full Code Here

Examples of com.alibaba.druid.stat.TableStat

            SQLName name = (SQLName) tableSource.getExpr();
            String ident = name.toString();
            setCurrentTable(ident);
            x.putAttribute("_old_local_", originalTable);

            TableStat stat = getTableStat(ident);
            stat.incrementDropCount();

            Map<String, String> aliasMap = getAliasMap();
            if (aliasMap != null) {
                aliasMap.put(ident, ident);
            }
View Full Code Here

Examples of com.alibaba.druid.stat.TableStat

        if (x.getTableName() instanceof SQLName) {
            String ident = ((SQLName) x.getTableName()).toString();
            setCurrentTable(ident);
            x.putAttribute("_old_local_", originalTable);

            TableStat stat = getTableStat(ident);
            stat.incrementInsertCount();

            Map<String, String> aliasMap = getAliasMap();
            if (aliasMap != null) {
                if (x.getAlias() != null) {
                    aliasMap.put(x.getAlias(), ident);
View Full Code Here

Examples of com.alibaba.druid.stat.TableStat

        }

        if (x.getInto() != null && x.getInto().getExpr() instanceof SQLName) {
            SQLName into = (SQLName) x.getInto().getExpr();
            String ident = into.toString();
            TableStat stat = getTableStat(ident);
            if (stat != null) {
                stat.incrementInsertCount();
            }
        }

        String originalTable = getCurrentTable();
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.table.TableStat

            if (statUnit <= 0) {
                insertBehaviorHistory(stat);
            } else {
                synchronized (tableStats) {
                    // 插入历史数据表
                    TableStat old = tableStats.get(stat.getDataMediaPairId());
                    if (old != null) {
                        //合并数据
                        old.setInsertCount(stat.getInsertCount() + old.getInsertCount());
                        old.setUpdateCount(stat.getUpdateCount() + old.getUpdateCount());
                        old.setDeleteCount(stat.getDeleteCount() + old.getDeleteCount());
                        old.setFileCount(stat.getFileCount() + old.getFileCount());
                        old.setFileSize(stat.getFileSize() + old.getFileSize());
                        if (stat.getEndTime().after(old.getEndTime())) {
                            old.setEndTime(stat.getEndTime());
                        }
                        if (stat.getStartTime().before(old.getStartTime())) {
                            old.setStartTime(stat.getStartTime());
                        }
                    } else {
                        tableStats.put(stat.getDataMediaPairId(), stat);
                    }
                }
View Full Code Here

Examples of org.apache.tajo.catalog.statistics.TableStat

      }
    }
  }

  public TableStat getTableStat() {
    TableStat stat = new TableStat();

    ColumnStat columnStat;
    for (int i = 0; i < schema.getColumnNum(); i++) {
      columnStat = new ColumnStat(schema.getColumn(i));
      columnStat.setNumNulls(numNulls[i]);
      columnStat.setMinValue(minValues.get(i));
      columnStat.setMaxValue(maxValues.get(i));
      stat.addColumnStat(columnStat);
    }

    stat.setNumRows(this.numRows);
    stat.setNumBytes(this.numBytes);

    return stat;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.