in src/main/java/org/apache/doris/kafka/connector/service/RestService.java [339:358]
private static Map handleResponse(HttpUriRequest request, Logger logger) {
try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
CloseableHttpResponse response = httpclient.execute(request);
final int statusCode = response.getStatusLine().getStatusCode();
final String reasonPhrase = response.getStatusLine().getReasonPhrase();
if (statusCode == 200 && response.getEntity() != null) {
String responseEntity = EntityUtils.toString(response.getEntity());
return OBJECT_MAPPER.readValue(responseEntity, Map.class);
} else {
throw new SchemaChangeException(
"Failed to schemaChange, status: "
+ statusCode
+ ", reason: "
+ reasonPhrase);
}
} catch (Exception e) {
logger.trace("SchemaChange request error,", e);
throw new SchemaChangeException("SchemaChange request error with " + e.getMessage());
}
}