hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Pino <juancitomiguel...@gmail.com>
Subject JobControl run
Date Thu, 19 Apr 2012 16:11:15 GMT
Hi,

I wonder why when I call run() on a JobControl object, it loops forever.
Namely, this code doesn't work:

JobControl jobControl = new JobControl("Name");
// some stuff here (add jobs and dependencies)
jobControl.run();

This code works but looks a bit ugly:

JobControl jobControl = new JobControl("Name");
// some stuff here (add jobs and dependencies)
Thread control = new Thread(jobControl);
control.start();
while (!jobControl.allFinished()) {
    try {
        Thread.sleep(5000);
    }
    catch (Exception e) {}
}

I wonder if the run method in the JobControl class could add the following
condition to break the while(true) loop:

if (jobsInProgress.isEmpty()) {
    break;
}

Thanks very much,

Juan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message