public class JobsConcurrencyService extends Object implements Service, Instrumentable
ZKJobsConcurrencyService
provides a more meaningful implementation.CONF_PREFIX, DEFAULT_LOCK_TIMEOUT, lockTimeout
Constructor and Description |
---|
JobsConcurrencyService() |
Modifier and Type | Method and Description |
---|---|
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.
|
public JobsConcurrencyService()
public void init(Services services) throws ServiceException
init
in interface Service
services
- services instance.ServiceException
- thrown if the service could not initialize.public void destroy()
public Class<? extends Service> getInterface()
getInterface
in interface Service
JobsConcurrencyService
.public void instrument(Instrumentation instr)
instrument
in interface Instrumentable
instr
- instance to instrument the jobs concurrency service to.public boolean isLeader()
public boolean isJobIdForThisServer(String jobId)
jobId
- The jobId to checkpublic List<String> getJobIdsForThisServer(List<String> ids)
ids
- The list of job ids to checkpublic Map<String,String> getServerUrls()
public Map<String,String> getOtherServerUrls()
public boolean isAllServerRequest(Map<String,String[]> params)
params
- the HttpRequest parampublic boolean isHighlyAvailableMode()
Copyright © 2018 Apache Software Foundation. All rights reserved.