use of org.apache.zeppelin.resource.Resource in project zeppelin by apache.
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;
}
use of org.apache.zeppelin.resource.Resource in project zeppelin by apache.
the class TableDataProxy method rows.
@Override
public Iterator<Row> rows() {
String resourceName = resource.getResourceId().getName() + ".rows";
Resource rows = resource.invokeMethod("rows", null, null, resourceName);
ProxyRowIterator it = new ProxyRowIterator(rows);
return it;
}
Aggregations