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] Improve streampark-flink-client-KubernetesV2 module based on [3.7 Code Comments Rule] #3305

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ object KubernetesApplicationClientV2 extends KubernetesClientV2Trait with Logger
)
}

// Generate FlinkDeployment CR definition, it is a pure effect function.
/** Generate FlinkDeployment CR definition, it is a pure effect function. */
private def genFlinkDeployDef(
submitReq: SubmitRequest,
originFlinkConfig: Configuration,
Expand Down Expand Up @@ -246,6 +246,7 @@ object KubernetesApplicationClientV2 extends KubernetesClientV2Trait with Logger
))
}

/** Shutdown Flink Application deployment. */
@throws[Throwable]
def shutdown(shutDownRequest: ShutDownRequest): ShutDownResponse = {
val name = shutDownRequest.clusterId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ object KubernetesSessionClientV2 extends KubernetesClientV2Trait with Logger {
))
}

/** Deploy Flink cluster. */
@throws[Throwable]
def deploy(deployRequest: DeployRequest): DeployResponse = {
logInfo(
Expand Down Expand Up @@ -190,6 +191,7 @@ object KubernetesSessionClientV2 extends KubernetesClientV2Trait with Logger {
}
}

/** Generate FlinkDeployment CR definition, it is a pure effect function. */
private def genFlinkDeployDef(
deployReq: DeployRequest,
originFlinkConfig: Configuration): Either[FailureMessage, FlinkDeploymentDef] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ import scala.util.{Failure, Success, Try}
/** Submit Job to Remote Cluster */
object RemoteClient extends FlinkClientTrait {

/**
* @param submitRequest
* @param flinkConfig
*/
override def setConfig(submitRequest: SubmitRequest, flinkConfig: Configuration): Unit = {}

override def doSubmit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import scala.collection.mutable
import scala.jdk.CollectionConverters.asScalaBufferConverter
import scala.util.{Failure, Success, Try}

/** Flink K8s session/application mode cancel and Savepoint */
trait KubernetesClientV2Trait extends FlinkClientTrait {

protected type FailureMessage = String
Expand All @@ -60,6 +61,7 @@ trait KubernetesClientV2Trait extends FlinkClientTrait {
Try(yamlMapper.readValue(yaml, classOf[Pod]))
}

/** Generate JobDef */
protected def genJobDef(
flinkConfObj: Configuration,
jarUriHint: Option[String]): Either[FailureMessage, JobDef] = {
Expand Down
Loading