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

[Improve][Flink-Kubernetes-V2] add exception throw #3314

Closed
wants to merge 4 commits into from
Closed

[Improve][Flink-Kubernetes-V2] add exception throw #3314

wants to merge 4 commits into from

Conversation

caicancai
Copy link
Member

@caicancai caicancai commented Nov 5, 2023

In some places where it might be null, I add an exception throw
①[KubernetesApplicationClientV2.scala]
②[KubernetesSesionClientV2.scala]

What changes were proposed in this pull request

fix: #2882 and #2884

Brief change log

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): (yes / no)

@github-actions github-actions bot added the FLINK label Nov 5, 2023
@caicancai
Copy link
Member Author

caicancai commented Nov 5, 2023

cc @Al-assad @wolfboys . It is true that the cluster part may throw an exception for null, but I'm not sure if there is a risk of application being null

@caicancai
Copy link
Member Author

Whether it is necessary for DeployRequest to be as complete as SubRequest, it seems that DeployRequest is imperfect at present, and many configurable parameters have not been passed in

@caicancai
Copy link
Member Author

For ② I think it is OK, ① I am not sure if it is appropriate to make such a change

@caicancai caicancai closed this Nov 5, 2023
@caicancai caicancai reopened this Nov 5, 2023
@caicancai caicancai closed this Nov 5, 2023
@caicancai caicancai reopened this Nov 5, 2023
@caicancai caicancai closed this Nov 5, 2023
@caicancai caicancai reopened this Nov 5, 2023
@caicancai
Copy link
Member Author

cc @Al-assad

Copy link
Member

@Al-assad Al-assad left a comment

Choose a reason for hiding this comment

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

Thank you for your submission, but the code modified in the commit do not require a value. Therefore they are all of type Option in the original code.
I'm afraid I will reject this PR.

.getOption(KubernetesConfigOptions.CONTAINER_IMAGE_PULL_POLICY)
.map(_.toString)
.orElse(submitReq.k8sSubmitParam.imagePullPolicy)
val imagePullPolicy = Option(
Copy link
Member

Choose a reason for hiding this comment

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

imagePullPolicy is a Option[String] here which is not mandatory to have a value.

@@ -103,12 +103,15 @@ object KubernetesApplicationClientV2 extends KubernetesClientV2Trait with Logger
.filter(str => StringUtils.isNotBlank(str))
.getOrElse(return Left("Flink base image should not be empty"))

val ingress = submitReq.k8sSubmitParam.ingressDefinition
val ingress = Option(submitReq.k8sSubmitParam.ingressDefinition)
Copy link
Member

Choose a reason for hiding this comment

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

ingress should be a Option[IngressDef] here.

@@ -142,14 +145,17 @@ object KubernetesApplicationClientV2 extends KubernetesClientV2Trait with Logger
.orElse(submitReq.k8sSubmitParam.jobManagerMemory)
.getOrElse(KUBERNETES_JM_MEMORY_DEFAULT)

val ephemeralStorage = Option(submitReq.k8sSubmitParam.jobManagerEphemeralStorage)
Copy link
Member

Choose a reason for hiding this comment

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

ephemeralStorage is is not a required parameter

@caicancai
Copy link
Member Author

caicancai commented Nov 6, 2023

Thank you for your submission, but the code modified in the commit do not require a value. Therefore they are all of type Option in the original code. I'm afraid I will reject this PR.

Thank you for your reply and review . If the value is NULL, the return is null. There is no need to return an exception?

@caicancai
Copy link
Member Author

I seem to understand what you mean. None doesn't affect the overall operation of the program, but Exception does, so those arguments can be None

@caicancai
Copy link
Member Author

If so, I will shut this pr down

@caicancai caicancai closed this Nov 6, 2023
@caicancai caicancai deleted the throw_exception branch November 10, 2023 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] [Flink-K8s-V2] Refactor the lifecycle control of Flink application-mode jobs on Kubernetes
2 participants