public static short getCompatibleResponseVersion(short requestVersion) {
    switch (requestVersion) {
      case ReplicaMetadataRequest.Replica_Metadata_Request_Version_V1:
        return REPLICA_METADATA_RESPONSE_VERSION_V_5;
      case ReplicaMetadataRequest.Replica_Metadata_Request_Version_V2:
        return REPLICA_METADATA_RESPONSE_VERSION_V_6;
      default:
        throw new IllegalArgumentException("Invalid replica metadata request version: " + requestVersion
            + " No compatible replica metadata response version found");
    }
  }
Get the compatible response version for the given request version.
@param requestVersion for which to get the compatible response version.
@return compatible responseVersion
ambry-protocol/src/main/java/com/github/ambry/protocol/ReplicaMetadataResponse.java