use of com.lmax.disruptor.TimeoutException in project jstorm by alibaba.
the class TaskReceiver method deserializer.
public boolean deserializer(KryoTupleDeserializer deserializer, boolean forceConsume) {
//LOG.debug("start Deserializer of task, {}", taskId);
boolean isIdling = true;
DisruptorQueue exeQueue = innerTaskTransfer.get(taskId);
if (!taskStatus.isShutdown()) {
if ((deserializeQueue.population() > 0 && exeQueue.pctFull() < 1.0) || forceConsume) {
try {
List<Object> objects = deserializeQueue.retreiveAvailableBatch();
for (Object object : objects) {
deserialize(deserializer, (byte[]) object, exeQueue);
}
isIdling = false;
} catch (InterruptedException e) {
LOG.error("InterruptedException " + e.getCause());
return isIdling;
} catch (TimeoutException e) {
return isIdling;
} catch (Throwable e) {
if (Utils.exceptionCauseIsInstanceOf(KryoException.class, e)) {
throw new RuntimeException(e);
} else if (!taskStatus.isShutdown()) {
LOG.error("Unknow exception ", e);
}
}
}
} else {
task.unregisterDeserializeQueue();
}
return isIdling;
}
Aggregations