Search in sources :

Example 16 with ServerList

use of com.netflix.exhibitor.core.state.ServerList in project exhibitor by soabase.

the class ClusterResource method getClusterStatus.

@Path("status")
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getClusterStatus() throws Exception {
    InstanceConfig config = context.getExhibitor().getConfigManager().getConfig();
    ServerList serverList = new ServerList(config.getString(StringConfigs.SERVERS_SPEC));
    ClusterStatusTask task = new ClusterStatusTask(context.getExhibitor(), serverList.getSpecs());
    List<ServerStatus> statuses = context.getExhibitor().getForkJoinPool().invoke(task);
    GenericEntity<List<ServerStatus>> entity = new GenericEntity<List<ServerStatus>>(statuses) {
    };
    return Response.ok(entity).build();
}
Also used : InstanceConfig(com.netflix.exhibitor.core.config.InstanceConfig) GenericEntity(javax.ws.rs.core.GenericEntity) ServerStatus(com.netflix.exhibitor.core.entities.ServerStatus) ServerList(com.netflix.exhibitor.core.state.ServerList) ServerList(com.netflix.exhibitor.core.state.ServerList) List(java.util.List) ClusterStatusTask(com.netflix.exhibitor.core.automanage.ClusterStatusTask) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

ServerList (com.netflix.exhibitor.core.state.ServerList)16 ServerSpec (com.netflix.exhibitor.core.state.ServerSpec)7 Exhibitor (com.netflix.exhibitor.core.Exhibitor)6 ActivityLog (com.netflix.exhibitor.core.activity.ActivityLog)6 ActivityQueue (com.netflix.exhibitor.core.activity.ActivityQueue)6 RemoteInstanceRequestClient (com.netflix.exhibitor.core.automanage.RemoteInstanceRequestClient)6 MonitorRunningInstance (com.netflix.exhibitor.core.state.MonitorRunningInstance)6 URI (java.net.URI)6 Properties (java.util.Properties)6 AtomicLong (java.util.concurrent.atomic.AtomicLong)6 MediaType (javax.ws.rs.core.MediaType)6 Test (org.testng.annotations.Test)6 InstanceState (com.netflix.exhibitor.core.state.InstanceState)5 RestartSignificantConfig (com.netflix.exhibitor.core.state.RestartSignificantConfig)5 InstanceConfig (com.netflix.exhibitor.core.config.InstanceConfig)4 ServerStatus (com.netflix.exhibitor.core.entities.ServerStatus)4 IOException (java.io.IOException)4 GET (javax.ws.rs.GET)4 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4