Package edu.brown.hashing

Examples of edu.brown.hashing.DefaultHasher


   
    @Override
    protected void setUp() throws Exception {
        super.setUp(ProjectType.MAPREDUCE);
        this.addPartitions(NUM_PARTITIONS);
        p_estimator = new PartitionEstimator(catalogContext, new DefaultHasher(catalogContext, NUM_PARTITIONS));
    }
View Full Code Here


    @Override
    protected void setUp() throws Exception {
        super.setUp(ProjectType.TM1);
        if (hasher == null) {
            this.addPartitions(num_partitions);
            hasher = new DefaultHasher(catalogContext);
        }
    }
View Full Code Here

            synchronized (TPCCSimulation.class) {
                if (remoteWarehouseIds == null) {
                  remoteWarehouseIds = new HashMap<Integer, List<Integer>>();
                  HashMap <Integer, Integer> partitionToSite = new HashMap<Integer, Integer>();
                 
                  DefaultHasher hasher = new DefaultHasher(catalogContext);
                for (Site s: catalogContext.sites) {
                  for (Partition p: s.getPartitions())
                    partitionToSite.put(p.getId(), s.getId());
                } // FOR
                   
                for (int w_id0 = parameters.starting_warehouse; w_id0 <= parameters.last_warehouse; w_id0++) {
                    final int partition0 = hasher.hash(w_id0);
                  final int site0 = partitionToSite.get(partition0);
                  final List<Integer> rList = new ArrayList<Integer>()
                 
                  for (int w_id1 = parameters.starting_warehouse; w_id1 <= parameters.last_warehouse; w_id1++) {
                      // Figure out what partition this W_ID maps to
                      int partition1 = hasher.hash(w_id1);
                     
                      // Check whether this partition is on our same local site
                      int site1 = partitionToSite.get(partition1);
                      if (site0 != site1) rList.add(w_id1);
                  } // FOR
View Full Code Here

        SingleSitedCostModel cost_model = new SingleSitedCostModel(info.catalogContext);
        LOG.info("Generating cost model information for given PartitionPlan");
        cost_model.estimateWorkloadCost(info.catalogContext, this.info.workload);

        int num_partitions = info.catalogContext.numberOfPartitions;
        AbstractHasher hasher = new DefaultHasher(info.catalogContext, num_partitions);

        Collection<Table> roots = pplan.getNonReplicatedRoots();
        Map<Table, List<Integer>> table_partition_values = new HashMap<Table, List<Integer>>();
        for (Table catalog_tbl : info.catalogContext.database.getTables()) {
            table_partition_values.put(catalog_tbl, new ArrayList<Integer>());
View Full Code Here

    }

    public static void main(String[] vargs) throws Exception {
        ArgumentsParser args = ArgumentsParser.load(vargs);

        MemoryEstimator estimator = new MemoryEstimator(args.stats, new DefaultHasher(args.catalogContext));
        for (Table catalog_tbl : args.catalog_db.getTables()) {
            System.out.println(catalog_tbl + ": " + estimator.estimate(catalog_tbl, args.catalogContext.numberOfPartitions));
        }
    }
View Full Code Here

    /**
     * Convenience constructor that uses DefaultHasher
     */
    public PartitionEstimator(CatalogContext catalogContext) {
        this(catalogContext, new DefaultHasher(catalogContext, catalogContext.numberOfPartitions));
    }
View Full Code Here

        this.costmodel_class = args.costmodel_class;
        this.costmodel = args.costmodel;
        this.checkpoint = args.designer_checkpoint;

        // Memory Estimator
        this.m_estimator = new MemoryEstimator(this.stats, new DefaultHasher(this.catalogContext, this.num_partitions));

        // Correlations (smoke 'em if you got 'em)
        if (args.param_mappings != null) {
            this.mappings = args.param_mappings;
            this.correlations_file = args.getFileParam(ArgumentsParser.PARAM_MAPPINGS);
View Full Code Here

            File stats_file = this.getStatsFile(ProjectType.TM1);
            stats = new WorkloadStatistics(catalog_db);
            stats.load(stats_file, catalog_db);
        }
       
        hasher = new DefaultHasher(catalogContext, NUM_PARTITIONS);
        m_estimator = new MemoryEstimator(stats, hasher);
        assertNotNull(m_estimator);
    }
View Full Code Here

   
    @Override
    protected void setUp() throws Exception {
        super.setUp(ProjectType.TM1);
        this.addPartitions(NUM_PARTITIONS);
        p_estimator = new PartitionEstimator(catalogContext, new DefaultHasher(catalogContext, NUM_PARTITIONS));
    }
View Full Code Here

TOP

Related Classes of edu.brown.hashing.DefaultHasher

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.