/** * Finds all files read by the table and generates CopyableFiles. * For the specific semantics see {@link HiveCopyEntityHelper#getCopyEntities}. */ @Override public Iterator<FileSet<CopyEntity>> getFileSetIterator(FileSystem targetFs, CopyConfiguration configuration, Comparator<FileSet<CopyEntity>> prioritizer, PushDownRequestor<FileSet<CopyEntity>> requestor) throws IOException { if (!canCopyTable()) { return Iterators.emptyIterator(); } try { List<FileSet<CopyEntity>> fileSetList = Lists.newArrayList(new HiveCopyEntityHelper(this, configuration, targetFs) .getCopyEntities(configuration, prioritizer, requestor)); Collections.sort(fileSetList, prioritizer); return fileSetList.iterator(); } catch (IOException ioe) { log.error("Failed to copy table " + this.table, ioe); return Iterators.emptyIterator(); } }
@Override public Iterator<FileSet<CopyEntity>> getFileSetIterator(FileSystem targetFs, CopyConfiguration configuration) throws IOException { if (!canCopyTable()) { return Iterators.emptyIterator(); } try { return new HiveCopyEntityHelper(this, configuration, targetFs).getCopyEntities(configuration); } catch (IOException ioe) { log.error("Failed to copy table " + this.table, ioe); return Iterators.emptyIterator(); } }
/** * Finds all files read by the table and generates CopyableFiles. * For the specific semantics see {@link HiveCopyEntityHelper#getCopyEntities}. */ @Override public Iterator<FileSet<CopyEntity>> getFileSetIterator(FileSystem targetFs, CopyConfiguration configuration, Comparator<FileSet<CopyEntity>> prioritizer, PushDownRequestor<FileSet<CopyEntity>> requestor) throws IOException { if (!canCopyTable()) { return Iterators.emptyIterator(); } try { List<FileSet<CopyEntity>> fileSetList = Lists.newArrayList(new HiveCopyEntityHelper(this, configuration, targetFs) .getCopyEntities(configuration, prioritizer, requestor)); Collections.sort(fileSetList, prioritizer); return fileSetList.iterator(); } catch (IOException ioe) { log.error("Failed to copy table " + this.table, ioe); return Iterators.emptyIterator(); } }
@Override public Iterator<FileSet<CopyEntity>> getFileSetIterator(FileSystem targetFs, CopyConfiguration configuration) throws IOException { if (!canCopyTable()) { return Iterators.emptyIterator(); } try { return new HiveCopyEntityHelper(this, configuration, targetFs).getCopyEntities(configuration); } catch (IOException ioe) { log.error("Failed to copy table " + this.table, ioe); return Iterators.emptyIterator(); } }