use of org.apache.zeppelin.resource.ResourceSet in project SSM by Intel-bigdata.
the class ApplicationLoader method findRequiredResourceSet.
static ResourceSet findRequiredResourceSet(String[][] requiredResources, String noteId, String paragraphId, ResourceSet resources) {
ResourceSet args = new ResourceSet();
if (requiredResources == null || requiredResources.length == 0) {
return args;
}
resources = resources.filterByNoteId(noteId).filterByParagraphId(paragraphId);
for (String[] requires : requiredResources) {
args.clear();
for (String require : requires) {
boolean found = false;
for (Resource r : resources) {
if (require.startsWith(":") && r.getClassName().equals(require.substring(1))) {
found = true;
} else if (r.getResourceId().getName().equals(require)) {
found = true;
}
if (found) {
args.add(r);
break;
}
}
if (found == false) {
break;
}
}
if (args.size() == requires.length) {
return args;
}
}
return null;
}
Aggregations