yuqi1129 commented on code in PR #13250:
URL: https://github.com/apache/gravitino/pull/13250#discussion_r4059117602
##########
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:
This reverses the compatibility direction of the interface. An existing
`SupportsJobs` implementation only implements `getJob(String)`; after
upgrading, recompilation fails because this new overload is abstract. An
implementation compiled against the old API can also hit `AbstractMethodError`
when the old call enters the new default method and invokes the missing
overload. Please keep `getJob(String)` abstract and make this overload a
default method that delegates to it. The built-in clients can override the new
overload to support output retrieval without breaking external implementations.
--
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]