Search in sources :

Example 1 with KillRunningInstance

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

the class ClusterResource method stopZooKeeper.

@Path("stop")
@GET
@Produces(MediaType.APPLICATION_JSON)
public String stopZooKeeper() throws Exception {
    context.getExhibitor().getActivityQueue().add(QueueGroups.MAIN, new KillRunningInstance(context.getExhibitor(), false));
    Result result = new Result("OK", true);
    return JsonUtil.writeValueAsString(result);
}
Also used : KillRunningInstance(com.netflix.exhibitor.core.state.KillRunningInstance) Result(com.netflix.exhibitor.core.entities.Result) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with KillRunningInstance

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

the class ClusterResource method stopStartZooKeeper.

@Path("restart")
@GET
@Produces(MediaType.APPLICATION_JSON)
public String stopStartZooKeeper() throws Exception {
    context.getExhibitor().getActivityQueue().add(QueueGroups.MAIN, new KillRunningInstance(context.getExhibitor(), true));
    Result result = new Result("OK", true);
    return JsonUtil.writeValueAsString(result);
}
Also used : KillRunningInstance(com.netflix.exhibitor.core.state.KillRunningInstance) Result(com.netflix.exhibitor.core.entities.Result) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

Result (com.netflix.exhibitor.core.entities.Result)2 KillRunningInstance (com.netflix.exhibitor.core.state.KillRunningInstance)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2