private TProtocolVersion getMinVersion(TProtocolVersion... versions) {
    TProtocolVersion[] values = TProtocolVersion.values();
    int current = values[values.length - 1].getValue();
    for (TProtocolVersion version : versions) {
      if (current > version.getValue()) {
        current = version.getValue();
      }
    }
    for (TProtocolVersion version : values) {
      if (version.getValue() == current) {
        return version;
      }
    }
    throw new IllegalArgumentException("never");
  }
Create a session handle
@param req
@param res
@return
@throws HiveSQLException
@throws LoginException
@throws IOException
service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java