use of org.apache.sysml.runtime.instructions.cp.SpoofCPInstruction in project incubator-systemml by apache.
the class ProgramConverter method serializeInstructions.
@SuppressWarnings("all")
private static String serializeInstructions(ArrayList<Instruction> inst, HashMap<String, byte[]> clsMap) throws DMLRuntimeException {
StringBuilder sb = new StringBuilder();
int count = 0;
for (Instruction linst : inst) {
//check that only cp instruction are transmitted
if (!(linst instanceof CPInstruction || linst instanceof ExternalFunctionInvocationInstruction))
throw new DMLRuntimeException(NOT_SUPPORTED_MR_INSTRUCTION + " " + linst.getClass().getName() + "\n" + linst);
//obtain serialized version of generated classes
if (linst instanceof SpoofCPInstruction) {
Class<?> cla = ((SpoofCPInstruction) linst).getOperatorClass();
clsMap.put(cla.getName(), CodegenUtils.getClassData(cla.getName()));
}
if (count > 0)
sb.append(ELEMENT_DELIM);
sb.append(checkAndReplaceLiterals(linst.toString()));
count++;
}
return sb.toString();
}
Aggregations