private HashMap < String , HashSet < Node > > getRackToHostsMapForStripe ( String srcFileName , String parityFileName , int stripeLen , int parityLen , int stripeIndex ) throws IOException { HashMap < String , HashSet < Node > > rackToHosts = new HashMap < String , HashSet < Node > > ( ) ; if ( srcFileName != null ) { rackToHosts = getRackToHostsMapForStripe ( srcFileName , stripeIndex , stripeLen ) ; } if ( parityFileName != null ) { HashMap < String , HashSet < Node > > rackToHostsForParity = getRackToHostsMapForStripe ( parityFileName , stripeIndex , parityLen ) ; for ( Map . Entry < String , HashSet < Node > > e : rackToHostsForParity . entrySet ( ) ) { HashSet < Node > nodes = rackToHosts . get ( e . getKey ( ) ) ; if ( nodes == null ) { nodes = new HashSet < Node > ( ) ; rackToHosts . put ( e . getKey ( ) , nodes ) ; } for ( Node n : e . getValue ( ) ) { nodes . add ( n ) ; } } } for ( Map . Entry < String , HashSet < Node > > e : rackToHosts . entrySet ( ) ) { if ( e . getValue ( ) . size ( ) > 1 ) { FSNamesystem . LOG . warn ( "F4: Rack " + e . getKey ( ) + " being overused for stripe: " + stripeIndex ) ; } } return rackToHosts ; }
reside and the hosts within those racks that host those blocks