Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature][Engine] Change the name of the rest-api interface for returning job info #6813

Merged
merged 10 commits into from
May 9, 2024

Conversation

hawk9821
Copy link
Contributor

@hawk9821 hawk9821 commented May 9, 2024

…b details was changed from running-job to job-info #6812

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hawk9821 for create this PR! I think your point is right. But we'd better not modify the old url api, but create a new api and mark the old one as deprecated. This will ensure backward compatibility.

@hawk9821
Copy link
Contributor Author

hawk9821 commented May 9, 2024

Thanks @hawk9821 for create this PR! I think your point is right. But we'd better not modify the old url api, but create a new api and mark the old one as deprecated. This will ensure backward compatibility.

Thanks @Hisoka-X, I have modified it as requested

Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for update!


------------------------------------------------------------------------------------------

### Return details of a job @Deprecated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Return details of a job @Deprecated.
### Return details of a job. This API has been deprecated, please use /hazelcast/rest/maps/job-info/:jobId instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


------------------------------------------------------------------------------------------

### 返回作业的详细信息(已弃用)。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 返回作业的详细信息(已弃用)。
### 返回作业的详细信息。此API已经启用,请使用/hazelcast/rest/maps/job-info/:jobId替代

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


public class RestHttpGetCommandProcessor extends HttpCommandProcessor<HttpGetCommand> {
public static class RestHttpGetCommandProcessor extends HttpCommandProcessor<HttpGetCommand> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mvn spotless:apply,missed check . modified

@@ -300,6 +296,54 @@ private void handleJobInfoById(HttpGetCommand command, String uri) {
}
}

private void handleJobInfoByJobId(HttpGetCommand command, String uri) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can reuse handleJobInfoById method, not create new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment on lines +256 to +269
IMap<Object, Object> jobInfoMap =
this.textCommandService
.getNode()
.getNodeEngine()
.getHazelcastInstance()
.getMap(Constant.IMAP_RUNNING_JOB_INFO);
JobInfo jobInfo = (JobInfo) jobInfoMap.get(Long.valueOf(jobId));
IMap<Object, Object> finishedJobStateMap =
this.textCommandService
.getNode()
.getNodeEngine()
.getHazelcastInstance()
.getMap(Constant.IMAP_FINISHED_JOB_STATE);
JobState finishedJobState = (JobState) finishedJobStateMap.get(Long.valueOf(jobId));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for change this? Seem like no difference between before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In openEuler system, call /hazelcast/rest/maps/running-job/ returned to {} ,remote debug finds that the JobState object is not returned correctly. After the code is modified, the JobState object can be returned correctly

image
image
888f2aaf3178c2e301fc309b0f47aec

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feeling a little strange. cc @hailin0 @EricJoy2048

@Hisoka-X Hisoka-X changed the title [Feature][Engine] The name of the rest-api interface for returning jo… [Feature][Engine] Change the name of the rest-api interface for returning job info May 9, 2024
docs/en/seatunnel-engine/rest-api.md Outdated Show resolved Hide resolved
docs/zh/seatunnel-engine/rest-api.md Outdated Show resolved Hide resolved
Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, it will not affect result of now.

@EricJoy2048 EricJoy2048 merged commit 27dcd80 into apache:dev May 9, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants