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][Python] Migrate all exists method call in PythonGateway to corresponding service #10989

Open
2 of 3 tasks
zhongjiajie opened this issue Jul 15, 2022 · 1 comment
Open
2 of 3 tasks
Labels
feature new feature help wanted Extra attention is needed Python

Comments

@zhongjiajie
Copy link
Member

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

In https://github.com/apache/dolphinscheduler/blob/1fcbbb653440106fc5ca94a6a9e2d218dc3be97f/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/python/PythonGateway.java, we will export function to make them available to in python API, but we have to handle many Java map or result object situation. I think we should migrate them into corresponding service instead of PythonGateway, and keep PythonGateway in simple call like what I do in

@Override
public Tenant createTenantIfNotExists(String tenantCode, String desc, String queue, String queueName) {
if (checkTenantExists(tenantCode)) {
return tenantMapper.queryByTenantCode(tenantCode);
}
Queue queueObj = queueService.createQueueIfNotExists(queue, queueName);
Tenant tenant = new Tenant(tenantCode, desc, queueObj.getId());
createTenantValid(tenant);
tenantMapper.insert(tenant);
return tenant;
}
}

And after that, we only need to one line call in PythonGateway, such as

public Tenant createTenant(String tenantCode, String desc, String queueName) {
return tenantService.createTenantIfNotExists(tenantCode, desc, queueName, queueName);
}

It makes our code clean, besides, we should do some refactoring in corresponding service when you migrate python gateway service. such as #10792 we will refactor the QueueServiceImpl.java and TenantService.java code

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@zhongjiajie zhongjiajie added help wanted Extra attention is needed feature new feature Python labels Jul 15, 2022
@github-actions
Copy link

Thank you for your feedback, we have received your issue, Please wait patiently for a reply.

  • In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
  • If you haven't received a reply for a long time, you can join our slack and send your question to channel #troubleshooting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature help wanted Extra attention is needed Python
Projects
None yet
Development

No branches or pull requests

1 participant