AmbariClient ambariClient = createAmbariClient(ambariIp);
int pollingAttempt = 0;
LOGGER.info("Starting polling of Ambari server's status [Ambari server IP: '{}'].", ambariIp);
while (!ambariRunning && !(pollingAttempt >= MAX_POLLING_ATTEMPTS)) {
try {
String ambariHealth = ambariClient.healthCheck();
LOGGER.info("Ambari health check returned: {} [Ambari server IP: '{}']", ambariHealth, ambariIp);
if ("RUNNING".equals(ambariHealth)) {
ambariRunning = true;
}
} catch (Exception e) {