Package com.bazaarvoice.ostrich.healthcheck

Examples of com.bazaarvoice.ostrich.healthcheck.DefaultHealthCheckResults


        return ImmutableSet.copyOf(_badEndPoints);
    }

    @Override
    public HealthCheckResults checkForHealthyEndPoint() {
        DefaultHealthCheckResults aggregate = new DefaultHealthCheckResults();

        Iterable<ServiceEndPoint> allEndPoints = getAllEndPoints();
        if (Iterables.isEmpty(allEndPoints)) {
            // There were no end points
            return aggregate;
        }

        Iterable<ServiceEndPoint> validEndPoints = getValidEndPoints(allEndPoints);
        if (Iterables.isEmpty(validEndPoints)) {
            // There were no valid end points
            return aggregate;
        }

        Set<ServiceEndPoint> endPoints = Sets.newHashSet(validEndPoints);
        while (!endPoints.isEmpty()) {
            // Prefer end points in the order the load balancer recommends.
            ServiceEndPoint endPoint = chooseEndPoint(endPoints, PartitionContextBuilder.empty());
            if (endPoint == null) {
                // Load balancer didn't like our end points, so just go sequentially.
                endPoint = endPoints.iterator().next();
            }

            HealthCheckResult result = checkHealth(endPoint);
            aggregate.addHealthCheckResult(result);

            if (!result.isHealthy()) {
                Exception exception = ((FailedHealthCheckResult) result).getException();
                if (exception == null || isRetriableException(exception)) {
                    LOG.debug("Unhealthy end point discovered. End point ID: {}", endPoint.getId());
View Full Code Here


    }

    @Override
    public HealthCheckResults checkForHealthyEndPoint() {
        Set<ServiceEndPoint> endPoints;
        DefaultHealthCheckResults aggregate = new DefaultHealthCheckResults();

        try {
            // Take a snapshot of the current end points.
            endPoints = Sets.newHashSet(getValidEndPoints());
        } catch (Exception e) {
            // No valid end points means no healthy end points.
            return aggregate;
        }

        while (!endPoints.isEmpty()) {
            ServiceEndPoint endPoint;
            try {
                // Prefer end points in the order the load balancer recommends.
                endPoint = chooseEndPoint(endPoints, PartitionContextBuilder.empty());
            } catch (Exception e) {
                // Load balancer didn't like our end points, so just go sequentially.
                endPoint = endPoints.iterator().next();
            }

            HealthCheckResult result = checkHealth(endPoint);
            aggregate.addHealthCheckResult(result);

            if (!result.isHealthy()) {
                Exception exception = ((FailedHealthCheckResult) result).getException();
                if (exception == null || isRetriableException(exception)) {
                    LOG.debug("Unhealthy end point discovered. End point ID: " + endPoint.getId());
View Full Code Here

        return ImmutableSet.copyOf(_badEndPoints.keySet());
    }

    @Override
    public HealthCheckResults checkForHealthyEndPoint() {
        DefaultHealthCheckResults aggregate = new DefaultHealthCheckResults();

        Iterable<ServiceEndPoint> allEndPoints = getAllEndPoints();
        if (Iterables.isEmpty(allEndPoints)) {
            // There were no end points
            return aggregate;
        }

        Iterable<ServiceEndPoint> validEndPoints = getValidEndPoints(allEndPoints);
        if (Iterables.isEmpty(validEndPoints)) {
            // There were no valid end points
            return aggregate;
        }

        Set<ServiceEndPoint> endPoints = Sets.newHashSet(validEndPoints);
        while (!endPoints.isEmpty()) {
            // Prefer end points in the order the load balancer recommends.
            ServiceEndPoint endPoint = chooseEndPoint(endPoints, PartitionContextBuilder.empty());
            if (endPoint == null) {
                // Load balancer didn't like our end points, so just go sequentially.
                endPoint = endPoints.iterator().next();
            }

            HealthCheckResult result = checkHealth(endPoint);
            aggregate.addHealthCheckResult(result);

            if (!result.isHealthy()) {
                Exception exception = ((FailedHealthCheckResult) result).getException();
                if (exception == null || isRetriableException(exception)) {
                    LOG.debug("Unhealthy end point discovered. End point ID: {}", endPoint.getId());
View Full Code Here

    }

    @Override
    public HealthCheckResults checkForHealthyEndPoint() {
        Set<ServiceEndPoint> endPoints;
        DefaultHealthCheckResults aggregate = new DefaultHealthCheckResults();

        try {
            // Take a snapshot of the current end points.
            endPoints = Sets.newHashSet(getValidEndPoints());
        } catch (Exception e) {
            // No valid end points means no healthy end points.
            return aggregate;
        }

        while (!endPoints.isEmpty()) {
            ServiceEndPoint endPoint;
            try {
                // Prefer end points in the order the load balancer recommends.
                endPoint = chooseEndPoint(endPoints, PartitionContextBuilder.empty());
            } catch (Exception e) {
                // Load balancer didn't like our end points, so just go sequentially.
                endPoint = endPoints.iterator().next();
            }

            HealthCheckResult result = checkHealth(endPoint);
            aggregate.addHealthCheckResult(result);

            if (!result.isHealthy()) {
                Exception exception = ((FailedHealthCheckResult) result).getException();
                if (exception == null || isRetriableException(exception)) {
                    LOG.debug("Unhealthy end point discovered. End point ID: {}", endPoint.getId());
View Full Code Here

        return ImmutableSet.copyOf(_badEndPoints);
    }

    @Override
    public HealthCheckResults checkForHealthyEndPoint() {
        DefaultHealthCheckResults aggregate = new DefaultHealthCheckResults();

        Iterable<ServiceEndPoint> allEndPoints = getAllEndPoints();
        if (Iterables.isEmpty(allEndPoints)) {
            // There were no end points
            return aggregate;
        }

        Iterable<ServiceEndPoint> validEndPoints = getValidEndPoints(allEndPoints);
        if (Iterables.isEmpty(validEndPoints)) {
            // There were no valid end points
            return aggregate;
        }

        Set<ServiceEndPoint> endPoints = Sets.newHashSet(validEndPoints);
        while (!endPoints.isEmpty()) {
            // Prefer end points in the order the load balancer recommends.
            ServiceEndPoint endPoint = chooseEndPoint(endPoints, PartitionContextBuilder.empty());
            if (endPoint == null) {
                // Load balancer didn't like our end points, so just go sequentially.
                endPoint = endPoints.iterator().next();
            }

            HealthCheckResult result = checkHealth(endPoint);
            aggregate.addHealthCheckResult(result);

            if (!result.isHealthy()) {
                Exception exception = ((FailedHealthCheckResult) result).getException();
                if (exception == null || isRetriableException(exception)) {
                    LOG.debug("Unhealthy end point discovered. End point ID: {}", endPoint.getId());
View Full Code Here

        return ImmutableSet.copyOf(_badEndPoints);
    }

    @Override
    public HealthCheckResults checkForHealthyEndPoint() {
        DefaultHealthCheckResults aggregate = new DefaultHealthCheckResults();

        Iterable<ServiceEndPoint> allEndPoints = getAllEndPoints();
        if (Iterables.isEmpty(allEndPoints)) {
            // There were no end points
            return aggregate;
        }

        Iterable<ServiceEndPoint> validEndPoints = getValidEndPoints(allEndPoints);
        if (Iterables.isEmpty(validEndPoints)) {
            // There were no valid end points
            return aggregate;
        }

        Set<ServiceEndPoint> endPoints = Sets.newHashSet(validEndPoints);
        while (!endPoints.isEmpty()) {
            // Prefer end points in the order the load balancer recommends.
            ServiceEndPoint endPoint = chooseEndPoint(endPoints, PartitionContextBuilder.empty());
            if (endPoint == null) {
                // Load balancer didn't like our end points, so just go sequentially.
                endPoint = endPoints.iterator().next();
            }

            HealthCheckResult result = checkHealth(endPoint);
            aggregate.addHealthCheckResult(result);

            if (!result.isHealthy()) {
                Exception exception = ((FailedHealthCheckResult) result).getException();
                if (exception == null || isRetriableException(exception)) {
                    LOG.debug("Unhealthy end point discovered. End point ID: {}", endPoint.getId());
View Full Code Here

    }

    @Override
    public HealthCheckResults checkForHealthyEndPoint() {
        Set<ServiceEndPoint> endPoints;
        DefaultHealthCheckResults aggregate = new DefaultHealthCheckResults();

        try {
            // Take a snapshot of the current end points.
            endPoints = Sets.newHashSet(getValidEndPoints());
        } catch (Exception e) {
            // No valid end points means no healthy end points.
            return aggregate;
        }

        while (!endPoints.isEmpty()) {
            ServiceEndPoint endPoint;
            try {
                // Prefer end points in the order the load balancer recommends.
                endPoint = chooseEndPoint(endPoints, PartitionContextBuilder.empty());
            } catch (Exception e) {
                // Load balancer didn't like our end points, so just go sequentially.
                endPoint = endPoints.iterator().next();
            }

            HealthCheckResult result = checkHealth(endPoint);
            aggregate.addHealthCheckResult(result);

            if (!result.isHealthy()) {
                Exception exception = ((FailedHealthCheckResult) result).getException();
                if (exception == null || isRetriableException(exception)) {
                    LOG.debug("Unhealthy end point discovered. End point ID: {}", endPoint.getId());
View Full Code Here

TOP

Related Classes of com.bazaarvoice.ostrich.healthcheck.DefaultHealthCheckResults

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.