Skip to content

Commit

Permalink
fixup! address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
peihe committed Dec 6, 2016
1 parent 83ad94e commit a6d44ca
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private DataflowClient(Dataflow dataflow, String projectId) {
* Creates the Dataflow {@link Job}.
*/
public Job createJob(@Nonnull Job job) throws IOException {
checkNotNull(job, "job");
Jobs.Create jobsCreate = dataflow.projects().jobs().create(projectId, job);
return jobsCreate.execute();
}
Expand All @@ -74,6 +75,8 @@ public ListJobsResponse listJobs(@Nullable String pageToken) throws IOException
* Updates the Dataflow {@link Job} with the given {@code jobId}.
*/
public Job updateJob(@Nonnull String jobId, @Nonnull Job content) throws IOException {
checkNotNull(jobId, "jobId");
checkNotNull(content, "content");
Jobs.Update jobsUpdate = dataflow.projects().jobs()
.update(projectId, jobId, content);
return jobsUpdate.execute();
Expand All @@ -83,6 +86,7 @@ public Job updateJob(@Nonnull String jobId, @Nonnull Job content) throws IOExcep
* Gets the Dataflow {@link Job} with the given {@code jobId}.
*/
public Job getJob(@Nonnull String jobId) throws IOException {
checkNotNull(jobId, "jobId");
Jobs.Get jobsGet = dataflow.projects().jobs()
.get(projectId, jobId);
return jobsGet.execute();
Expand All @@ -92,6 +96,7 @@ public Job getJob(@Nonnull String jobId) throws IOException {
* Gets the {@link JobMetrics} with the given {@code jobId}.
*/
public JobMetrics getJobMetrics(@Nonnull String jobId) throws IOException {
checkNotNull(jobId, "jobId");
Jobs.GetMetrics jobsGetMetrics = dataflow.projects().jobs()
.getMetrics(projectId, jobId);
return jobsGetMetrics.execute();
Expand All @@ -102,6 +107,7 @@ public JobMetrics getJobMetrics(@Nonnull String jobId) throws IOException {
*/
public ListJobMessagesResponse listJobMessages(
@Nonnull String jobId, @Nullable String pageToken) throws IOException {
checkNotNull(jobId, "jobId");
Jobs.Messages.List jobMessagesList = dataflow.projects().jobs().messages()
.list(projectId, jobId)
.setPageToken(pageToken);
Expand All @@ -113,6 +119,8 @@ public ListJobMessagesResponse listJobMessages(
*/
public LeaseWorkItemResponse leaseWorkItem(
@Nonnull String jobId, @Nonnull LeaseWorkItemRequest request) throws IOException {
checkNotNull(jobId, "jobId");
checkNotNull(request, "request");
Jobs.WorkItems.Lease jobWorkItemsLease = dataflow.projects().jobs().workItems()
.lease(projectId, jobId, request);
return jobWorkItemsLease.execute();
Expand All @@ -123,6 +131,8 @@ public LeaseWorkItemResponse leaseWorkItem(
*/
public ReportWorkItemStatusResponse reportWorkItemStatus(
@Nonnull String jobId, @Nonnull ReportWorkItemStatusRequest request) throws IOException {
checkNotNull(jobId, "jobId");
checkNotNull(request, "request");
Jobs.WorkItems.ReportStatus jobWorkItemsReportStatus = dataflow.projects().jobs().workItems()
.reportStatus(projectId, jobId, request);
return jobWorkItemsReportStatus.execute();
Expand Down

0 comments on commit a6d44ca

Please sign in to comment.