Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if master node before schedule gremlin job #1314

Merged
merged 2 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -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,8 @@ public <V> HugeTask<V> waitUntilTaskCompleted(Id id)

public void waitUntilAllTasksCompleted(long seconds)
throws TimeoutException;

default public void checkRequirement(String op) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't set default

// pass
}
}