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] Improve deployreponse parameters #3315

Merged
merged 3 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -17,4 +17,11 @@

package org.apache.streampark.flink.client.bean

case class DeployResponse(address: String, clusterId: String)
import javax.annotation.Nullable

import java.util.{Map => JavaMap}

case class DeployResponse(
@Nullable address: String = "",
clusterId: String,
flinkConfig: JavaMap[String, String])
caicancai marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ object KubernetesNativeSessionClient extends KubernetesNativeClientTrait with Lo
clusterDescriptor.deploySessionCluster(kubernetesClusterDescriptor._2).getClusterClient
}
if (client.getWebInterfaceURL != null) {
DeployResponse(client.getWebInterfaceURL, client.getClusterId)
DeployResponse(client.getWebInterfaceURL, client.getClusterId, flinkConfig.toMap)
} else {
null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,14 @@ object KubernetesSessionClientV2 extends KubernetesClientV2Trait with Logger {
FlinkK8sOperator.deployCluster(deployRequest.id, flinkDeployDef).runIOAsTry match {
case Success(_) =>
logInfo(richMsg("Flink Cluster has been submitted successfully."))
DeployResponse(null, deployRequest.clusterId)
case Failure(err) =>
logError(
richMsg(s"Submit Flink Cluster fail in${deployRequest.executionMode.getName}_V2 mode!"),
err)
throw err
}

DeployResponse(null, deployRequest.clusterId, flinkConfig.toMap)
}

/** Shutdown Flink cluster. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ object YarnSessionClient extends YarnClientTrait {
.retrieve(ApplicationId.fromString(deployRequest.clusterId))
.getClusterClient
if (yarnClient.getWebInterfaceURL != null) {
return DeployResponse(yarnClient.getWebInterfaceURL, yarnClient.getClusterId.toString)
return DeployResponse(
yarnClient.getWebInterfaceURL,
yarnClient.getClusterId.toString,
flinkConfig.toMap)
}
}
} catch {
Expand Down