Package edu.brown.mappings

Examples of edu.brown.mappings.ParameterMappingsSet


    protected final void applyParameterMappings(ProjectType type) throws Exception {
        // We need the correlations file in order to make sure the parameters
        // get mapped properly
        File correlations_path = this.getParameterMappingsFile(type);
        if (correlations_path != null) {
            ParameterMappingsSet correlations = new ParameterMappingsSet();
            correlations.load(correlations_path, catalog_db);
            ParametersUtil.applyParameterMappings(catalog_db, correlations);
        }
    }
View Full Code Here


        super.setUp(ProjectType.TM1);
        this.addPartitions(NUM_PARTITIONS);

        if (mappings == null) {
            File f = this.getParameterMappingsFile(ProjectType.TM1);
            mappings = new ParameterMappingsSet();
            mappings.load(f, catalog_db);
        }
       
        summarizer = new WorkloadSummarizer(catalog_db, p_estimator, mappings);
        catalog_proc = this.getProcedure(UpdateLocation.class);
View Full Code Here

        assertNotNull(catalog_stmt);
       
        if (isFirstSetup()) {
           
            File file = this.getParameterMappingsFile(ProjectType.TM1);
            correlations = new ParameterMappingsSet();
            correlations.load(file, catalogContext.database);

            file = this.getWorkloadFile(ProjectType.TM1);
            workload = new Workload(catalogContext.catalog);
View Full Code Here

        this.addPartitions(NUM_PARTITIONS);
        this.catalog_proc = this.getProcedure(TARGET_PROCEDURE);

        if (markovs == null) {
            File file = this.getParameterMappingsFile(ProjectType.TPCC);
            correlations = new ParameterMappingsSet();
            correlations.load(file, catalogContext.database);

            file = this.getWorkloadFile(ProjectType.TPCC);
            workload = new Workload(catalogContext.catalog);
View Full Code Here

       
        return success;
    }
   
    private void applyParameterMappings(Database catalog_db) {
        ParameterMappingsSet mappings = new ParameterMappingsSet();       
       
        // Load ParameterMappingSet from file
        if (m_paramMappingsFile != null) {
            try {
                mappings.load(m_paramMappingsFile, catalog_db);
            } catch (IOException ex) {
                String msg = "Failed to load ParameterMappingsSet file '" + m_paramMappingsFile + "'";
                throw new RuntimeException(msg, ex);
            }
        }
        // Build ParameterMappingSet from user-provided inputs
        else {
            for (String procName : m_paramMappings.keySet()) {
                Procedure catalog_proc = catalog_db.getProcedures().getIgnoreCase(procName);
                assert(catalog_proc != null) :
                    "Invalid Procedure name for ParameterMappings '" + procName + "'";
                for (Integer procParamIdx : m_paramMappings.get(procName).keySet()) {
                    ProcParameter catalog_procParam = catalog_proc.getParameters().get(procParamIdx.intValue());
                    assert(catalog_procParam != null) :
                        "Invalid ProcParameter for '" + procName + "' at offset " + procParamIdx;
                    Pair<String, Integer> stmtPair = m_paramMappings.get(procName).get(procParamIdx);
                    assert(stmtPair != null);
                   
                    Statement catalog_stmt = catalog_proc.getStatements().getIgnoreCase(stmtPair.getFirst());
                    assert(catalog_stmt != null) :
                        "Invalid Statement name '" + stmtPair.getFirst() + "' for ParameterMappings " +
                    "for Procedure '" + procName + "'";
                    StmtParameter catalog_stmtParam = catalog_stmt.getParameters().get(stmtPair.getSecond().intValue());
                    assert(catalog_stmtParam != null) :
                        "Invalid StmtParameter for '" + catalog_stmt.fullName() + "' at offset " + stmtPair.getSecond();
                   
                    // HACK: This assumes that the ProcParameter is not an array
                    // and that we want to map the first invocation of the Statement
                    // directly to the ProcParameter.
                    ParameterMapping pm = new ParameterMapping(catalog_stmt,
                                                               0,
                                                               catalog_stmtParam,
                                                               catalog_procParam,
                                                               0,
                                                               1.0);
                    mappings.add(pm);
                } // FOR (ProcParameter)
            } // FOR (Procedure)
        }
       
        // Apply it!
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.