org.apache.oozie.sla
Class SLACalculatorMemory

java.lang.Object
  extended by org.apache.oozie.sla.SLACalculatorMemory
All Implemented Interfaces:
SLACalculator

public class SLACalculatorMemory
extends Object
implements SLACalculator

Implementation class for SLACalculator that calculates SLA related to start/end/duration of jobs using a memory-based map


Constructor Summary
SLACalculatorMemory()
           
 
Method Summary
 boolean addJobStatus(String jobId, String jobStatus, org.apache.oozie.client.event.JobEvent.EventStatus jobEventStatus, Date startTime, Date endTime)
          Triggered after receiving Job status change event, update SLA status accordingly
 boolean addRegistration(String jobId, SLARegistrationBean reg)
          Register a new job into the map for SLA tracking
 void clear()
           
 SLACalcStatus get(String jobId)
           
 void init(org.apache.hadoop.conf.Configuration conf)
           
 boolean isEmpty()
           
 Iterator<String> iterator()
           
 void removeRegistration(String jobId)
          Remove job from being tracked in map
 int size()
           
 void updateAllSlaStatus()
          Periodically run by the SLAService worker threads to update SLA status by iterating through all the jobs in the map
protected  void updateJobSla(String jobId)
          Invoked via periodic run, update the SLA for registered jobs
 boolean updateRegistration(String jobId, SLARegistrationBean reg)
          Update job into the map for SLA tracking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SLACalculatorMemory

public SLACalculatorMemory()
Method Detail

init

public void init(org.apache.hadoop.conf.Configuration conf)
          throws ServiceException
Specified by:
init in interface SLACalculator
Throws:
ServiceException

size

public int size()
Specified by:
size in interface SLACalculator

get

public SLACalcStatus get(String jobId)
                  throws JPAExecutorException
Specified by:
get in interface SLACalculator
Throws:
JPAExecutorException

iterator

public Iterator<String> iterator()
Specified by:
iterator in interface SLACalculator

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface SLACalculator

clear

public void clear()
Specified by:
clear in interface SLACalculator

updateJobSla

protected void updateJobSla(String jobId)
                     throws JPAExecutorException,
                            ServiceException
Invoked via periodic run, update the SLA for registered jobs

Throws:
JPAExecutorException
ServiceException

updateAllSlaStatus

public void updateAllSlaStatus()
Periodically run by the SLAService worker threads to update SLA status by iterating through all the jobs in the map

Specified by:
updateAllSlaStatus in interface SLACalculator

addRegistration

public boolean addRegistration(String jobId,
                               SLARegistrationBean reg)
                        throws JPAExecutorException
Register a new job into the map for SLA tracking

Specified by:
addRegistration in interface SLACalculator
Throws:
JPAExecutorException

updateRegistration

public boolean updateRegistration(String jobId,
                                  SLARegistrationBean reg)
                           throws JPAExecutorException
Update job into the map for SLA tracking

Specified by:
updateRegistration in interface SLACalculator
Throws:
JPAExecutorException

removeRegistration

public void removeRegistration(String jobId)
Remove job from being tracked in map

Specified by:
removeRegistration in interface SLACalculator

addJobStatus

public boolean addJobStatus(String jobId,
                            String jobStatus,
                            org.apache.oozie.client.event.JobEvent.EventStatus jobEventStatus,
                            Date startTime,
                            Date endTime)
                     throws JPAExecutorException,
                            ServiceException
Triggered after receiving Job status change event, update SLA status accordingly

Specified by:
addJobStatus in interface SLACalculator
Throws:
JPAExecutorException
ServiceException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.