Skip to content

Commit 8d0698b

Browse files
committed
Add comments
1 parent 48eaf74 commit 8d0698b

File tree

1 file changed

+5
-5
lines changed
  • databricks-sdk-java/src/main/java/com/databricks/sdk/mixin

1 file changed

+5
-5
lines changed

databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/JobsExt.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,20 @@ public JobsExt(JobsService mock) {
2020
*
2121
* <p>Depending on the Jobs API version used under the hood, tasks or iteration runs retrieved by
2222
* the initial request may be truncated due to high cardinalities. Truncation can happen for job
23-
* runs over 100 task runs, as well as ForEach task runs with over 100 iteration runs. To avoid
23+
* runs with over 100 task runs, as well as ForEach task runs with over 100 iteration runs. To avoid
2424
* returning an incomplete {@code Run} object to the user, this method performs all the requests
2525
* required to collect all task/iteration runs into a single {@code Run} object.
2626
*/
2727
@Override
2828
public Run getRun(GetRunRequest request) {
2929
Run run = super.getRun(request);
3030

31-
/*
32-
* fetch all additional pages (if any) and accumulate the result in a single response
33-
*/
34-
31+
// When querying a Job run, a page token is returned when there are more than 100 tasks. No iterations are defined for a Job run. Therefore, the next page in the response only includes the next page of tasks.
32+
// When querying a ForEach task run, a page token is returned when there are more than 100 iterations. Only a single task is returned, corresponding to the ForEach task itself. Therefore, the client only reads the iterations from the next page and not the tasks.
3533
Collection<RunTask> iterations = run.getIterations();
3634
boolean paginatingIterations = iterations != null && !iterations.isEmpty();
3735

36+
// runs/get response includes next_page_token as long as there are more pages to fetch.
3837
while (run.getNextPageToken() != null) {
3938
request.setPageToken(run.getNextPageToken());
4039
Run currRun = super.getRun(request);
@@ -50,6 +49,7 @@ public Run getRun(GetRunRequest request) {
5049
}
5150
}
5251

52+
// Each new page of runs/get response includes the next page of the job_clusters, job_parameters, and repair history.
5353
Collection<JobCluster> newClusters = currRun.getJobClusters();
5454
if (newClusters != null) {
5555
run.getJobClusters().addAll(newClusters);

0 commit comments

Comments
 (0)