use of com.hazelcast.kubernetes.KubernetesApiProvider.convertToString in project hazelcast by hazelcast.
the class KubernetesApiEndpointProvider method extractNodes.
private Map<EndpointAddress, String> extractNodes(JsonValue addressesJson, List<Integer> ports) {
Map<EndpointAddress, String> result = new HashMap<>();
for (JsonValue address : toJsonArray(addressesJson)) {
String ip = address.asObject().get("ip").asString();
String nodeName = KubernetesApiProvider.convertToString(address.asObject().get("nodeName"));
for (Integer port : ports) {
result.put(new EndpointAddress(ip, port), nodeName);
}
}
return result;
}
Aggregations