use of org.apache.hive.service.rpc.thrift.TSetClientInfoReq in project hive by apache.
the class ThriftCLIServiceClient method setApplicationName.
@Override
public void setApplicationName(SessionHandle sh, String value) throws HiveSQLException {
try {
TSetClientInfoReq req = new TSetClientInfoReq(sh.toTSessionHandle());
req.putToConfiguration("ApplicationName", value);
TSetClientInfoResp resp = cliService.SetClientInfo(req);
checkStatus(resp.getStatus());
} catch (TException e) {
throw new HiveSQLException(e);
}
}
use of org.apache.hive.service.rpc.thrift.TSetClientInfoReq in project hive by apache.
the class HiveConnection method sendClientInfo.
private void sendClientInfo() throws SQLClientInfoException {
TSetClientInfoReq req = new TSetClientInfoReq(sessHandle);
Map<String, String> map = new HashMap<>();
if (clientInfo != null) {
for (Entry<Object, Object> e : clientInfo.entrySet()) {
if (e.getKey() == null || e.getValue() == null)
continue;
map.put(e.getKey().toString(), e.getValue().toString());
}
}
req.setConfiguration(map);
try {
TSetClientInfoResp openResp = client.SetClientInfo(req);
Utils.verifySuccess(openResp.getStatus());
} catch (TException | SQLException e) {
LOG.error("Error sending client info", e);
throw new SQLClientInfoException("Error sending client info", null, e);
}
}
Aggregations