本文学习如何将远程调用的输入参数和输出返回值的序列化格式,代码描述参考 http://blog.csdn.net/tragicjun/article/details/8963129
org.apache.hadoop.ipc.Client有如下方法:
public Writable call(Writable param, ConnectionId remoteId)
org.apache.hadoop.ipc.Server有如下方法:
public abstract Writable call(Class<?> protocol, Writable param, long receivedTime)
显然,从RPC Client和Server的角度看,远程调用的输入参数和输出返回值都是Writable,其中输入参数的Writable是org.apache.hadoop.ipc.RPC.Invocation,而输出返回值的Writable是org.apache.hadoop.io.ObjectWritable。下图分别展示了