|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oozie.service.JobsConcurrencyService
public class JobsConcurrencyService
This Service helps coordinate other Services to prevent duplicate processing of Jobs if there are multiple Oozie Servers. This
implementation assumes that there are NO other Oozie Servers (i.e. not HA).
The ZKJobsConcurrencyService provides a more meaningful implementation.
| Field Summary |
|---|
| Fields inherited from interface org.apache.oozie.service.Service |
|---|
CONF_PREFIX, DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND |
| Constructor Summary | |
|---|---|
JobsConcurrencyService()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Destroy the jobs concurrency service. |
Class<? extends Service> |
getInterface()
Return the public interface for the jobs concurrency services |
List<String> |
getJobIdsForThisServer(List<String> ids)
Filter out any job ids that should not be processed by this server. |
Map<String,String> |
getOtherServerUrls()
Return a map of instance id to other Oozie servers URL in HA. |
Map<String,String> |
getServerUrls()
Return a map of instance id to Oozie server URL. |
void |
init(Services services)
Initialize the jobs concurrency service |
void |
instrument(Instrumentation instr)
Instruments the jobs concurrency service. |
boolean |
isAllServerRequest(Map<String,String[]> params)
Checks if rest request is for all server. |
boolean |
isHighlyAvailableMode()
Check if it is running in HA mode |
boolean |
isJobIdForThisServer(String jobId)
Check to see if jobId should be processed by this server. |
boolean |
isLeader()
Check to see if this server is the first server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JobsConcurrencyService()
| Method Detail |
|---|
public void init(Services services)
throws ServiceException
init in interface Serviceservices - services instance.
ServiceException - thrown if the service could not initialize.public void destroy()
destroy in interface Servicepublic Class<? extends Service> getInterface()
getInterface in interface ServiceJobsConcurrencyService.public void instrument(Instrumentation instr)
instrument in interface Instrumentableinstr - instance to instrument the jobs concurrency service to.public boolean isLeader()
public boolean isJobIdForThisServer(String jobId)
jobId - The jobId to check
public List<String> getJobIdsForThisServer(List<String> ids)
ids - The list of job ids to check
public Map<String,String> getServerUrls()
Exceptionpublic Map<String,String> getOtherServerUrls()
Exceptionpublic boolean isAllServerRequest(Map<String,String[]> params)
params - the HttpRequest param
public boolean isHighlyAvailableMode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||