Package org.apache.oodt.cas.resource.structs

Examples of org.apache.oodt.cas.resource.structs.NameValueJobInput


      throw new JobInputException(
          "Only know how to handle NameValueInput: unknown input type: ["
              + in.getClass().getName() + "]");
    }

    NameValueJobInput input = (NameValueJobInput) in;

    System.out.println("Hello world! How are you "
        + input.getValue("user.name") + "!");
    return true;
  }
View Full Code Here


            throw new JobInputException(
                    "Only know how to handle NameValueInput: unknown input type: ["
                            + in.getClass().getName() + "]");
        }

        NameValueJobInput input = (NameValueJobInput) in;

        int waitTime = 0;
        waitTime = new Integer(input.getValue("wait")).intValue();

        System.out.println("LongJob running for " + waitTime + " sec");

        try {
            Thread.sleep(waitTime * 1000);
 
View Full Code Here

      Job hw1 = new Job("JobOne", "HelloWorldJob",
          "org.apache.oodt.cas.resource.examples.HelloWorldJob",
          "org.apache.oodt.cas.resource.structs.NameValueJobInput", "quick",
          new Integer(1));
      NameValueJobInput hw1Input = new NameValueJobInput();
      hw1Input.setNameValuePair("user.name", "Dave");

      client.submitJob(hw1, hw1Input);

    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

        // ----------------------------------------------------------------
        // create a default JobSpec
        // ----------------------------------------------------------------
        JobSpec spec = JobBuilder.buildJobSpec(jobFile.getAbsolutePath());
        Job job = spec.getJob();
        NameValueJobInput jobInput = (NameValueJobInput) spec.getIn();

        // ----------------------------------------------------------------
        // open the file to read. traverse through the list of directories
        // name given & override the default Job's runDirName value with the
        // directory name. then submit the Job.
        // ----------------------------------------------------------------

        try {
            BufferedReader in = new BufferedReader(new FileReader(inputFname));
            if (!in.ready())
                throw new IOException();

            String line = null;
            String jobId = null;
            while ((line = in.readLine()) != null) {

                // overwrite the runDirName
                jobInput.setNameValuePair("runDirName", line);

                jobId = submitJob(job, jobInput);
                LOG.log(Level.INFO, "Job Submitted: id: [" + jobId + "]");
            }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.resource.structs.NameValueJobInput

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.