use of org.apache.hive.service.rpc.thrift.TGetInfoResp 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;
}
use of org.apache.hive.service.rpc.thrift.TGetInfoResp in project hive by apache.
the class HiveDatabaseMetaData method getDatabaseProductVersion.
public String getDatabaseProductVersion() throws SQLException {
if (dbVersion != null) {
//lazy-caching of the version.
return dbVersion;
}
TGetInfoResp resp = getServerInfo(GetInfoType.CLI_DBMS_VER.toTGetInfoType());
this.dbVersion = resp.getInfoValue().getStringValue();
return dbVersion;
}
use of org.apache.hive.service.rpc.thrift.TGetInfoResp 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);
}
}
use of org.apache.hive.service.rpc.thrift.TGetInfoResp in project hive by apache.
the class ThriftCLIService method GetInfo.
@Override
public TGetInfoResp GetInfo(TGetInfoReq req) throws TException {
TGetInfoResp resp = new TGetInfoResp();
try {
GetInfoValue getInfoValue = cliService.getInfo(new SessionHandle(req.getSessionHandle()), GetInfoType.getGetInfoType(req.getInfoType()));
resp.setInfoValue(getInfoValue.toTGetInfoValue());
resp.setStatus(OK_STATUS);
} catch (Exception e) {
LOG.warn("Error getting info: ", e);
resp.setStatus(HiveSQLException.toTStatus(e));
}
return resp;
}
Aggregations