RPC.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:RDFS 作者:
public Object invoke(Object proxy, Method method, Object[] args)
  throws Throwable {
  final boolean logDebug = LOG.isDebugEnabled();
  long startTime = 0;
  if (logDebug) {
    startTime = System.currentTimeMillis();
  }

  ObjectWritable value = null;
  try {
    value = (ObjectWritable) client.call(new Invocation(method, args),
        getAddress(), protocol, ticket, rpcTimeout);
  } catch (RemoteException re) {
    throw re;
  } catch (ConnectException ce) {
    needCheckDnsUpdate = true;
    throw ce;
  } catch (NoRouteToHostException nrhe) {
    needCheckDnsUpdate = true;
    throw nrhe;
  } catch (PortUnreachableException pue) {
    needCheckDnsUpdate = true;
    throw pue;
  }
  if (logDebug) {
    long callTime = System.currentTimeMillis() - startTime;
    LOG.debug("Call: " + method.getName() + " " + callTime);
  }
  return value.get();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号