this.lookupInterval = lookupInterval;
}
@Override
public void run() {
LockToken lock = null;
// first check if there is some other running instance from the same service;
try {
lock = Services.get().get(MemoryLocksService.class)
.getWriteLock(CoordMaterializeTriggerService.class.getName(), lockTimeout);
if (lock != null) {
runCoordJobMatLookup();
if (null != callables) {
boolean ret = Services.get().get(CallableQueueService.class).queueSerial(callables);
if (ret == false) {
XLog.getLog(getClass()).warn(
"Unable to queue the callables commands for CoordMaterializeTriggerRunnable. "
+ "Most possibly command queue is full. Queue size is :"
+ Services.get().get(CallableQueueService.class).queueSize());
}
callables = null;
}
if (null != delayedCallables) {
boolean ret = Services.get().get(CallableQueueService.class)
.queueSerial(delayedCallables, this.delay);
if (ret == false) {
XLog.getLog(getClass()).warn(
"Unable to queue the delayedCallables commands for CoordMaterializeTriggerRunnable. "
+ "Most possibly Callable queue is full. Queue size is :"
+ Services.get().get(CallableQueueService.class).queueSize());
}
delayedCallables = null;
this.delay = 0;
}
}
else {
LOG.debug("Can't obtain lock, skipping");
}
}
catch (Exception e) {
LOG.error("Exception", e);
}
finally {
if (lock != null) {
lock.release();
LOG.info("Released lock for [{0}]", CoordMaterializeTriggerService.class.getName());
}
}