(String language,
String filePath, String funcName,
String outputSchemaString, String schemaLineNumber,
String execType, String isIllustrate)
| 110 | public static final String TURN_ON_OUTPUT_CAPTURING = "TURN_ON_OUTPUT_CAPTURING"; |
| 111 | |
| 112 | public StreamingUDF(String language, |
| 113 | String filePath, String funcName, |
| 114 | String outputSchemaString, String schemaLineNumber, |
| 115 | String execType, String isIllustrate) |
| 116 | throws StreamingUDFOutputSchemaException, ExecException { |
| 117 | this.language = language; |
| 118 | this.filePath = filePath; |
| 119 | this.funcName = funcName; |
| 120 | try { |
| 121 | this.schema = Utils.getSchemaFromString(outputSchemaString); |
| 122 | //ExecTypeProvider.fromString doesn't seem to load the ExecTypes in |
| 123 | //mapreduce mode so we'll try to figure out the exec type ourselves. |
| 124 | if (execType.equals("local")) { |
| 125 | this.execType = ExecType.LOCAL; |
| 126 | } else if (execType.equals("mapreduce")) { |
| 127 | this.execType = ExecType.MAPREDUCE; |
| 128 | } else { |
| 129 | //Not sure what exec type - try to get it from the string. |
| 130 | this.execType = ExecTypeProvider.fromString(execType); |
| 131 | } |
| 132 | } catch (ParserException pe) { |
| 133 | throw new StreamingUDFOutputSchemaException(pe.getMessage(), Integer.valueOf(schemaLineNumber)); |
| 134 | } catch (IOException ioe) { |
| 135 | String errorMessage = "Invalid exectype passed to StreamingUDF. Should be local or mapreduce"; |
| 136 | log.error(errorMessage, ioe); |
| 137 | throw new ExecException(errorMessage, ioe); |
| 138 | } |
| 139 | this.isIllustrate = isIllustrate; |
| 140 | } |
| 141 | |
| 142 | @Override |
| 143 | public Object exec(Tuple input) throws IOException { |
nothing calls this directly
no test coverage detected