public class WebRuntimeMonitor extends Object implements org.apache.flink.runtime.webmonitor.WebMonitor
The web runtime monitor is based in Netty HTTP. It uses the Netty-Router library to route HTTP requests of different paths to different response handlers. In addition, it serves the static files of the web frontend, such as HTML, CSS, or JS files.
Modifier and Type | Field and Description |
---|---|
static org.apache.flink.api.common.time.Time |
DEFAULT_REQUEST_TIMEOUT
By default, all requests to the JobManager have a timeout of 10 seconds.
|
Constructor and Description |
---|
WebRuntimeMonitor(org.apache.flink.configuration.Configuration config,
org.apache.flink.runtime.leaderretrieval.LeaderRetrievalService leaderRetrievalService,
org.apache.flink.runtime.webmonitor.retriever.LeaderGatewayRetriever<org.apache.flink.runtime.jobmaster.JobManagerGateway> jobManagerRetriever,
org.apache.flink.runtime.webmonitor.retriever.MetricQueryServiceRetriever queryServiceRetriever,
org.apache.flink.api.common.time.Time timeout,
org.apache.flink.runtime.concurrent.ScheduledExecutor scheduledExecutor) |
Modifier and Type | Method and Description |
---|---|
static void |
checkAndCreateUploadDir(File uploadDir)
Checks whether the given directory exists and is writable.
|
static org.apache.flink.runtime.webmonitor.history.JsonArchivist[] |
getJsonArchivists()
Returns an array of all
JsonArchivist s that are relevant for the history server. |
String |
getRestAddress() |
int |
getServerPort() |
static void |
logExternalUploadDirDeletion(File uploadDir) |
void |
start() |
void |
stop() |
public static final org.apache.flink.api.common.time.Time DEFAULT_REQUEST_TIMEOUT
public WebRuntimeMonitor(org.apache.flink.configuration.Configuration config, org.apache.flink.runtime.leaderretrieval.LeaderRetrievalService leaderRetrievalService, org.apache.flink.runtime.webmonitor.retriever.LeaderGatewayRetriever<org.apache.flink.runtime.jobmaster.JobManagerGateway> jobManagerRetriever, org.apache.flink.runtime.webmonitor.retriever.MetricQueryServiceRetriever queryServiceRetriever, org.apache.flink.api.common.time.Time timeout, org.apache.flink.runtime.concurrent.ScheduledExecutor scheduledExecutor) throws IOException, InterruptedException
IOException
InterruptedException
public static org.apache.flink.runtime.webmonitor.history.JsonArchivist[] getJsonArchivists()
JsonArchivist
s that are relevant for the history server.
This method is static to allow easier access from the MemoryArchivist
. Requiring a reference
would imply that the WebRuntimeMonitor is always created before the archivist, which may not hold for all
deployment modes.
Similarly, no handler implements the JsonArchivist interface itself but instead contains a separate implementing class; otherwise we would either instantiate several handlers even though their main functionality isn't required, or yet again require that the WebRuntimeMonitor is started before the archivist.
public void start() throws Exception
start
in interface org.apache.flink.runtime.webmonitor.WebMonitor
Exception
public void stop() throws Exception
stop
in interface org.apache.flink.runtime.webmonitor.WebMonitor
Exception
public int getServerPort()
getServerPort
in interface org.apache.flink.runtime.webmonitor.WebMonitor
public String getRestAddress()
getRestAddress
in interface org.apache.flink.runtime.webmonitor.WebMonitor
public static void logExternalUploadDirDeletion(File uploadDir)
public static void checkAndCreateUploadDir(File uploadDir) throws IOException
uploadDir
- directory to checkIOException
- if the directory does not exist and cannot be created, or if the directory isn't writableCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.