wolfboys commented on code in PR #2243:
URL:
https://github.com/apache/incubator-streampark/pull/2243#discussion_r1064332261
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/LogClientService.java:
##########
@@ -33,10 +33,10 @@
@Slf4j
@Component
public class LogClientService {
- public String rollViewLog(String path, int skipLineNum, int limit) {
+ public String rollViewLog(String path, int offset, int limit) {
String result = "";
try {
- List<String> lines = readPartFileContent(path, skipLineNum, limit);
+ List<String> lines = readPartFileContent(path, offset, limit);
Review Comment:
> The result can be removed, and return `""` in the end of this method
directly.
thanks for your review, done.
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java:
##########
@@ -580,6 +583,39 @@ public List<String> historyUploadJars() {
.collect(Collectors.toList());
}
+ @Override
+ public String k8sStartLog(Long id, Integer offset, Integer limit) throws
Exception {
+ Application application = getById(id);
+ AssertUtils.state(application != null);
+ if (ExecutionMode.isKubernetesMode(application.getExecutionModeEnum())) {
+ CompletableFutureUtils.supplyTimeout(
+ CompletableFuture.supplyAsync(
+ () ->
+ KubernetesDeploymentHelper.watchDeploymentLog(
+ application.getK8sNamespace(),
+ application.getJobName(),
+ application.getJobId())),
+ 5,
+ TimeUnit.SECONDS,
+ success -> success,
+ exception -> {
+ String errorLog =
+ String.format(
+ "%s/%s_err.log", WebUtils.getAppTempDir(),
application.getJobId());
+ File file = new File(errorLog);
+ if (file.exists()) {
+ return errorLog;
+ } else {
+ throw new ApiDetailException("get k8s job log failed: " +
exception.getMessage());
+ }
+ })
Review Comment:
done
--
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]