[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/controller/pool PoolJobController
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-05-24 14:34:21
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15837/jmonks/batchserver/framework/controller/pool Modified Files: PoolJobController.java Log Message: no message Index: PoolJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobController.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PoolJobController.java 20 May 2006 04:40:43 -0000 1.10 --- PoolJobController.java 24 May 2006 14:33:59 -0000 1.11 *************** *** 3,10 **** --- 3,12 ---- import EDU.oswego.cs.dl.util.concurrent.CountDown; import EDU.oswego.cs.dl.util.concurrent.FutureResult; + import java.util.Calendar; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import org.apache.log4j.Logger; + import org.jmonks.batchserver.framework.JobStatistics; import org.jmonks.batchserver.framework.common.ErrorCode; import org.jmonks.batchserver.framework.config.ConfigurationException; *************** *** 13,21 **** import org.jmonks.batchserver.framework.management.ProcessorState; import org.jmonks.batchserver.framework.management.ProcessorStatus; ! import org.jmonks.batchserver.framework.common.*; ! import org.jmonks.batchserver.framework.controller.*; ! import org.jmonks.batchserver.framework.management.*; ! import EDU.oswego.cs.dl.util.concurrent.*; ! import java.util.*; /** --- 15,19 ---- import org.jmonks.batchserver.framework.management.ProcessorState; import org.jmonks.batchserver.framework.management.ProcessorStatus; ! /** *************** *** 83,86 **** --- 81,88 ---- */ private JobPool pool=null; + /** + * Holds the statistics of the basic job controller. + */ + private JobStatistics jobStatistics=null; private static Logger logger=Logger.getLogger(PoolJobController.class); *************** *** 126,129 **** --- 128,133 ---- this.jobProcessorsResultMap.put(jobLoaderName, jobLoaderFutureResult); this.jobProcessorsMap.put(jobLoaderName, jobLoader); + this.jobStatistics=new JobStatistics(super.getJobName()); + this.jobStatistics.setStartTime(Calendar.getInstance().getTime()); /** * Create, initialize and spawn the processor(s). *************** *** 383,386 **** --- 387,393 ---- } + this.jobStatistics.setEndTime(Calendar.getInstance().getTime()); + this.jobStatistics.setRecordsProcessed(this.getProcessedRecordsCount()); + for(Iterator iterator=this.jobProcessorsResultMap.values().iterator();iterator.hasNext();) { *************** *** 543,545 **** --- 550,563 ---- } } + + /** + * @see org.jmonks.batchserver.framework.controller.JobController#getJobStatistics() + */ + public JobStatistics getJobStatistics() + { + if(this.jobStatistics.getEndTime()!=null) + return this.jobStatistics; + else + return null; + } } |