Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/incubator-flink/pull/251#discussion_r21365607
--- Diff:
flink-addons/flink-mesos/src/main/java/org/apache/flink/mesos/Executors/FlinkJMExecutor.java
---
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.mesos.executors;
+
+import org.apache.flink.client.web.WebInterfaceServer;
+import org.apache.flink.configuration.ConfigConstants;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.GlobalConfiguration;
+import org.apache.flink.mesos.utility.MesosConfiguration;
+import org.apache.flink.mesos.utility.MesosConstants;
+import org.apache.flink.mesos.utility.MesosUtils;
+import org.apache.flink.runtime.jobmanager.JobManager;
+import org.apache.mesos.ExecutorDriver;
+import org.apache.mesos.MesosExecutorDriver;
+import org.apache.mesos.Protos;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Executor class is responsible for executing the actual commands on
the Mesos slaves.
+ */
+public class FlinkJMExecutor extends FlinkExecutor {
+ /**
+ * Thread that is started in launchTask(). It launches the JobManager.
+ */
+ private class JobManagerThread extends Thread{
+ private final ExecutorDriver executorDriver;
+ private final Protos.TaskInfo taskInfo ;
+ private final Logger LOG =
LoggerFactory.getLogger(JobManagerThread.class);
+ private final MesosConfiguration config;
+
+ public JobManagerThread(ExecutorDriver executorDriver,
Protos.TaskInfo taskInfo, MesosConfiguration config) {
+ this.executorDriver = executorDriver;
+ this.taskInfo = taskInfo;
+ this.config = config;
+ }
+
+ @Override
+ public void run() {
+ LOG.info("Starting JM Thread");
+ JobManager jobManager;
+
+ try {
+
+ String[] args = {"-executionMode", "cluster"};
+ String configDir =
config.getString(MesosConstants.MESOS_CONF_DIR, null);
+
+ /*
+ No configuration directory is passed to the
Jobmanager because the
+ initialize() function would reload the the
configuration into the
+ GlobalConfiguration. Since we want to have
flexibility to overwrite some of the configuration details
+ in the configDir file, we load the
configuration manually.
+ */
+ if (configDir != null) {
+
GlobalConfiguration.loadConfiguration(configDir);
+ }
+
GlobalConfiguration.includeConfiguration(this.config);
+
+ jobManager = JobManager.initialize(args);
+ jobManager.startInfoServer();
+
+ if
(config.getBoolean(MesosConstants.MESOS_USE_WEB, false)) {
+ Configuration config =
GlobalConfiguration.getConfiguration();
+
+ // add flink base dir to config
+
config.setString(ConfigConstants.FLINK_BASE_DIR_PATH_KEY, configDir + "/..");
+
+ // get the listening port
+ int port =
config.getInteger(ConfigConstants.WEB_FRONTEND_PORT_KEY,
+
ConfigConstants.DEFAULT_WEBCLIENT_PORT);
+
+ // start the server
+ WebInterfaceServer server = new
WebInterfaceServer(config, port);
+ LOG.info("Starting web frontend server
on port " + port + '.');
+ server.start();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
--- End diff --
I think we should log the exception
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---