Skip to content

Commit

Permalink
[FLINK-10101][mesos] Announce web UI url at Mesos master
Browse files Browse the repository at this point in the history
This commit announces the cluster's web UI url at the Mesos master so that it
is visible in the Mesos UI.

This closes apache#6522.
  • Loading branch information
liurenjie1024 authored and tillrohrmann committed Aug 16, 2018
1 parent d8ae637 commit 8ba2626
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ protected ResourceManager<?> createResourceManager(
mesosServices,
schedulerConfiguration,
taskManagerParameters,
taskManagerContainerSpec
);
taskManagerContainerSpec,
webInterfaceUrl);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ protected ResourceManager<?> createResourceManager(
mesosServices,
mesosConfig,
taskManagerParameters,
taskManagerContainerSpec
);
taskManagerContainerSpec,
webInterfaceUrl);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ public class MesosResourceManager extends ResourceManager<RegisteredMesosWorkerN
/** A local actor system for using the helper actors. */
private final ActorSystem actorSystem;

/** Web url to show in mesos page. */
@Nullable
private final String webUiUrl;

/** Mesos scheduler driver. */
private SchedulerDriver schedulerDriver;

Expand Down Expand Up @@ -158,7 +162,8 @@ public MesosResourceManager(
MesosServices mesosServices,
MesosConfiguration mesosConfig,
MesosTaskManagerParameters taskManagerParameters,
ContainerSpecification taskManagerContainerSpec) {
ContainerSpecification taskManagerContainerSpec,
@Nullable String webUiUrl) {
super(
rpcService,
resourceManagerEndpointId,
Expand All @@ -181,6 +186,7 @@ public MesosResourceManager(

this.taskManagerParameters = Preconditions.checkNotNull(taskManagerParameters);
this.taskManagerContainerSpec = Preconditions.checkNotNull(taskManagerContainerSpec);
this.webUiUrl = webUiUrl;

this.workersInNew = new HashMap<>(8);
this.workersInLaunch = new HashMap<>(8);
Expand Down Expand Up @@ -237,6 +243,10 @@ protected void initialize() throws ResourceManagerException {
Protos.FrameworkInfo.Builder frameworkInfo = mesosConfig.frameworkInfo()
.clone()
.setCheckpoint(true);
if (webUiUrl != null) {
frameworkInfo.setWebuiUrl(webUiUrl);
}

try {
Option<Protos.FrameworkID> frameworkID = workerStore.getFrameworkID();
if (frameworkID.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ public TestingMesosResourceManager(
mesosServices,
mesosConfig,
taskManagerParameters,
taskManagerContainerSpec);
taskManagerContainerSpec,
null);
}

@Override
Expand Down

0 comments on commit 8ba2626

Please sign in to comment.