Skip to content

Commit

Permalink
Adjust the order to inspect the savepoint path defined first
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidhua1996 committed Feb 19, 2023
1 parent b5659fc commit 6ea958a
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional

import java.net.URI
import java.util

@Service
Expand Down Expand Up @@ -83,8 +84,13 @@ class DefaultStreamJobInspectService extends StreamJobInspectService with Loggin
* @return
*/
private def snapshotInspect(streamJob: StreamJob): JobSnapshotInspectVo = {
this.streamJobConfMapper.getRawConfValue(streamJob.getId, JobConfKeyConstants.START_AUTO_RESTORE_SWITCH.getValue) match {
case "ON" =>
Option(this.streamJobConfMapper.getRawConfValue(streamJob.getId, JobConfKeyConstants.SAVEPOINT.getValue + "path")) match {
case Some(path) =>
val inspectVo = new JobSnapshotInspectVo
inspectVo.setPath(new URI(path).toString)
inspectVo
case _ => this.streamJobConfMapper.getRawConfValue(streamJob.getId, JobConfKeyConstants.START_AUTO_RESTORE_SWITCH.getValue) match {
case "ON" =>
Option(this.streamTaskService.getStateInfo(streamTaskMapper
.getLatestLaunchedById(streamJob.getId))) match {
case Some(jobState) =>
Expand All @@ -93,7 +99,10 @@ class DefaultStreamJobInspectService extends StreamJobInspectService with Loggin
inspectVo
case _ => null
}
case _ => null
case _ => null
}
}

}

}

0 comments on commit 6ea958a

Please sign in to comment.