protected void chooseFirstInRemoteRack ( DatanodeDescriptor localMachine , HashMap < Node , Node > excludedNodes , long blocksize , int maxReplicasPerRack , List < DatanodeDescriptor > results ) throws NotEnoughReplicasException { readLock ( ) ; try { RackRingInfo rackInfo = racksMap . get ( localMachine . getNetworkLocation ( ) ) ; assert ( rackInfo != null ) ; Integer machineId = rackInfo . findNode ( localMachine ) ; assert ( machineId != null ) ; if ( ! chooseRemoteRack ( rackInfo . index , rackInfo . index , rackWindow + 1 , machineId , machineWindow , excludedNodes , blocksize , maxReplicasPerRack , results , false ) ) { LOG . info ( "Couldn't find a Datanode within node group. " + "Resorting to default policy." ) ; super . chooseRemoteRack ( 1 , localMachine , excludedNodes , blocksize , maxReplicasPerRack , results ) ; } } finally { readUnlock ( ) ; } }
Picks up the first replica stored in a remote rack .