public Node getNode ( String name ) { Node n = hostnameToNodeMap . get ( name ) ; // it's ok if multiple threads try to resolve the same host at the same time // the assumption is that resolve() will return a canonical node object and // the put operation is therefore idempotent if ( n == null ) { n = resolveAndGetNode ( name ) ; hostnameToNodeMap . put ( name , n ) ; // Make an entry for the node at the max level in the cache nodesAtMaxLevel . add ( getParentNode ( n , NetworkTopology . DEFAULT_HOST_LEVEL - 1 ) ) ; } return n ; }
Return the Node in the network topology that corresponds to the hostname