【发布时间】:2018-06-20 04:41:56
【问题描述】:
我在最新的 h2o 版本中持续存在 mojos 的问题。该代码在旧版本(3.10)上运行良好
这是一个示例代码和正在抛出的异常。
public static Schema[] getAllSchemas() {
ServiceLoader<Schema> schemaLoader =
ServiceLoader.load(Schema.class);
List<Schema> allSchemas = new ArrayList<>();
for (Schema schema : schemaLoader) {
allSchemas.add(schema);
}
return allSchemas.toArray(new Schema[allSchemas.size()]);
}
public static byte[] extractIce(Model model) throws IOException {
final UUID uuid = UUID.randomUUID();
String tempFile = "/tmp/" + uuid;
model.exportMojo(tempFile, true);
final byte[] bytes = IOUtils.toByteArray(new
FileInputStream(tempFile));
return bytes;
}
public static void main (String []args) {
H2OApp.main();
SchemaServer.registerAllSchemasIfNecessary(getAllSchemas());
// get the model that needs to be persisted
// Model model = getH2OModel();
byte[] extractIce(model);
}
这是被抛出的异常。
Caused by: java.lang.IllegalArgumentException: Cannot find Builder for algo url name drf
at hex.ModelBuilder.ensureBuilderIndex(ModelBuilder.java:141) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at hex.ModelBuilder.havePojo(ModelBuilder.java:120) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at hex.Model.havePojo(Model.java:118) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at water.api.schemas3.ModelSchemaV3.fillFromImpl(ModelSchemaV3.java:73) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at water.api.schemas3.ModelSchemaV3.fillFromImpl(ModelSchemaV3.java:21) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at hex.ModelMojoWriter.writeModelDetails(ModelMojoWriter.java:277) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at hex.ModelMojoWriter.writeTo(ModelMojoWriter.java:178) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at hex.ModelMojoWriter.writeTo(ModelMojoWriter.java:169) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
at hex.ModelMojoWriter.writeTo(ModelMojoWriter.java:161) ~[xyz-platform-all-7.9.0-SNAPSHOT.jar:7.9.0-SNAPSHOT]
【问题讨论】:
标签: h2o