jerryshao commented on code in PR #13250:
URL: https://github.com/apache/gravitino/pull/13250#discussion_r4059149710
##########
api/src/main/java/org/apache/gravitino/job/SupportsJobs.java:
##########
@@ -124,7 +124,23 @@ JobHandle runJob(String jobTemplateName, Map<String,
String> jobConf)
* @return a handle to the job
* @throws NoSuchJobException if the job with the specified ID does not exist
*/
- JobHandle getJob(String jobId) throws NoSuchJobException;
+ default JobHandle getJob(String jobId) throws NoSuchJobException {
+ return getJob(jobId, false);
+ }
+
+ /**
+ * Retrieves a job by its ID, optionally including its captured
stdout/stderr output (see {@link
+ * JobHandle#stdout()}/{@link JobHandle#stderr()}).
+ *
+ * <p>Output is fetched live from the job executor on every call, not
persisted, so {@code
+ * includeOutput} should only be set to {@code true} when the output is
actually needed.
+ *
+ * @param jobId the ID of the job to retrieve
+ * @param includeOutput whether to also fetch and populate the job's
stdout/stderr output
+ * @return a handle to the job
+ * @throws NoSuchJobException if the job with the specified ID does not exist
+ */
+ JobHandle getJob(String jobId, boolean includeOutput) throws
NoSuchJobException;
Review Comment:
Good catch, you're right about the compatibility hazard. Fixed at HEAD:
reverted `getJob(String)` to the abstract method (unchanged from before this
PR) and made `getJob(String, boolean)` a default method that delegates to it,
ignoring `includeOutput` unless overridden.
`GravitinoMetalake`/`GravitinoClient` now both explicitly implement
`getJob(String)` (delegating to their own `getJob(id,
false)`/`getMetalake().getJob(id)`) in addition to the output-aware overload,
so existing external `SupportsJobs` implementors keep compiling and behaving
correctly without any changes.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]