本文整理汇总了Java中com.rapidminer.operator.nio.file.RepositoryBlobObject类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryBlobObject类的具体用法?Java RepositoryBlobObject怎么用?Java RepositoryBlobObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryBlobObject类属于com.rapidminer.operator.nio.file包,在下文中一共展示了RepositoryBlobObject类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadInitialData
import com.rapidminer.operator.nio.file.RepositoryBlobObject; //导入依赖的package包/类
/** Loads results from the repository if specified in the {@link ProcessContext}.
* @param firstPort Specifies the first port which is read from the ProcessContext. This
* enables the possibility to skip ports for which input is already specified via
* the input parameter of the run() method.
*/
protected void loadInitialData(int firstPort) throws UserError {
ProcessContext context = getContext();
if (context.getInputRepositoryLocations().isEmpty()) {
return;
}
getLogger().info("Loading initial data" + (firstPort > 0 ? " (starting at port " + (firstPort + 1) + ")" : "") + ".");
for (int i = firstPort; i < context.getInputRepositoryLocations().size(); i++) {
String location = context.getInputRepositoryLocations().get(i);
if (location == null || location.length() == 0) {
getLogger().fine("Input #" + (i + 1) + " not specified.");
} else {
if (i >= rootOperator.getSubprocess(0).getInnerSources().getNumberOfPorts()) {
getLogger().warning("No input port available for process input #" + (i + 1) + ": " + location);
} else {
OutputPort port = rootOperator.getSubprocess(0).getInnerSources().getPortByIndex(i);
RepositoryLocation loc;
try {
loc = resolveRepositoryLocation(location);
} catch (MalformedRepositoryLocationException e1) {
throw e1.makeUserError(rootOperator);
}
try {
Entry entry = loc.locateEntry();
if (entry == null) {
throw new UserError(rootOperator, 312, loc, "Entry " + loc + " does not exist.");
}
if (entry instanceof IOObjectEntry) {
getLogger().info("Assigning " + loc + " to input port " + port.getSpec() + ".");
port.deliver(((IOObjectEntry) entry).retrieveData(null));
} else if (entry instanceof BlobEntry) {
getLogger().info("Assigning " + loc + " to input port " + port.getSpec() + ".");
port.deliver(new RepositoryBlobObject(loc));
} else {
getLogger().info("Cannot assigning " + loc + " to input port " + port.getSpec() + ": Repository location does not reference an IOObject entry.");
throw new UserError(rootOperator, 312, loc, "Not an IOObject entry.");
}
} catch (RepositoryException e) {
throw new UserError(rootOperator, e, 312, loc, e.getMessage());
}
}
}
}
}