public FragmentEntry getFragment(Table catalog_tbl, int hash) { String table_key = CatalogKey.createKey(catalog_tbl); for (FragmentEntry fragment : this.fragments) { if (fragment.getTableKey().equals(table_key) && fragment.getHashKey() == hash) { return (fragment); } } // FOR return (null); }
public void apply(Database catalog_db, WorkloadStatistics stats, AbstractHasher hasher) { // // We need to estimate how big each partition is // MemoryEstimator estimator = new MemoryEstimator(stats, hasher); for (SiteEntry site : this.sites) { long site_size = 0l; for (FragmentEntry fragment : site.getFragments()) { Table catalog_tbl = fragment.getTable(catalog_db); Column partition_col = catalog_tbl.getPartitioncolumn(); long size = estimator.estimate(catalog_tbl, partition_col, fragment.getHashKey()); site_size += size; fragment.setEstimatedSize(size); } // FOR site.setEstimatedSize(site_size); } // FOR }