Search in sources :

Example 1 with TGetInfoReq

use of org.apache.hive.service.rpc.thrift.TGetInfoReq in project hive by apache.

the class HiveDatabaseMetaData method getServerInfo.

private TGetInfoResp getServerInfo(TGetInfoType type) throws SQLException {
    TGetInfoReq req = new TGetInfoReq(sessHandle, type);
    TGetInfoResp resp;
    try {
        resp = client.GetInfo(req);
    } catch (TException e) {
        throw new SQLException(e.getMessage(), "08S01", e);
    }
    Utils.verifySuccess(resp.getStatus());
    return resp;
}
Also used : TGetInfoReq(org.apache.hive.service.rpc.thrift.TGetInfoReq) TException(org.apache.thrift.TException) SQLException(java.sql.SQLException) TGetInfoResp(org.apache.hive.service.rpc.thrift.TGetInfoResp)

Example 2 with TGetInfoReq

use of org.apache.hive.service.rpc.thrift.TGetInfoReq in project hive by apache.

the class ThriftCLIServiceClient method getInfo.

/* (non-Javadoc)
   * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List)
   */
@Override
public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) throws HiveSQLException {
    try {
        // FIXME extract the right info type
        TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType());
        TGetInfoResp resp = cliService.GetInfo(req);
        checkStatus(resp.getStatus());
        return new GetInfoValue(resp.getInfoValue());
    } catch (HiveSQLException e) {
        throw e;
    } catch (Exception e) {
        throw new HiveSQLException(e);
    }
}
Also used : TGetInfoReq(org.apache.hive.service.rpc.thrift.TGetInfoReq) GetInfoValue(org.apache.hive.service.cli.GetInfoValue) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TGetInfoResp(org.apache.hive.service.rpc.thrift.TGetInfoResp) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Aggregations

TGetInfoReq (org.apache.hive.service.rpc.thrift.TGetInfoReq)2 TGetInfoResp (org.apache.hive.service.rpc.thrift.TGetInfoResp)2 TException (org.apache.thrift.TException)2 SQLException (java.sql.SQLException)1 GetInfoValue (org.apache.hive.service.cli.GetInfoValue)1 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)1