@Override public void readFields(DataInput dIn) throws IOException { instanceId = dIn.readUTF(); // Hadoop Configuration has to get its act right int len = dIn.readInt(); byte[] array = new byte[len]; dIn.readFully(array); ByteArrayInputStream bais = new ByteArrayInputStream(array); conf = new XConfiguration(bais); def = new LiteWorkflowApp(); def.readFields(dIn); status = Status.valueOf(dIn.readUTF()); int numExPaths = dIn.readInt(); for (int x = 0; x < numExPaths; x++) { String path = dIn.readUTF(); String nodeName = dIn.readUTF(); boolean isStarted = dIn.readBoolean(); NodeInstance nodeInstance = new NodeInstance(nodeName); nodeInstance.started = isStarted; executionPaths.put(path, nodeInstance); } int numVars = dIn.readInt(); for (int x = 0; x < numVars; x++) { String vName = dIn.readUTF(); String vVal = readBytesAsString(dIn); persistentVars.put(vName, vVal); } refreshLog(); }
public LiteWorkflowInstance(LiteWorkflowApp def, Configuration conf, String instanceId) { this(); this.def = ParamChecker.notNull(def, "def"); this.instanceId = ParamChecker.notNull(instanceId, "instanceId"); this.conf = ParamChecker.notNull(conf, "conf"); refreshLog(); status = Status.PREP; }