public boolean addSourceFile ( FileSystem fs , PolicyInfo info , FileStatus src , RaidState . Checker checker , long now , int targetReplication ) throws IOException { List < FileStatus > lfs = RaidNode . listDirectoryRaidFileStatus ( fs . getConf ( ) , fs , src . getPath ( ) ) ; if ( lfs == null ) { return false ; } RaidState state = checker . check ( info , src , now , false , lfs ) ; Counters counters = stateToSourceCounters . get ( state ) ; counters . inc ( lfs ) ; if ( state == RaidState . RAIDED ) { long paritySize = computeParitySize ( lfs , targetReplication ) ; estimatedParitySize += paritySize ; estimatedDoneParitySize += paritySize ; estimatedDoneSourceSize += DirectoryStripeReader . getDirPhysicalSize ( lfs ) ; return false ; } if ( state == RaidState . NOT_RAIDED_BUT_SHOULD ) { estimatedDoneParitySize += computeParitySize ( lfs , targetReplication ) ; estimatedDoneSourceSize += DirectoryStripeReader . getDirPhysicalSize ( lfs ) ; return true ; } return false ; }
Collect the statistics of a source directory . Return true if the file should be raided but not .