class org.apache.helix.rest.client.CustomRestClientImpl extends java.lang.Object implements org.apache.helix.rest.client.CustomRestClient
{
private static final org.slf4j.Logger LOG;
private static final java.lang.String INSTANCE_HEALTH_STATUS;
private static final java.lang.String PARTITION_HEALTH_STATUS;
private static final java.lang.String IS_HEALTHY_FIELD;
private static final java.lang.String PARTITIONS;
private static final java.lang.String ACCEPT_CONTENT_TYPE;
private static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER;
private org.apache.http.client.HttpClient _httpClient;
public void <init>(org.apache.http.client.HttpClient)
{
org.apache.http.client.HttpClient v;
org.apache.helix.rest.client.CustomRestClientImpl v;
v := @this: org.apache.helix.rest.client.CustomRestClientImpl;
v := @parameter: org.apache.http.client.HttpClient;
specialinvoke v.<java.lang.Object: void <init>()>();
v.<org.apache.helix.rest.client.CustomRestClientImpl: org.apache.http.client.HttpClient _httpClient> = v;
return;
}
public java.util.Map getInstanceStoppableCheck(java.lang.String, java.util.Map) throws java.io.IOException
{
org.apache.helix.rest.client.CustomRestClientImpl v;
org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter v;
java.util.Map v, v, v;
org.apache.http.HttpResponse v;
java.lang.String v, v;
v := @this: org.apache.helix.rest.client.CustomRestClientImpl;
v := @parameter: java.lang.String;
v := @parameter: java.util.Map;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u0001/instanceHealthStatus");
v = staticinvoke <org.apache.helix.rest.client.CustomRestClientImpl$lambda_getInstanceStoppableCheck_1__1: org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter bootstrap$()>();
v = staticinvoke <java.util.Collections: java.util.Map unmodifiableMap(java.util.Map)>(v);
v = virtualinvoke v.<org.apache.helix.rest.client.CustomRestClientImpl: org.apache.http.HttpResponse post(java.lang.String,java.util.Map)>(v, v);
v = specialinvoke v.<org.apache.helix.rest.client.CustomRestClientImpl: java.util.Map handleResponse(org.apache.http.HttpResponse,org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter)>(v, v);
return v;
}
public java.util.Map getPartitionStoppableCheck(java.lang.String, java.util.List, java.util.Map) throws java.io.IOException
{
java.util.HashMap v;
org.apache.helix.rest.client.CustomRestClientImpl v;
org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter v;
java.util.List v;
java.util.Map v, v;
org.apache.http.HttpResponse v;
java.lang.String v, v;
v := @this: org.apache.helix.rest.client.CustomRestClientImpl;
v := @parameter: java.lang.String;
v := @parameter: java.util.List;
v := @parameter: java.util.Map;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u0001/partitionHealthStatus");
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>(java.util.Map)>(v);
if v == null goto label;
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>("partitions", v);
label:
v = staticinvoke <org.apache.helix.rest.client.CustomRestClientImpl$lambda_getPartitionStoppableCheck_3__2: org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter bootstrap$()>();
v = virtualinvoke v.<org.apache.helix.rest.client.CustomRestClientImpl: org.apache.http.HttpResponse post(java.lang.String,java.util.Map)>(v, v);
v = specialinvoke v.<org.apache.helix.rest.client.CustomRestClientImpl: java.util.Map handleResponse(org.apache.http.HttpResponse,org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter)>(v, v);
return v;
}
protected com.fasterxml.jackson.databind.JsonNode getJsonObject(org.apache.http.HttpResponse) throws java.io.IOException
{
org.slf4j.Logger v;
com.fasterxml.jackson.databind.ObjectMapper v;
org.apache.http.HttpEntity v;
org.apache.http.HttpResponse v;
com.fasterxml.jackson.databind.JsonNode v;
java.lang.String v;
org.apache.helix.rest.client.CustomRestClientImpl v;
v := @this: org.apache.helix.rest.client.CustomRestClientImpl;
v := @parameter: org.apache.http.HttpResponse;
v = interfaceinvoke v.<org.apache.http.HttpResponse: org.apache.http.HttpEntity getEntity()>();
v = staticinvoke <org.apache.http.util.EntityUtils: java.lang.String toString(org.apache.http.HttpEntity)>(v);
v = <org.apache.helix.rest.client.CustomRestClientImpl: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Converting Response Content {} to JsonNode", v);
v = <org.apache.helix.rest.client.CustomRestClientImpl: com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER>;
v = virtualinvoke v.<com.fasterxml.jackson.databind.ObjectMapper: com.fasterxml.jackson.databind.JsonNode readTree(java.lang.String)>(v);
return v;
}
private java.util.Map handleResponse(org.apache.http.HttpResponse, org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter) throws java.io.IOException
{
org.apache.http.client.ClientProtocolException v;
org.slf4j.Logger v;
org.apache.http.HttpEntity v;
java.lang.Integer v;
org.apache.http.StatusLine v, v;
org.apache.helix.rest.client.CustomRestClientImpl v;
org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter v;
java.util.Map v;
int v;
org.apache.http.HttpResponse v;
com.fasterxml.jackson.databind.JsonNode v;
java.lang.String v, v;
v := @this: org.apache.helix.rest.client.CustomRestClientImpl;
v := @parameter: org.apache.http.HttpResponse;
v := @parameter: org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter;
v = interfaceinvoke v.<org.apache.http.HttpResponse: org.apache.http.StatusLine getStatusLine()>();
v = interfaceinvoke v.<org.apache.http.StatusLine: int getStatusCode()>();
if v != 200 goto label;
v = <org.apache.helix.rest.client.CustomRestClientImpl: org.slf4j.Logger LOG>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(200);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Expected HttpResponse statusCode: {}", v);
v = virtualinvoke v.<org.apache.helix.rest.client.CustomRestClientImpl: com.fasterxml.jackson.databind.JsonNode getJsonObject(org.apache.http.HttpResponse)>(v);
v = interfaceinvoke v.<org.apache.helix.rest.client.CustomRestClientImpl$JsonConverter: java.util.Map convert(com.fasterxml.jackson.databind.JsonNode)>(v);
return v;
label:
v = interfaceinvoke v.<org.apache.http.HttpResponse: org.apache.http.HttpEntity getEntity()>();
staticinvoke <org.apache.http.util.EntityUtils: void consumeQuietly(org.apache.http.HttpEntity)>(v);
v = new org.apache.http.client.ClientProtocolException;
v = interfaceinvoke v.<org.apache.http.HttpResponse: org.apache.http.StatusLine getStatusLine()>();
v = interfaceinvoke v.<org.apache.http.StatusLine: java.lang.String getReasonPhrase()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int,java.lang.String)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Unexpected response status: \u, reason: \u0001");
specialinvoke v.<org.apache.http.client.ClientProtocolException: void <init>(java.lang.String)>(v);
throw v;
}
protected org.apache.http.HttpResponse post(java.lang.String, java.util.Map) throws java.io.IOException
{
org.apache.http.client.methods.HttpPost v;
java.lang.Object[] v;
java.lang.Integer v;
org.apache.http.StatusLine v;
org.apache.http.RequestLine v;
org.apache.http.client.HttpClient v;
java.util.Map v;
int v;
java.lang.String v, v;
org.apache.http.Header[] v;
org.slf4j.Logger v, v, v;
com.fasterxml.jackson.databind.ObjectMapper v;
org.apache.http.HttpEntity v;
org.apache.http.entity.ContentType v;
org.apache.http.entity.StringEntity v;
java.io.IOException v;
org.apache.helix.rest.client.CustomRestClientImpl v;
org.apache.http.HttpResponse v;
v := @this: org.apache.helix.rest.client.CustomRestClientImpl;
v := @parameter: java.lang.String;
v := @parameter: java.util.Map;
v = new org.apache.http.client.methods.HttpPost;
specialinvoke v.<org.apache.http.client.methods.HttpPost: void <init>(java.lang.String)>(v);
label:
virtualinvoke v.<org.apache.http.client.methods.HttpPost: void setHeader(java.lang.String,java.lang.String)>("Accept", "application/json");
v = new org.apache.http.entity.StringEntity;
v = <org.apache.helix.rest.client.CustomRestClientImpl: com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER>;
v = virtualinvoke v.<com.fasterxml.jackson.databind.ObjectMapper: java.lang.String writeValueAsString(java.lang.Object)>(v);
v = <org.apache.http.entity.ContentType: org.apache.http.entity.ContentType APPLICATION_JSON>;
specialinvoke v.<org.apache.http.entity.StringEntity: void <init>(java.lang.String,org.apache.http.entity.ContentType)>(v, v);
virtualinvoke v.<org.apache.http.client.methods.HttpPost: void setEntity(org.apache.http.HttpEntity)>(v);
v = <org.apache.helix.rest.client.CustomRestClientImpl: org.slf4j.Logger LOG>;
v = newarray (java.lang.Object)[3];
v = virtualinvoke v.<org.apache.http.client.methods.HttpPost: org.apache.http.RequestLine getRequestLine()>();
v[0] = v;
v = virtualinvoke v.<org.apache.http.client.methods.HttpPost: org.apache.http.Header[] getAllHeaders()>();
v[1] = v;
v = virtualinvoke v.<org.apache.http.client.methods.HttpPost: org.apache.http.HttpEntity getEntity()>();
v[2] = v;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object[])>("Executing request: {}, headers: {}, entity: {}", v);
v = v.<org.apache.helix.rest.client.CustomRestClientImpl: org.apache.http.client.HttpClient _httpClient>;
v = interfaceinvoke v.<org.apache.http.client.HttpClient: org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest)>(v);
v = interfaceinvoke v.<org.apache.http.HttpResponse: org.apache.http.StatusLine getStatusLine()>();
v = interfaceinvoke v.<org.apache.http.StatusLine: int getStatusCode()>();
if v == 200 goto label;
v = <org.apache.helix.rest.client.CustomRestClientImpl: org.slf4j.Logger LOG>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Object,java.lang.Object)>("Received non-200 status code: {}, payloads: {}", v, v);
label:
return v;
label:
v := @caughtexception;
v = <org.apache.helix.rest.client.CustomRestClientImpl: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void error(java.lang.String,java.lang.Object,java.lang.Object)>("Failed to perform customized health check. Is participant endpoint {} available?", v, v);
virtualinvoke v.<org.apache.http.client.methods.HttpPost: void releaseConnection()>();
throw v;
catch java.io.IOException from label to label with label;
}
static void <clinit>()
{
com.fasterxml.jackson.databind.ObjectMapper v;
org.slf4j.Logger v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/apache/helix/rest/client/CustomRestClientImpl;");
<org.apache.helix.rest.client.CustomRestClientImpl: org.slf4j.Logger LOG> = v;
v = new com.fasterxml.jackson.databind.ObjectMapper;
specialinvoke v.<com.fasterxml.jackson.databind.ObjectMapper: void <init>()>();
<org.apache.helix.rest.client.CustomRestClientImpl: com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER> = v;
return;
}
}