Package org.apache.tajo.catalog.statistics

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


    if (currentScanner != null) {
      this.projectable = currentScanner.isProjectable();
      this.selectable = currentScanner.isSelectable();
    }

    tableStats = new TableStats();
    long numBytes = 0;

    for (FileFragment eachFileFragment: rawFragmentList) {
      numBytes += (eachFileFragment.getEndKey() - eachFileFragment.getStartKey());
    }
View Full Code Here


    if (tuple != null) {
      return tuple;
    } else {
      if (currentScanner != null) {
        currentScanner.close();
        TableStats scannerTableStsts = currentScanner.getInputStats();
        if (scannerTableStsts != null) {
          tableStats.setReadBytes(tableStats.getReadBytes() + scannerTableStsts.getReadBytes());
          tableStats.setNumRows(tableStats.getNumRows() + scannerTableStsts.getNumRows());
        }
      }
      currentScanner = getNextScanner();
      if (currentScanner != null) {
        tuple = currentScanner.next();
View Full Code Here

  }

  @Override
  public float getProgress() {
    if (currentScanner != null && iterator != null && tableStats.getNumBytes() > 0) {
      TableStats scannerTableStsts = currentScanner.getInputStats();
      long currentScannerReadBytes = 0;
      if (scannerTableStsts != null) {
        currentScannerReadBytes = scannerTableStsts.getReadBytes();
      }

      return (float)(tableStats.getReadBytes() + currentScannerReadBytes) / (float)tableStats.getNumBytes();
    } else {
      return progress;
View Full Code Here

      smContext.requestFileScan(this);
    }
    inited = true;
    progress = 0.0f;

    tableStats = new TableStats();
    if (fragment != null) {
      tableStats.setNumBytes(fragment.getEndKey());
      tableStats.setNumBlocks(1);
    }
View Full Code Here

  public FileScanner(Configuration conf, final Schema schema, final TableMeta meta, final FileFragment fragment) {
    this.conf = conf;
    this.meta = meta;
    this.schema = schema;
    this.fragment = fragment;
    this.tableStats = new TableStats();
    this.columnNum = this.schema.size();
  }
View Full Code Here

        }
      });

      int index = 0;
      for (SubQuery eachSubQuery: subQueries) {
        TableStats inputStats = eachSubQuery.getInputStats();
        TableStats resultStats = eachSubQuery.getResultStats();

        assertNotNull(inputStats);
        assertEquals(expectedNumRows[index], inputStats.getNumRows().longValue());
        assertEquals(expectedNumBytes[index], inputStats.getNumBytes().longValue());
        assertEquals(expectedReadBytes[index], inputStats.getReadBytes().longValue());

        index++;

        assertNotNull(resultStats);
        assertEquals(expectedNumRows[index], resultStats.getNumRows().longValue());
        assertEquals(expectedNumBytes[index], resultStats.getNumBytes().longValue());
        assertEquals(expectedReadBytes[index], resultStats.getReadBytes().longValue());

        index++;
      }

  }
View Full Code Here

      totalSize = sm.calculateSize(path);
    } catch (IOException e) {
      LOG.warn("Cannot calculate the size of the relation", e);
    }

    TableStats stats = new TableStats();
    stats.setNumBytes(totalSize);
    TableDesc desc = new TableDesc(CatalogUtil.buildFQName(databaseName, simpleTableName),
        schema, meta, path, isExternal);
    desc.setStats(stats);
    if (partitionDesc != null) {
      desc.setPartitionMethod(partitionDesc);
View Full Code Here

        context.addShuffleFileOutput(partNum, getDataFile(partNum).getName());
      }
    }
   
    // Collect and aggregated statistics data
    TableStats aggregated = StatisticsUtil.aggregateTableStat(statSet);
    context.setResultStats(aggregated);
   
    return null;
  }
View Full Code Here

      app.close();
      statSet.add(app.getStats());
    }

    // Collect and aggregated statistics data
    TableStats aggregated = StatisticsUtil.aggregateTableStat(statSet);
    context.setResultStats(aggregated);

    return null;
  }
View Full Code Here

      public void execute(QueryMaster.QueryMasterContext context, QueryContext queryContext,
                          Query query, ExecutionBlockId finalExecBlockId,
                          Path finalOutputDir) throws Exception {
        SubQuery lastStage = query.getSubQuery(finalExecBlockId);
        TableMeta meta = lastStage.getTableMeta();
        TableStats stats = lastStage.getResultStats();

        TableDesc resultTableDesc =
            new TableDesc(
                query.getId().toString(),
                lastStage.getSchema(),
                meta,
                finalOutputDir);
        resultTableDesc.setExternal(true);

        stats.setNumBytes(getTableVolume(query.systemConf, finalOutputDir));
        resultTableDesc.setStats(stats);
        query.setResultDesc(resultTableDesc);
      }
View Full Code Here

TOP

Related Classes of org.apache.tajo.catalog.statistics.TableStats

Copyright © 2018 www.massapicom. 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.