Search in sources :

Example 6 with Status

use of io.pravega.shared.health.Status in project pravega by pravega.

the class SegmentContainerRegistryHealthContributor method doHealthCheck.

@Override
public Status doHealthCheck(Health.HealthBuilder builder) {
    for (SegmentContainer container : segmentContainerRegistry.getContainers()) {
        this.register(new SegmentContainerHealthContributor(container));
    }
    Status status = Status.DOWN;
    boolean ready = !segmentContainerRegistry.isClosed();
    if (ready) {
        status = Status.UP;
    }
    return status;
}
Also used : Status(io.pravega.shared.health.Status) SegmentContainer(io.pravega.segmentstore.server.SegmentContainer)

Example 7 with Status

use of io.pravega.shared.health.Status in project pravega by pravega.

the class EventProcessorHealthContributorTest method testHealthCheck.

@Test
public void testHealthCheck() throws Exception {
    eventProcessors.startAsync();
    eventProcessors.awaitRunning();
    Status status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.UP, status);
    eventProcessors.stopAsync();
    eventProcessors.awaitTerminated();
    status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.DOWN, status);
}
Also used : Status(io.pravega.shared.health.Status) Test(org.junit.Test)

Example 8 with Status

use of io.pravega.shared.health.Status in project pravega by pravega.

the class SegmentContainerMonitorHealthContributorTest method testHealthCheck.

@Test
public void testHealthCheck() throws Exception {
    monitor.startAsync();
    monitor.awaitRunning();
    Status status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.UP, status);
    monitor.stopAsync();
    monitor.awaitTerminated();
    status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.DOWN, status);
}
Also used : Status(io.pravega.shared.health.Status) Test(org.junit.Test)

Example 9 with Status

use of io.pravega.shared.health.Status in project pravega by pravega.

the class ClusterListenerHealthContributorTest method testHealthCheck.

@Test
public void testHealthCheck() throws Exception {
    clusterListener.startAsync();
    clusterListener.awaitRunning();
    Status status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.UP, status);
    clusterListener.stopAsync();
    clusterListener.awaitTerminated();
    status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.DOWN, status);
}
Also used : Status(io.pravega.shared.health.Status) Test(org.junit.Test)

Example 10 with Status

use of io.pravega.shared.health.Status in project pravega by pravega.

the class GRPCServerHealthContributorTest method testHealthCheck.

@Test
public void testHealthCheck() throws Exception {
    grpcServer.startAsync();
    grpcServer.awaitRunning();
    Status status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.UP, status);
    grpcServer.stopAsync();
    grpcServer.awaitTerminated();
    status = contributor.doHealthCheck(builder);
    Assert.assertEquals(Status.DOWN, status);
}
Also used : Status(io.pravega.shared.health.Status) Test(org.junit.Test)

Aggregations

Status (io.pravega.shared.health.Status)16 Test (org.junit.Test)11 Health (io.pravega.shared.health.Health)6 Cleanup (lombok.Cleanup)3 lombok.val (lombok.val)2 CacheManagerHealthContributor (io.pravega.segmentstore.server.CacheManager.CacheManagerHealthContributor)1 SegmentContainer (io.pravega.segmentstore.server.SegmentContainer)1 SegmentContainerRegistryHealthContributor (io.pravega.segmentstore.server.host.health.SegmentContainerRegistryHealthContributor)1 ZKHealthContributor (io.pravega.segmentstore.server.host.health.ZKHealthContributor)1 HealthContributor (io.pravega.shared.health.HealthContributor)1 HealthStatus (io.pravega.shared.health.bindings.generated.model.HealthStatus)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CuratorFramework (org.apache.curator.framework.CuratorFramework)1