Package com.sequenceiq.ambari.client

Examples of com.sequenceiq.ambari.client.AmbariClient


    @Override
    public boolean checkStatus(AmbariHosts hosts) {
        MDCBuilder.buildMdcContext(hosts.getStack());
        try {
            AmbariClient ambariClient = hosts.getAmbariClient();
            List<String> hostNames = ambariClient.getClusterHosts();
            for (String hostName : hostNames) {
                if ("UNKNOWN".equals(ambariClient.getHostState(hostName))) {
                    LOGGER.info("The state of the {} is UNKNOWN, waiting for join", hostName);
                    return false;
                }
            }
        } catch (Exception e) {
View Full Code Here


    public boolean checkStatus(AmbariOperations t) {
        MDCBuilder.buildMdcContext(t.getStack());
        Map<String, Integer> installRequests = t.getRequests();
        boolean allFinished = true;
        for (Entry<String, Integer> request : installRequests.entrySet()) {
            AmbariClient ambariClient = t.getAmbariClient();
            BigDecimal installProgress = ambariClient.getRequestProgress(request.getValue());
            LOGGER.info("Ambari operation: '{}', Progress: {}", request.getKey(), installProgress);
            allFinished = allFinished && installProgress.compareTo(COMPLETED) == 0;
            if (installProgress.compareTo(FAILED) == 0) {
                boolean failed = true;
                for (int i = 0; i < MAX_RETRY; i++) {
                    if (ambariClient.getRequestProgress(request.getValue()).compareTo(FAILED) != 0) {
                        failed = false;
                        break;
                    }
                }
                if (failed) {
View Full Code Here

    }

    private void waitForAmbariToStart(Stack stack) {
        ambariHealthChecker.pollWithTimeout(
                new AmbariHealthCheckerTask(),
                new AmbariClient(stack.getAmbariIp()),
                AmbariClusterConnector.POLLING_INTERVAL,
                AmbariClusterConnector.MAX_ATTEMPTS_FOR_HOSTS);
    }
View Full Code Here

    }

    private boolean waitForHostsToJoin(Stack stack) {
        AmbariHostsJoinStatusCheckerTask ambariHostsJoinStatusCheckerTask = new AmbariHostsJoinStatusCheckerTask();
        AmbariHosts ambariHosts =
                new AmbariHosts(stack, new AmbariClient(stack.getAmbariIp()), stack.getNodeCount() * stack.getMultiplier());
        ambariHostJoin.pollWithTimeout(
                ambariHostsJoinStatusCheckerTask,
                ambariHosts,
                AmbariClusterConnector.POLLING_INTERVAL,
                AmbariClusterConnector.MAX_ATTEMPTS_FOR_HOSTS);
View Full Code Here

TOP

Related Classes of com.sequenceiq.ambari.client.AmbariClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.