Noticed the following in TTimeoutTransport while looking at ACCUMULO-4065:
private static InputStream getInputStream(Socket socket, long timeout) { try { Method m = NetUtils.class.getMethod("getInputStream", Socket.class, Long.TYPE); return (InputStream) m.invoke(null, socket, timeout); } catch (Exception e) { throw new RuntimeException(e); } }
We should really just invoke getMethod once and cache the Method instance instead of repeatedly getting it every time we create a new connection (which is often).
Not sure if this is a "hot" enough code path to have a noticeable performance impact, but it should be good to fix regardless.