@ SuppressWarnings ( "deprecation" ) private void addHDFSFiles ( String jobFileList , Configuration conf ) { DistributedCache . createSymlink ( conf ) ; jobFileList = PasswordManager . getInstance ( this . jobProps ) . readPassword ( jobFileList ) ; for ( String jobFile : SPLITTER . split ( jobFileList ) ) { Path srcJobFile = new Path ( jobFile ) ; // Create a URI that is in the form path#symlink URI srcFileUri = URI . create ( srcJobFile . toUri ( ) . getPath ( ) + "#" + srcJobFile . getName ( ) ) ; LOG . info ( String . format ( "Adding %s to DistributedCache" , srcFileUri ) ) ; // Finally add the file to DistributedCache with a symlink named after the file name DistributedCache . addCacheFile ( srcFileUri , conf ) ; } }
Add non - jar files already on HDFS that the job depends on to DistributedCache .