Search in sources :

Example 1 with ProtocolSignatureProto

use of org.apache.hadoop.ipc.protobuf.ProtocolInfoProtos.ProtocolSignatureProto in project hadoop by apache.

the class RpcClientUtil method convertProtocolSignatureProtos.

private static Map<Long, ProtocolSignature> convertProtocolSignatureProtos(List<ProtocolSignatureProto> protoList) {
    Map<Long, ProtocolSignature> map = new TreeMap<Long, ProtocolSignature>();
    for (ProtocolSignatureProto p : protoList) {
        int[] methods = new int[p.getMethodsList().size()];
        int index = 0;
        for (int m : p.getMethodsList()) {
            methods[index++] = m;
        }
        map.put(p.getVersion(), new ProtocolSignature(p.getVersion(), methods));
    }
    return map;
}
Also used : ProtocolSignatureProto(org.apache.hadoop.ipc.protobuf.ProtocolInfoProtos.ProtocolSignatureProto) TreeMap(java.util.TreeMap)

Aggregations

TreeMap (java.util.TreeMap)1 ProtocolSignatureProto (org.apache.hadoop.ipc.protobuf.ProtocolInfoProtos.ProtocolSignatureProto)1