- public void exception(AsyncReadGraph returnGraph, Throwable t) {
- try {
- procedure.exception(parentGraph, t);
- } catch (Throwable t2) {
- LOGGER.error("computeForEach procedure.exception failed", t2);
+ public void run(int thread) {
+ if(needsToBlock) proc.waitBarrier();
+ if(proc.isDone()) {
+ try {
+ result = (T)proc.get();
+ if(procedure != null) procedure.execute(graph, result);
+ } catch (DatabaseException e) {
+ if(procedure != null) procedure.exception(graph, e);
+ exception = e;
+ } catch (Throwable t) {
+ DatabaseException dbe = new DatabaseException(t);
+ if(procedure != null) procedure.exception(graph, dbe);
+ exception = dbe;
+ } finally {
+ if (entry != null)
+ entry.performFromCache(queryGraph, procedure_);
+ }
+ } else {
+ graph.processor.schedule(this);