Results 1 to 8 of 8

Thread: Status of submitted Job

  1. #1
    Join Date
    Aug 2012
    Posts
    10

    Default Status of submitted Job

    When a job is submitted we get a handler back called RunningJob , how can one access the status of the job by using RunningJob please post any pointers in regards to this if one available, I would like get atleast JobID of submitted job.

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    SHDP uses the so-called new API, mapreduce . The Job/JobContext provides most of the methods you want - in the worse case scenario you can use reflection to get a hold of the underlying RunningJob. We already have a class that does that in mapreduce package - I'll make it public so you can use that instead.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    By the way, I've added a jira to provide automatic conversion when using the container for injection. Feedback is welcome:
    https://jira.springsource.org/browse/SHDP-99
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    SHDP now can do the conversion automatically between a Job and a RunningJob (other common types are supported).
    So simply inject the job into a RunningJob field and SHDP will take of it behind the scenes.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Aug 2012
    Posts
    10

    Default

    Hi costin is the code committed can I checkout the latest build to test this ?

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Yes. There's even a snapshot build pushed for it [1]. See SHDP home page for more info on the maven repo for snapshots

    [1] https://build.springsource.org/brows...OOPNIGHTLY-340
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  7. #7
    Join Date
    Aug 2012
    Posts
    10

    Default

    Hi Costin, I checked out the latest build and I am using spring batch to launch my jobs and now I am trying to figure how I can get the job id of a launched job from spring container. For example if I have multiple instances of the same job how can I get jobId of each job.

  8. #8
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    You need to get a hold of the proper instance (typically by using the proper scope). You can either do injection - which will happen at instantiation time which work or not depending on the scope of the beans - or you can use the JobUtils class (in o.s.d.hadoop.mapreduce package) to do the conversion yourself between the Job and its Id.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •