Skip to content

[BEAM-2431] Adding the job API#3676

Closed
sb2nov wants to merge 2 commits intoapache:masterfrom
sb2nov:BEAM-2431-beam-job-api_1
Closed

[BEAM-2431] Adding the job API#3676
sb2nov wants to merge 2 commits intoapache:masterfrom
sb2nov:BEAM-2431-beam-job-api_1

Conversation

@sb2nov
Copy link
Contributor

@sb2nov sb2nov commented Aug 2, 2017

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

R: @tgroh PTAL

This is part 1 of many for the job submission API. Currently experimental so might evolve a bit as we make progress.

Copy link
Member

@tgroh tgroh left a comment

Choose a reason for hiding this comment

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

"We'll throw" means the client (the one the user is submitting the pipeline from), yes? If so, can probably be reworded to either "The client will throw" or "Throws"


package org.apache.beam.runner_api.v1;

option java_package = "org.apache.beam.common.job";
Copy link
Member

Choose a reason for hiding this comment

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

Our existing protobuf naming is consistent in versioning the java package (with v1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

// Cancel the job
rpc cancel (CancelJobRequest) returns (CancelJobResponse) {}

// Subscribe to a stream of state changes of the job
Copy link
Member

Choose a reason for hiding this comment

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

"... of the job. Will immediately return the current state of the job as the first response.", or some other similar verbage (assuming this is what is done; otherwise note that the current state will not be returned, and getState should be used instead)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


// Submit is a synchronus request that returns a jobId back
// GRPC will throw a GRPC_STATUS_UNAVAILABLE if server is down
// We'll throw an error with code ALREADY_EXISTS if the jobName is reused
Copy link
Member

Choose a reason for hiding this comment

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

Document the restrictions of that parameter, including "Runners are permitted to (blah blah blah)"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

message SubmitJobResponse {
string jobId = 1; // (required)
Copy link
Member

Choose a reason for hiding this comment

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

Document how this differs from jobName; potentially something like "used to refer to the submitted job in all future calls"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

message CancelJobResponse {
JobState.JobStateType state = 1; // (required)
Copy link
Member

Choose a reason for hiding this comment

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

Are there any restrictions to what this can be? Any terminal state or CANCELLING seems like a reasonable restriction

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.




// Cancel is a synchronus request that returns a jobState back
Copy link
Member

Choose a reason for hiding this comment

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

Are there restrictions on when cancel can be called and will not throw an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure yet as I think Dataflow just doesn't say anything if you click cancel twice.

Copy link
Contributor Author

@sb2nov sb2nov left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback.

R: @tgroh PTAL again.


package org.apache.beam.runner_api.v1;

option java_package = "org.apache.beam.common.job";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

// Cancel the job
rpc cancel (CancelJobRequest) returns (CancelJobResponse) {}

// Subscribe to a stream of state changes of the job
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


// Submit is a synchronus request that returns a jobId back
// GRPC will throw a GRPC_STATUS_UNAVAILABLE if server is down
// We'll throw an error with code ALREADY_EXISTS if the jobName is reused
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

message CancelJobResponse {
JobState.JobStateType state = 1; // (required)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.




// Cancel is a synchronus request that returns a jobState back
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure yet as I think Dataflow just doesn't say anything if you click cancel twice.

}

message SubmitJobResponse {
string jobId = 1; // (required)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@tgroh tgroh left a comment

Choose a reason for hiding this comment

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

LGTM.

@asfgit asfgit closed this in 0a358c7 Aug 2, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 70.16% when pulling c2ab52b on sb2nov:BEAM-2431-beam-job-api_1 into ba5e314 on apache:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants