public void copy ( List < FastFileCopyRequest > requests ) throws Exception { List < Future < CopyResult >> results = new ArrayList < Future < CopyResult > > ( ) ; for ( FastFileCopyRequest r : requests ) { Callable < CopyResult > fastFileCopy = new FastFileCopy ( r . getSrc ( ) , r . getDestination ( ) , r . srcFs , r . dstFs ) ; Future < CopyResult > f = executor . submit ( fastFileCopy ) ; results . add ( f ) ; } for ( Future < CopyResult > f : results ) { f . get ( ) ; } }
Performs fast copy for a list of fast file copy requests . Uses a thread pool to perform fast file copy in parallel .