예제 #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());
  }
예제 #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();
  }
예제 #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();
  }
예제 #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());
  }