Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,12 @@ public void waitUntilAllTasksCompleted(long seconds)
this.taskScheduler.waitUntilAllTasksCompleted(seconds);
}

@Override
public void checkRequirement(String op) {
verifyStatusPermission();
this.taskScheduler.checkRequirement(op);
}

private void verifyTaskPermission(HugePermission actionPerm) {
verifyPermission(actionPerm, ResourceType.TASK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public HugeTask<V> schedule() {
E.checkArgumentNotNull(this.job, "Job callable can't be null");
E.checkArgument(this.job instanceof TaskCallable,
"Job must be instance of TaskCallable");

this.graph.taskScheduler().checkRequirement("schedule");

@SuppressWarnings("unchecked")
TaskCallable<V> job = (TaskCallable<V>) this.job;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,11 @@ public void waitUntilAllTasksCompleted(long seconds)
taskSize, seconds));
}

@Override
public void checkRequirement(String op) {
this.checkOnMasterNode(op);
}

private <V> Iterator<HugeTask<V>> queryTask(String key, Object value,
long limit, String page) {
return this.queryTask(ImmutableMap.of(key, value), limit, page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ public <V> HugeTask<V> waitUntilTaskCompleted(Id id)

public void waitUntilAllTasksCompleted(long seconds)
throws TimeoutException;

public void checkRequirement(String op);
}