Package edu.brown.mappings

Examples of edu.brown.mappings.ParameterMappingsSet


        }
       
        // ----------------------------------------------------------------------------
        // ParameterMappings
        // ----------------------------------------------------------------------------
        ParameterMappingsSet mappings = new ParameterMappingsSet();
        if (hstore_conf.site.mappings_path != null) {
            File path = new File(hstore_conf.site.mappings_path);
            if (path.exists()) {
                Database catalog_db = catalogContext.database;
                try {
                    mappings.load(path, catalog_db);
                } catch (IOException ex) {
                    throw new RuntimeException(ex);
                }
            } else if (debug.val) LOG.warn("The ParameterMappings file '" + path + "' does not exist");
        }
View Full Code Here


            }
            this.applyParameterMappings(type);
            mappings_file = this.getParameterMappingsFile(type);
            assertNotNull(mappings_file);
            assert(mappings_file.exists());
            mappings = new ParameterMappingsSet();
            mappings.load(mappings_file, catalog_db);
        }
       
        // Setup everything else (that's just how we roll up in this ma)
        this.info = this.generateInfo(catalogContext);
View Full Code Here

       
        if (correlations == null) {
            correlations_file = this.getParameterMappingsFile(ProjectType.TPCC);
            assertNotNull(correlations_file);
            assert(correlations_file.exists());
            correlations = new ParameterMappingsSet();
            correlations.load(correlations_file, catalog_db);
        }
       
        // Setup everything else (that's just how we roll up in this ma)
        this.workload = new Workload(catalog);
View Full Code Here

   
    @Override
    protected void setUp() throws Exception {
        super.setUp(ProjectType.TM1);
       
        this.pc = new ParameterMappingsSet();
        this.catalog_proc = this.getProcedure(GetNewDestination.class);
        this.catalog_proc_param = this.catalog_proc.getParameters().get(0);
       
        double coefficient = 0.0;
        for (Statement catalog_stmt : this.catalog_proc.getStatements()) {
View Full Code Here

        assertNotNull(json_string);
        assertFalse(json_string.isEmpty());

        JSONObject json_object = new JSONObject(json_string);
        assertNotNull(json_object);
        ParameterMappingsSet clone = new ParameterMappingsSet();
        clone.fromJSON(json_object, catalog_db);
       
        // System.err.println(json_object.toString(2));
       
        assertEquals(this.pc.size(), clone.size());
        for (ParameterMapping c : this.pc) {
            assert(clone.contains(c));
        } // FOR
       
    }
View Full Code Here

       
        Statement catalog_stmt = this.catalog_proc.getStatements().get("getStockInfo");
        assertNotNull(catalog_stmt);
       
        double threshold = 1.0d;
        ParameterMappingsSet pc = procc.getCorrelations(threshold);
        assertNotNull(pc);
//        System.err.println(pc.debug());
        SortedMap<Integer, SortedMap<StmtParameter, SortedSet<ParameterMapping>>> stmt_correlations = pc.get(catalog_stmt);
        assertNotNull(stmt_correlations);
        assertFalse(stmt_correlations.isEmpty());
//        assertEquals(1, stmt_correlations.size());
        SortedMap<StmtParameter, SortedSet<ParameterMapping>> param_correlations = stmt_correlations.get(0);
        assertEquals(catalog_stmt.getParameters().size(), param_correlations.size());
View Full Code Here

        this.addPartitions(NUM_PARTITIONS);
        this.catalog_proc = this.getProcedure(TARGET_PROCEDURE);
       
        if (isFirstSetup()) {
            File file = this.getParameterMappingsFile(ProjectType.TPCC);
            mappings = new ParameterMappingsSet();
            mappings.load(file, catalogContext.database);
           
            // Workload Filter:
            //  (1) Only include TARGET_PROCEDURE traces
            //  (2) Only include traces with 10 orderline items
View Full Code Here

     */
    public LNSPartitioner(Designer designer, DesignerInfo info) {
        super(designer, info);
        this.costmodel = info.getCostModel();
        assert (this.costmodel != null) : "CostModel is null!";
        this.mappings = new ParameterMappingsSet();
        assert (info.getMappingsFile() != null) : "The parameter mappings file path was not set";
    }
View Full Code Here

     * @throws Exception
     */
    public static ListOrderedSet<String> generateProcParameterOrder(final DesignerInfo info, final Database catalog_db, final Procedure catalog_proc, final DesignerHints hints) throws Exception {
        // HACK: Reload the correlations file so that we can get the proper
        // catalog objects
        ParameterMappingsSet mappings = info.getMappings();
        assert (mappings != null);
        // ParameterCorrelations correlations = new ParameterCorrelations();
        // assert(info.getCorrelationsFile() != null) :
        // "The correlations file path was not set";
        // correlations.load(info.getCorrelationsFile(), catalog_db);

        // For each procedure, we need to generate a list of potential
        // partitioning parameters
        String proc_key = CatalogKey.createKey(catalog_proc);
        assert (proc_key != null);

        // For each ProcParameter, get a list of the correlations that can be
        // mapped to the partitioning columns
        // of tables. We will generate a total weight for each ProcParameter
        final Map<ProcParameter, List<Double>> param_correlations = new HashMap<ProcParameter, List<Double>>();

        // Get the list of tables accessed by this procedure
        for (Table catalog_tbl : CatalogUtil.getReferencedTables(catalog_proc)) {
            if (catalog_tbl.getIsreplicated())
                continue;
            Column catalog_col = catalog_tbl.getPartitioncolumn();

            for (ProcParameter catalog_proc_param : catalog_proc.getParameters()) {
                // Skip if this is an array
                if (hints.enable_array_procparameter_candidates == false && catalog_proc_param.getIsarray())
                    continue;
                if (!param_correlations.containsKey(catalog_proc_param)) {
                    param_correlations.put(catalog_proc_param, new ArrayList<Double>());
                }
                // Special Case: MultiProcParameter
                if (catalog_proc_param instanceof MultiProcParameter) {
                    if (hints.enable_multi_partitioning) {
                        MultiProcParameter mpp = (MultiProcParameter) catalog_proc_param;
                        for (ProcParameter inner : mpp) {
                            // Divide the values by the number of attributes in
                            // mpp so that we take the average
                            Collection<ParameterMapping> pms = mappings.get(inner, catalog_col);
                            if (pms != null) {
                                for (ParameterMapping c : pms) {
                                    param_correlations.get(catalog_proc_param).add(c.getCoefficient() / (double) mpp.size());
                                } // FOR (ParameterMapping)
                            }
                        } // FOR
                    }
                } else {
                    Collection<ParameterMapping> pms = mappings.get(catalog_proc_param, catalog_col);
                    if (pms != null) {
                        for (ParameterMapping c : pms) {
                            param_correlations.get(catalog_proc_param).add(c.getCoefficient());
                        } // FOR (Correlation)
                    }
View Full Code Here

        // Populate Parameter Mappings
        if (args.hasParam(ArgumentsParser.PARAM_MAPPINGS)) {
            File input_path = args.getFileParam(ArgumentsParser.PARAM_MAPPINGS);
            if (input_path.exists()) {
                ParameterMappingsSet mappings = new ParameterMappingsSet();
                mappings.load(input_path, args.catalog_db);
                ParametersUtil.applyParameterMappings(args.catalog_db, mappings);
                LOG.debug("Applied ParameterMappings file to '" + input_path + "' catalog parameter mappings...");
            } else {
                LOG.warn("ParameterMappings file '" + input_path + "' does not exist. Ignoring...");
            }
View Full Code Here

TOP

Related Classes of edu.brown.mappings.ParameterMappingsSet

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.