question: public static ArrayList < String > exportResultVariables ( long workerID , LocalVariableMap vars , ArrayList < String > resultVars ) throws DMLRuntimeException , IOException { ArrayList < String > ret = new ArrayList < String > ( ) ; for ( String rvar : resultVars ) { Data dat = vars . get ( rvar ) ; if ( dat != null && dat . getDataType ( ) == DataType . MATRIX ) { MatrixObject mo = ( MatrixObject ) dat ; if ( mo . isDirty ( ) ) { mo . exportData ( ) ; ret . add ( ProgramConverter . serializeDataObject ( rvar , mo ) ) ; } } } return ret ; }
target:  For remote Spark parfor workers. This is a simplified version compared to MR.