@Override public void close() throws IOException { super.close(); printer.println(sb.toString()); } };
@Override public void close() throws IOException { super.close(); printer.println(sb.toString()); } };
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(productName, "Must specify productName"); printer.println("hasProduct: Result: " + getClient().hasProduct(productName)); } catch (Exception e) { throw new CmdLineActionException("Failed to check for product '" + productName + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { double wallClockTime = getClient() .getWorkflowCurrentTaskWallClockMinutes(instanceId); printer.println(wallClockTime + " minutes"); } catch (Exception e) { throw new CmdLineActionException( "Failed to get current workflow instance's " + "currents tasks wall clock time : " + e.getMessage(), e); } }
public void println(String message) { print(message); println(); }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(nodeId, "Must specify nodeId"); getClient().removeNode(nodeId); printer.println("Successfully removed node!"); } catch (Exception e) { throw new CmdLineActionException("Failed to remove node with id '" + nodeId + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(jobId, "Must specify jobId"); String execNode = getClient().getExecutionNode(jobId); printer.println("Executing node: " + execNode); } catch (Exception e) { throw new CmdLineActionException("Failed to get execution node for" + " job '" + jobId + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(nodeId, "Must specify nodeId"); String result = getClient().getNodeLoad(nodeId); printer.println("Load for node '" + nodeId + "': " + result); } catch (Exception e) { throw new CmdLineActionException("Failed to get node load for node '" + nodeId + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { Validate.notNull(eventName, "Must specify eventName"); try (WorkflowManagerClient client = getClient()) { printer.print("Sending event '" + eventName + "'... "); printer.println(client.sendEvent(eventName, metadata) ? "SUCCESS" : "FAILURE"); } catch (Exception e) { throw new CmdLineActionException("Failed to send event '" + eventName + "' to url '" + getUrl() + "' with metadata '" + metadata.getMap() + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull("Must specify queueName"); getClient().removeQueue(queueName); printer.println("Successfully removed queue!"); } catch (Exception e) { throw new CmdLineActionException("Failed to remove queue with name '" + queueName + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(queueName, "Must specify queueName"); getClient().addQueue(queueName); printer.println("Successfully added queue!"); } catch (Exception e) { throw new CmdLineActionException("Failed to add queue with name '" + queueName + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(nodeId, "Must specify nodeId"); String result = getClient().getNodeLoad(nodeId); printer.println("Load for node '" + nodeId + "': " + result); } catch (Exception e) { throw new CmdLineActionException("Failed to get node load for node '" + nodeId + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(nodeId, "Must specify nodeId"); getClient().removeNode(nodeId); printer.println("Successfully removed node!"); } catch (Exception e) { throw new CmdLineActionException("Failed to remove node with id '" + nodeId + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(jobId, "Must specify jobId"); String execNode = getClient().getExecutionNode(jobId); printer.println("Executing node: " + execNode); } catch (Exception e) { throw new CmdLineActionException("Failed to get execution node for" + " job '" + jobId + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(nodeId, "Must specify nodeId"); Validate.notNull(capacity, "Must specify capacity"); getClient().setNodeCapacity(nodeId, capacity); printer.println("Successfully set node capacity!"); } catch (Exception e) { throw new CmdLineActionException("", e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(nodeId, "Must specify nodeId"); ResourceNode node = getClient().getNodeById(nodeId); printer.println("node: [id=" + node.getNodeId() + ",capacity=" + node.getCapacity() + ",url=" + node.getIpAddr() + "]"); } catch (Exception e) { throw new CmdLineActionException("Failed to get node by id '" + nodeId + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(nodeId, "Must specify nodeId"); Validate.notNull(capacity, "Must specify capacity"); getClient().setNodeCapacity(nodeId, capacity); printer.println("Successfully set node capacity!"); } catch (Exception e) { throw new CmdLineActionException("", e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull(queueName, "Must specify queueName"); getClient().addQueue(queueName); printer.println("Successfully added queue!"); } catch (Exception e) { throw new CmdLineActionException("Failed to add queue with name '" + queueName + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try { Validate.notNull("Must specify queueName"); getClient().removeQueue(queueName); printer.println("Successfully removed queue!"); } catch (Exception e) { throw new CmdLineActionException("Failed to remove queue with name '" + queueName + "' : " + e.getMessage(), e); } }
@Override public void execute(ActionMessagePrinter printer) throws CmdLineActionException { try (WorkflowManagerClient client = getClient()) { double wallClockTime = client.getWorkflowWallClockMinutes(instanceId); printer.println(wallClockTime + " minutes"); } catch (Exception e) { throw new CmdLineActionException( "Failed to get wall clock time for instance '" + instanceId + "' : " + e.getMessage(), e); } }