Description
In ClientRMProxy#getRMAddress in the else branch we have the following piece of code.
} else { String message = "Unsupported protocol found when creating the proxy " + "connection to ResourceManager: " + ((protocol != null) ? protocol.getClass().getName() : "null"); LOG.error(message); throw new IllegalStateException(message); }
This is wrong, because the protocol variable is of type "Class<?>", so Class.getClass() will be always Object. It should be protocol.getName().
An example of the error message if RMProxy is misused, and this exception is thrown:
java.lang.IllegalStateException: Unsupported protocol found when creating the proxy connection to ResourceManager: java.lang.Class at org.apache.hadoop.yarn.client.ClientRMProxy.getRMAddress(ClientRMProxy.java:109) at org.apache.hadoop.yarn.client.RMProxy.newProxyInstance(RMProxy.java:133) ...
where obviously not a Object.class was provided to this function as protocol parameter.