Source:
void run(@Nonnull IWorkflow workflow, int actionRetry) { CorfuRuntime rt = null; try { getRuntime.get().invalidateLayout(); Layout currLayout = getRuntime.get().getLayoutView().getLayout(); List<NodeLocator> servers = currLayout.getAllActiveServers().stream() .map(NodeLocator::parseString) .collect(Collectors.toList()); CorfuRuntimeParameters params = serverContext.getManagementRuntimeParameters(); params.setCacheDisabled(true); params.setUseFastLoader(false); params.setLayoutServers(servers); rt = CorfuRuntime.fromParameters(params).connect(); log.info("run: Started workflow id {}", workflow.getName(), workflow.getId()); long workflowStart = System.currentTimeMillis(); for (Action action : workflow.getActions()) { log.debug("run: Started action for workflow {}", action.getName(), workflow.getId()); long actionStart = System.currentTimeMillis(); if(action instanceof RestoreAction){ ((RestoreAction) action).execute(rt, streamLog, actionRetry); } else{ action.execute(rt, actionRetry); } long actionEnd = System.currentTimeMillis(); log.info("run: finished action for workflow in ms", action.getName(), workflow.getId(), actionEnd - actionStart); if (action.getStatus() != ActionStatus.COMPLETED) { log.error("run: Failed to execute action for workflow {}, status {}, ", action.getName(), workflow.getId(), action.getStatus()); return; } } long workflowEnd = System.currentTimeMillis(); log.info("run: Completed workflow in ms", workflow.getId(), workflowEnd - workflowStart); } catch (Exception e) { log.error("run: Encountered an error while running workflow {}", workflow.getId(), e); } finally { activeWorkflows.remove(workflow.getId()); log.debug("run: removed from {}", workflow.getId(), activeWorkflows); if (rt != null) { rt.shutdown(); } } }

Target:
void run(@Nonnull IWorkflow workflow, int actionRetry) { CorfuRuntime rt = null; try { getRuntime.get().invalidateLayout(); Layout currLayout = getRuntime.get().getLayoutView().getLayout(); List<NodeLocator> servers = currLayout.getAllActiveServers().stream() .map(NodeLocator::parseString) .collect(Collectors.toList()); CorfuRuntimeParameters params = serverContext.getManagementRuntimeParameters(); params.setCacheDisabled(true); params.setLayoutServers(servers); rt = CorfuRuntime.fromParameters(params).connect(); log.info("run: Started workflow id {}", workflow.getName(), workflow.getId()); long workflowStart = System.currentTimeMillis(); for (Action action : workflow.getActions()) { log.debug("run: Started action for workflow {}", action.getName(), workflow.getId()); long actionStart = System.currentTimeMillis(); action.execute(rt, actionRetry); long actionEnd = System.currentTimeMillis(); log.info("run: finished action for workflow in ms", action.getName(), workflow.getId(), actionEnd - actionStart); if (action.getStatus() != ActionStatus.COMPLETED) { log.error("run: Failed to execute action for workflow {}, status {}, ", action.getName(), workflow.getId(), action.getStatus()); return; } } long workflowEnd = System.currentTimeMillis(); log.info("run: Completed workflow in ms", workflow.getId(), workflowEnd - workflowStart); } catch (Exception e) { log.error("run: Encountered an error while running workflow {}", workflow.getId(), e); } finally { activeWorkflows.remove(workflow.getId()); log.debug("run: removed from {}", workflow.getId(), activeWorkflows); if (rt != null) { rt.shutdown(); } } }