@Override public void doPolling(Guid cmdId, List<Guid> childCmdIds) { boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { switch (CommandCoordinatorUtil.getCommandStatus(childCmdId)) { case ACTIVE: log.info("Waiting on Live Merge child commands to complete"); return; case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: break; } } RemoveSnapshotCommand<RemoveSnapshotParameters> command = getCommand(cmdId); command.getParameters().setTaskGroupSuccess(!anyFailed); command.setCommandStatus(anyFailed ? CommandStatus.FAILED : CommandStatus.SUCCEEDED); log.info( "All Live Merge child commands have completed, status '{}'", command.getCommandStatus()); }
private void endAction(Guid commandId, boolean succeeded) { RemoveSnapshotCommand<RemoveSnapshotParameters> command = getCommand(commandId); command.endAction(); CommandCoordinatorUtil.removeAllCommandsInHierarchy(commandId); ExecutionHandler.endJob(command.getExecutionContext(), succeeded); }