@ Deprecated public DatanodeDescriptor getDatanodeByName ( String name ) { if ( name == null ) { return null ; } int colon = name . indexOf ( ":" ) ; String host ; if ( colon < 0 ) { host = name ; } else { host = name . substring ( 0 , colon ) ; } hostmapLock . readLock ( ) . lock ( ) ; try { DatanodeDescriptor [ ] nodes = map . get ( host ) ; // no entry if ( nodes == null ) { return null ; } for ( DatanodeDescriptor containedNode : nodes ) { if ( name . equals ( containedNode . getName ( ) ) ) { return containedNode ; } } return null ; } finally { hostmapLock . readLock ( ) . unlock ( ) ; } }
Find data node by its name .