public static Set < String > getNodeHosts ( YarnClient yarnClient ) throws YarnException , IOException { ImmutableSet . Builder < String > nodeHosts = ImmutableSet . builder ( ) ; for ( NodeReport runningNode : yarnClient . getNodeReports ( USABLE_NODE_STATES ) ) { nodeHosts . add ( runningNode . getNodeId ( ) . getHost ( ) ) ; } return nodeHosts . build ( ) ; }
Returns the host names for all nodes in yarnClient s YARN cluster .