@Override public Collection<IgfsPath> call() throws Exception { if (log.isDebugEnabled()) log.debug("List directory: " + path); IgfsMode mode = resolveMode(path); Collection<IgfsPath> files = new HashSet<>(); if (mode != PRIMARY) { assert secondaryFs != null; try { Collection<IgfsPath> children = secondaryFs.listPaths(path); files.addAll(children); if (mode == PROXY || !modeRslvr.hasPrimaryChild(path)) return files; } catch (Exception e) { U.error(log, "List paths in DUAL mode failed [path=" + path + ']', e); throw e; } } IgfsEntryInfo info = primaryInfoForListing(path); if (info != null) { // Perform the listing. for (String child : info.listing().keySet()) files.add(new IgfsPath(path, child)); } else if (mode == PRIMARY) throw new IgfsPathNotFoundException("Failed to list paths (path not found): " + path); return files; } });
if (mode == PROXY || !modeRslvr.hasPrimaryChild(path)) return files;
@Override public Collection<IgfsPath> call() throws Exception { if (log.isDebugEnabled()) log.debug("List directory: " + path); IgfsMode mode = resolveMode(path); Collection<IgfsPath> files = new HashSet<>(); if (mode != PRIMARY) { assert secondaryFs != null; try { Collection<IgfsPath> children = secondaryFs.listPaths(path); files.addAll(children); if (mode == PROXY || !modeRslvr.hasPrimaryChild(path)) return files; } catch (Exception e) { U.error(log, "List paths in DUAL mode failed [path=" + path + ']', e); throw e; } } IgfsEntryInfo info = primaryInfoForListing(path); if (info != null) { // Perform the listing. for (String child : info.listing().keySet()) files.add(new IgfsPath(path, child)); } else if (mode == PRIMARY) throw new IgfsPathNotFoundException("Failed to list paths (path not found): " + path); return files; } });
if (mode == PROXY || !modeRslvr.hasPrimaryChild(path)) return files;