Package com.sun.faban.harness

Examples of com.sun.faban.harness.ParamRepository


            String shortName = result.runId.getBenchName();
            BenchmarkDescription desc = BenchmarkDescription.readDescription(
                                        shortName, resultDir.getAbsolutePath());
            String paramFileName = resultDir.getAbsolutePath() + File.separator
                                                          + desc.configFileName;
            ParamRepository param = new ParamRepository(paramFileName, false);
            param.setParameter("fa:runConfig/fh:description",
                                                            result.description);
            param.save();
        } catch (Exception ex) {
            Logger.getLogger(ResultAction.class.getName()).
                    log(Level.SEVERE, null, ex);
        }
    }
View Full Code Here


            if (dateTime == null) {
                dateTime = new Date(paramFile.lastModified());
            }
            // End compatibility block

            ParamRepository par = new ParamRepository(paramFileName, false);
            description = par.getParameter("fa:runConfig/fh:description");
            scale = par.getParameter("fa:runConfig/fa:scale");
        } else {
            logger.warning(runId.toString() +
                    ": Parameter file invalid or non-existent.");
        }
           
View Full Code Here

                    String paramFile = Config.RUNQ_DIR + list[i]
                            + File.separator + ((BenchmarkDescription)
                            benchMap.get(benchName)).configFileName;
                    String desc = null;
                    if (new File(paramFile).exists()) {
                        ParamRepository par =
                                new ParamRepository(paramFile, false);
                        desc = par.getParameter("fa:runConfig/fh:description");
                    }
                    if((desc == null) || (desc.length() == 0))
                        data[i][DESCRIPTION] = "UNAVAILABLE";
                    else
                        data[i][DESCRIPTION] = desc;
View Full Code Here

     * Responsible for configuring, starting and stopping services and tools.
     * Creates the actual benchmark object and requests it to execute the run.
     */
    @SuppressWarnings("static-access")
    public void start() {
        ParamRepository par = null;
        ServerConfig server;

        // Read the benchmark description.
        BenchmarkDescription benchDesc = run.getBenchDesc();

        long startTime;  // benchmark start/end time
        long endTime;

        // Create benchmark object.
        logger.fine("Instantiating benchmark class " +
                benchDesc.benchmarkClass);
        //bm = newInstance(benchDesc);
        bmw = BenchmarkWrapper.getInstance(benchDesc);

        if (bmw == null)
            return;

        startTime = System.currentTimeMillis();

        // Update the status of the run
        try {
            run.updateStatus(Run.STARTED);
        } catch (IOException e) {
            logger.log(Level.SEVERE,  "Failed to update run status.", e);
            return;
        }

        // Read in user parameters
        logger.info("START TIME : " + new java.util.Date());

        logger.fine("Reading in user parameters");
        try {
            try {
                par = new ParamRepository(run.getParamFile(), true);
            } catch (Exception e) {
                logger.log(Level.SEVERE, "Failed to open ParamRepository "
                        + run.getParamFile() + '.', e);
                return;    // can't proceed with benchmark
            }

            // Create the facade for the benchmark to access.
            RunFacade.newInstance(run, par);

            try {
                bmw.validate();
            } catch (Throwable t) {
                logger.log(Level.SEVERE, "Benchmark validation failed.", t);
                return;
            }

            try {
                // Initialize CmdService
                logger.fine("Initializing Command Service");

                cmds = new CmdService();
                cmds.init();

                // We need to place a marker into the Benchmark's META-INF
                // directory so if it is shared, download won't happen.
                FileWriter runIdFile = new FileWriter(Config.BENCHMARK_DIR +
                                run.getBenchmarkName() + File.separator +
                                "META-INF" + File.separator + "RunID");
                runIdFile.write(run.getRunId());
                runIdFile.close();

                // Start CmdAgent on all ENABLED hosts using the JAVA HOME
                // Specified JVM options will be used by the Agent when it
                // starts java processes
                if (!cmds.setup(benchDesc.shortName, par)) {
                logger.severe("CmdService setup failed. Exiting");
                    return;
                }
            } catch (Exception e) {
                logger.log(Level.SEVERE, "Start failed.", e);
                return;
            }

            // Extract host metadata and save it.
            HostRoles hr = new HostRoles(par);
            cmds.setHostRoles(hr);
            try {
                hr.write(run.getOutDir() + File.separator + "META-INF" +
                                        File.separator + "hosttypes");
            } catch (IOException e) {
                logger.log(Level.WARNING, "Error writing hosttypes file!", e);
            }

            // Reading parameters needed for ToolService
            String s = par.getParameter("fa:runControl/fa:rampUp");
            if (s != null)
                s = s.trim();
            if (s == null || s.length() == 0) {
                logger.severe("Configuration runControl/rampUp not set.");
                return;
            }
            int delay = 0;
            try {
                delay = Integer.parseInt(s);
            } catch (NumberFormatException e) {
                logger.log(Level.SEVERE,
                        "Parameter rampUp is not a number.", e);
                return;
            }
            if (delay < 0) {
                logger.severe("Parameter rampUp is negative");
                return;
            }

            int len = -1;
            s = par.getParameter("fa:runControl/fa:steadyState");
            if (s != null) {
                s = s.trim();
                len = s.length();
            }
            if (len > 0) {
View Full Code Here

TOP

Related Classes of com.sun.faban.harness.ParamRepository

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.