/** * If the failure failed before submitting it, we may want to give back the * same error to the requests with the same nonceKey. * * @param nonceKey A unique identifier for this operation from the client or process * @param procName name of the procedure, used to inform the user * @param procOwner name of the owner of the procedure, used to inform the user * @param exception the failure to report to the user */ public void setFailureResultForNonce(NonceKey nonceKey, String procName, User procOwner, IOException exception) { if (nonceKey == null) { return; } Long procId = nonceKeysToProcIdsMap.get(nonceKey); if (procId == null || completed.containsKey(procId)) { return; } Procedure<TEnvironment> proc = new FailedProcedure<>(procId.longValue(), procName, procOwner, nonceKey, exception); completed.putIfAbsent(procId, new CompletedProcedureRetainer<>(proc)); }
private void procedureFinished(Procedure<TEnvironment> proc) { // call the procedure completion cleanup handler execCompletionCleanup(proc); CompletedProcedureRetainer<TEnvironment> retainer = new CompletedProcedureRetainer<>(proc); // update the executor internal state maps if (!proc.shouldWaitClientAck(getEnvironment())) { retainer.setClientAckTime(0); } completed.put(proc.getProcId(), retainer); rollbackStack.remove(proc.getProcId()); procedures.remove(proc.getProcId()); // call the runnableSet completion cleanup handler try { scheduler.completionCleanup(proc); } catch (Throwable e) { // Catch NullPointerExceptions or similar errors... LOG.error("CODE-BUG: uncatched runtime exception for completion cleanup: {}", proc, e); } // Notify the listeners sendProcedureFinishedNotification(proc.getProcId()); }
completed.put(proc.getProcId(), new CompletedProcedureRetainer<>(proc)); LOG.debug("Completed {}", proc); } else {
/** * If the failure failed before submitting it, we may want to give back the * same error to the requests with the same nonceKey. * * @param nonceKey A unique identifier for this operation from the client or process * @param procName name of the procedure, used to inform the user * @param procOwner name of the owner of the procedure, used to inform the user * @param exception the failure to report to the user */ public void setFailureResultForNonce(NonceKey nonceKey, String procName, User procOwner, IOException exception) { if (nonceKey == null) { return; } Long procId = nonceKeysToProcIdsMap.get(nonceKey); if (procId == null || completed.containsKey(procId)) { return; } Procedure<TEnvironment> proc = new FailedProcedure<>(procId.longValue(), procName, procOwner, nonceKey, exception); completed.putIfAbsent(procId, new CompletedProcedureRetainer<>(proc)); }
private void procedureFinished(Procedure<TEnvironment> proc) { // call the procedure completion cleanup handler execCompletionCleanup(proc); CompletedProcedureRetainer<TEnvironment> retainer = new CompletedProcedureRetainer<>(proc); // update the executor internal state maps if (!proc.shouldWaitClientAck(getEnvironment())) { retainer.setClientAckTime(0); } completed.put(proc.getProcId(), retainer); rollbackStack.remove(proc.getProcId()); procedures.remove(proc.getProcId()); // call the runnableSet completion cleanup handler try { scheduler.completionCleanup(proc); } catch (Throwable e) { // Catch NullPointerExceptions or similar errors... LOG.error("CODE-BUG: uncatched runtime exception for completion cleanup: {}", proc, e); } // Notify the listeners sendProcedureFinishedNotification(proc.getProcId()); }
completed.put(proc.getProcId(), new CompletedProcedureRetainer<>(proc)); LOG.debug("Completed {}", proc); } else {