@Override public void run(BatchActionContext context) throws Exception { if (!context.isSuccessful()) { return; } FileSet fileSet = context.getDataset(conf.filesetName); Pattern pattern = Pattern.compile(conf.deleteRegex); for (Location fileLocation : fileSet.getBaseLocation().list()) { if (pattern.matcher(fileLocation.getName()).matches()) { fileLocation.delete(); } } }
@Override public void run(BatchActionContext context) throws Exception { Table table = context.getDataset(conf.tableName); for (Map.Entry<String, WorkflowNodeState> entry : context.getNodeStates().entrySet()) { Put put = new Put(entry.getKey()); WorkflowNodeState nodeState = entry.getValue(); put.add("runid", nodeState.getRunId()); put.add("nodeid", nodeState.getNodeId()); put.add("status", nodeState.getNodeStatus().name()); table.put(put); } }