Skip to content

[Feature] Introduce Session Interface#209

Merged
SteNicholas merged 4 commits intoapache:mainfrom
s7monk:paimon_web_job_interface
May 13, 2024
Merged

[Feature] Introduce Session Interface#209
SteNicholas merged 4 commits intoapache:mainfrom
s7monk:paimon_web_job_interface

Conversation

@s7monk
Copy link
Contributor

@s7monk s7monk commented May 6, 2024

Relates to: #195

Purpose

This pull request is a subtask implementation of #195, which introduces a session interface that creates a session or triggers a heartbeat of session.

Tests

SessionControllerTest

API and Format

@PostMapping("/check")
    public R<Void> checkAndRenewSession(Integer uid) {
        QueryWrapper<ClusterInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type", "Flink");
        List<ClusterInfo> clusterInfos = clusterService.list(queryWrapper);
        for (ClusterInfo cluster : clusterInfos) {
            SessionDTO sessionDTO = new SessionDTO();
            sessionDTO.setHost(cluster.getHost());
            sessionDTO.setPort(cluster.getPort());
            sessionDTO.setClusterId(cluster.getId());
            sessionDTO.setUid(uid);
            if (sessionService.getSession(uid, cluster.getId()) == null) {
                sessionService.createSession(sessionDTO);
            } else {
                if (sessionService.triggerSessionHeartbeat(sessionDTO) < 1) {
                    sessionService.createSession(sessionDTO);
                }
            }
        }
        return R.succeed();
    }

@s7monk s7monk changed the title [Feature] Add Session Controller [Feature] Add Session Interface May 6, 2024
@SteNicholas SteNicholas changed the title [Feature] Add Session Interface [Feature] Introduce Session Interface May 13, 2024
@SteNicholas SteNicholas merged commit 098e6f3 into apache:main May 13, 2024
hdygxsj pushed a commit to hdygxsj/paimon-webui that referenced this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants