Ejemplo n.º 1
0
  @POST
  @Path("/abort")
  @ApiOperation("Abort the Mesos scheduler driver.")
  public void abort() {
    checkForbidden(
        configuration.isAllowTestResourceCalls(),
        "Test resource calls are disabled (set isAllowTestResourceCalls to true in configuration)");

    abort.abort(AbortReason.TEST_ABORT, Optional.<Throwable>absent());
  }
Ejemplo n.º 2
0
  @POST
  @Path("/notleader")
  @ApiOperation("Make this instanceo of Singularity believe it's lost leadership.")
  public void setNotLeader() {
    checkForbidden(
        configuration.isAllowTestResourceCalls(),
        "Test resource calls are disabled (set isAllowTestResourceCalls to true in configuration)");

    managed.notLeader();
  }
Ejemplo n.º 3
0
  @POST
  @Path("/stop")
  @ApiOperation("Stop the Mesos scheduler driver.")
  public void stop() throws Exception {
    checkForbidden(
        configuration.isAllowTestResourceCalls(),
        "Test resource calls are disabled (set isAllowTestResourceCalls to true in configuration)");

    managed.stop();
  }
Ejemplo n.º 4
0
  @POST
  @Path("/scheduler/statusUpdate/{taskId}/{taskState}")
  @ApiOperation("Force an update for a specific task.")
  public void statusUpdate(
      @PathParam("taskId") String taskId, @PathParam("taskState") String taskState) {
    checkForbidden(
        configuration.isAllowTestResourceCalls(),
        "Test resource calls are disabled (set isAllowTestResourceCalls to true in configuration)");

    driver
        .getScheduler()
        .statusUpdate(
            null,
            TaskStatus.newBuilder()
                .setTaskId(TaskID.newBuilder().setValue(taskId))
                .setState(TaskState.valueOf(taskState))
                .build());
  }