|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.oozie.service.CallableQueueService
public class CallableQueueService
The callable queue service queues XCallable
s for asynchronous execution.
CONF_QUEUE_SIZE
size of the immediate execution queue. Defaulf value is 10000.
CONF_THREADS
number of threads in the thread-pool used for asynchronous command execution. When this number
of threads is reached, commands remain the queue until threads become available. Sets up a priority queue for the
execution of Commands via a ThreadPool. Sets up a Delayed Queue to handle actions which will be ready for execution
sometime in the future.
Field Summary | |
---|---|
static int |
CONCURRENCY_DELAY
|
static String |
CONF_CALLABLE_CONCURRENCY
|
static String |
CONF_CALLABLE_INTERRUPT_MAP_MAX_SIZE
|
static String |
CONF_CALLABLE_INTERRUPT_TYPES
|
static String |
CONF_CALLABLE_NEXT_ELIGIBLE
|
static String |
CONF_PREFIX
|
static String |
CONF_QUEUE_SIZE
|
static String |
CONF_THREADS
|
static HashSet<String> |
INTERRUPT_TYPES
|
static int |
SAFE_MODE_DELAY
|
Fields inherited from interface org.apache.oozie.service.Service |
---|
DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND |
Constructor Summary | |
---|---|
CallableQueueService()
|
Method Summary | |
---|---|
Set<XCallable<?>> |
checkInterrupts(String lockKey)
check the interrupt map for the existence of an interrupt commands if exist a List of Interrupt Callable for the same lock key will bereturned, otherwise it will return null |
void |
checkInterruptTypes(XCallable<?> callable)
check if the callable is of an interrupt type and insert it into the map accordingly |
void |
destroy()
Destroy the command queue service. |
Class<? extends Service> |
getInterface()
Return the public interface for command queue service. |
List<String> |
getQueueDump()
Get the list of strings of queue dump |
List<String> |
getUniqueDump()
Get the list of strings of uniqueness map dump |
void |
init(Services services)
Initialize the command queue service. |
void |
insertCallableIntoInterruptMap(XCallable<?> callable)
insert a new callable in the Interrupt Command Map add a new element to the list or create a new list accordingly |
void |
instrument(Instrumentation instr)
Instruments the callable queue service. |
boolean |
queue(XCallable<?> callable)
Queue a callable for asynchronous execution. |
boolean |
queue(XCallable<?> callable,
long delay)
Queue a callable for asynchronous execution sometime in the future. |
boolean |
queueSerial(List<? extends XCallable<?>> callables)
Queue a list of callables for serial execution. |
boolean |
queueSerial(List<? extends XCallable<?>> callables,
long delay)
Queue a list of callables for serial execution sometime in the future. |
int |
queueSize()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONF_PREFIX
public static final String CONF_QUEUE_SIZE
public static final String CONF_THREADS
public static final String CONF_CALLABLE_CONCURRENCY
public static final String CONF_CALLABLE_NEXT_ELIGIBLE
public static final String CONF_CALLABLE_INTERRUPT_TYPES
public static final String CONF_CALLABLE_INTERRUPT_MAP_MAX_SIZE
public static final int CONCURRENCY_DELAY
public static final int SAFE_MODE_DELAY
public static final HashSet<String> INTERRUPT_TYPES
Constructor Detail |
---|
public CallableQueueService()
Method Detail |
---|
public void init(Services services)
init
in interface Service
services
- services instance.public void destroy()
destroy
in interface Service
public Class<? extends Service> getInterface()
getInterface
in interface Service
CallableQueueService
.public int queueSize()
public boolean queue(XCallable<?> callable)
callable
- callable to queue.
true
if the callable was queued, false
if the queue is full and the callable
was not queued.public boolean queueSerial(List<? extends XCallable<?>> callables)
callables
- callables to be executed by the composite callable.
true
if the callables were queued, false
if the queue is full and the callables
were not queued.public boolean queue(XCallable<?> callable, long delay)
callable
- callable to queue for delayed executiondelay
- time, in milliseconds, that the callable should be delayed.
true
if the callable was queued, false
if the queue is full and the callable was not queued.public boolean queueSerial(List<? extends XCallable<?>> callables, long delay)
callables
- callables to be executed by the composite callable.delay
- time, in milliseconds, that the callable should be delayed.
true
if the callables were queued, false
if the queue is full and the callables
were not queued.public void instrument(Instrumentation instr)
instrument
in interface Instrumentable
instr
- instance to instrument the callable queue service to.public Set<XCallable<?>> checkInterrupts(String lockKey)
public void checkInterruptTypes(XCallable<?> callable)
callable
- public void insertCallableIntoInterruptMap(XCallable<?> callable)
callable
- public List<String> getQueueDump()
public List<String> getUniqueDump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |