use of org.apache.hadoop.ipc.protobuf.ProtocolInfoProtos.GetProtocolVersionsResponseProto in project hadoop by apache.
the class ProtocolMetaInfoServerSideTranslatorPB method getProtocolVersions.
@Override
public GetProtocolVersionsResponseProto getProtocolVersions(RpcController controller, GetProtocolVersionsRequestProto request) throws ServiceException {
String protocol = request.getProtocol();
GetProtocolVersionsResponseProto.Builder builder = GetProtocolVersionsResponseProto.newBuilder();
for (RPC.RpcKind r : RPC.RpcKind.values()) {
long[] versions;
try {
versions = getProtocolVersionForRpcKind(r, protocol);
} catch (ClassNotFoundException e) {
throw new ServiceException(e);
}
ProtocolVersionProto.Builder b = ProtocolVersionProto.newBuilder();
if (versions != null) {
b.setRpcKind(r.toString());
for (long v : versions) {
b.addVersions(v);
}
}
builder.addProtocolVersions(b.build());
}
return builder.build();
}
Aggregations