Search in sources :

Example 6 with EHadoopFileTypes

use of org.talend.designer.hdfsbrowse.model.EHadoopFileTypes in project tbd-studio-se by Talend.

the class HDFSFileSelectorForm method fetchChildren.

private long fetchChildren(IHDFSNode node, IProgressMonitor monitor) {
    if (monitor != null && monitor.isCanceled()) {
        return 0;
    }
    node.forceFetchChildren();
    long nodeSize = 0;
    EHadoopFileTypes type = node.getType();
    if (type == EHadoopFileTypes.FILE) {
        nodeSize++;
    }
    List<IHDFSNode> children = node.getChildren();
    if (monitor != null && monitor.isCanceled()) {
        return 0;
    }
    if (children != null) {
        for (IHDFSNode child : children) {
            nodeSize += fetchChildren(child, monitor);
        }
    }
    return nodeSize;
}
Also used : EHadoopFileTypes(org.talend.designer.hdfsbrowse.model.EHadoopFileTypes) IHDFSNode(org.talend.designer.hdfsbrowse.model.IHDFSNode)

Aggregations

EHadoopFileTypes (org.talend.designer.hdfsbrowse.model.EHadoopFileTypes)6 IHDFSNode (org.talend.designer.hdfsbrowse.model.IHDFSNode)6 TreeItem (org.eclipse.swt.widgets.TreeItem)3 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 SearchPattern (org.eclipse.ui.dialogs.SearchPattern)1 HDFSFile (org.talend.designer.hdfsbrowse.model.HDFSFile)1