本文整理了Java中org.apache.flink.runtime.webmonitor.WebMonitorUtils
类的一些代码示例,展示了WebMonitorUtils
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebMonitorUtils
类的具体详情如下:
包路径:org.apache.flink.runtime.webmonitor.WebMonitorUtils
类名称:WebMonitorUtils
[英]Utilities for the web runtime monitor. This class contains for example methods to build messages with aggregate information about the state of an execution graph, to be send to the web server.
[中]web运行时监视器的实用程序。例如,该类包含一些方法,用于构建包含有关执行图状态的聚合信息的消息,并将其发送到web服务器。
代码示例来源:origin: apache/flink
for (String refreshDirectory : refreshDirectories.split(",")) {
try {
Path refreshPath = WebMonitorUtils.validateAndNormalizeUri(new Path(refreshDirectory).toUri());
FileSystem refreshFS = refreshPath.getFileSystem();
refreshDirs.add(new RefreshLocation(refreshPath, refreshFS));
代码示例来源:origin: apache/flink
@Test
public void testGetArchivers() {
JsonArchivist[] direct = WebRuntimeMonitor.getJsonArchivists();
JsonArchivist[] reflected = WebMonitorUtils.getJsonArchivists();
Assert.assertEquals(direct.length, reflected.length);
for (int x = 0; x < direct.length; x++) {
Assert.assertSame(direct[x].getClass(), reflected[x].getClass());
}
}
代码示例来源:origin: apache/flink
/**
* Tests dynamically loading of handlers such as {@link JarUploadHandler}.
*/
@Test
public void testLoadWebSubmissionExtension() throws Exception {
final Configuration configuration = new Configuration();
configuration.setString(JobManagerOptions.ADDRESS, "localhost");
final WebMonitorExtension webMonitorExtension = WebMonitorUtils.loadWebSubmissionExtension(
CompletableFuture::new,
Time.seconds(10),
Collections.emptyMap(),
CompletableFuture.completedFuture("localhost:12345"),
Paths.get("/tmp"),
Executors.directExecutor(),
configuration);
assertThat(webMonitorExtension, is(not(nullValue())));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public CompletableFuture<JobDetails> requestJobDetails(Time timeout) {
final ExecutionGraph currentExecutionGraph = executionGraph;
return CompletableFuture.supplyAsync(() -> WebMonitorUtils.createDetailsForJob(currentExecutionGraph), scheduledExecutorService);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
WebMonitor monitor = WebMonitorUtils.startWebRuntimeMonitor(
config,
highAvailabilityServices,
代码示例来源:origin: org.apache.flink/flink-runtime
/**
* Checks whether the flink-runtime-web dependency is available and if so returns a
* StaticFileServerHandler which can serve the static file contents.
*
* @param leaderRetriever to be used by the StaticFileServerHandler
* @param restAddressFuture of the underlying REST server endpoint
* @param timeout for lookup requests
* @param tmpDir to be used by the StaticFileServerHandler to store temporary files
* @param <T> type of the gateway to retrieve
* @return StaticFileServerHandler if flink-runtime-web is in the classpath; Otherwise Optional.empty
* @throws IOException if we cannot create the StaticFileServerHandler
*/
public static <T extends RestfulGateway> Optional<StaticFileServerHandler<T>> tryLoadWebContent(
GatewayRetriever<? extends T> leaderRetriever,
CompletableFuture<String> restAddressFuture,
Time timeout,
File tmpDir) throws IOException {
if (isFlinkRuntimeWebInClassPath()) {
return Optional.of(new StaticFileServerHandler<>(
leaderRetriever,
restAddressFuture,
timeout,
tmpDir));
} else {
return Optional.empty();
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
optWebContent = WebMonitorUtils.tryLoadWebContent(
leaderRetriever,
restAddressFuture,
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<JobDetails> requestJobDetails(Time timeout) {
final ExecutionGraph currentExecutionGraph = executionGraph;
return CompletableFuture.supplyAsync(() -> WebMonitorUtils.createDetailsForJob(currentExecutionGraph), scheduledExecutorService);
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
WebMonitor monitor = WebMonitorUtils.startWebRuntimeMonitor(
config,
highAvailabilityServices,
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
/**
* Checks whether the flink-runtime-web dependency is available and if so returns a
* StaticFileServerHandler which can serve the static file contents.
*
* @param leaderRetriever to be used by the StaticFileServerHandler
* @param restAddressFuture of the underlying REST server endpoint
* @param timeout for lookup requests
* @param tmpDir to be used by the StaticFileServerHandler to store temporary files
* @param <T> type of the gateway to retrieve
* @return StaticFileServerHandler if flink-runtime-web is in the classpath; Otherwise Optional.empty
* @throws IOException if we cannot create the StaticFileServerHandler
*/
public static <T extends RestfulGateway> Optional<StaticFileServerHandler<T>> tryLoadWebContent(
GatewayRetriever<? extends T> leaderRetriever,
CompletableFuture<String> restAddressFuture,
Time timeout,
File tmpDir) throws IOException {
if (isFlinkRuntimeWebInClassPath()) {
return Optional.of(new StaticFileServerHandler<>(
leaderRetriever,
restAddressFuture,
timeout,
tmpDir));
} else {
return Optional.empty();
}
}
代码示例来源:origin: org.apache.flink/flink-runtime
optWebContent = WebMonitorUtils.tryLoadWebContent(
leaderRetriever,
restAddressFuture,
代码示例来源:origin: org.apache.flink/flink-runtime
static HistoryServerArchivist createHistoryServerArchivist(Configuration configuration, JsonArchivist jsonArchivist) {
final String configuredArchivePath = configuration.getString(JobManagerOptions.ARCHIVE_DIR);
if (configuredArchivePath != null) {
final Path archivePath = WebMonitorUtils.validateAndNormalizeUri(new Path(configuredArchivePath).toUri());
return new JsonResponseHistoryServerArchivist(jsonArchivist, archivePath);
} else {
return VoidHistoryServerArchivist.INSTANCE;
}
}
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Nullable
@Override
public JobDetails getAvailableJobDetails(JobID jobId) {
final ArchivedExecutionGraph archivedExecutionGraph = serializableExecutionGraphs.get(jobId);
if (archivedExecutionGraph != null) {
return WebMonitorUtils.createDetailsForJob(archivedExecutionGraph);
} else {
return null;
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
gen.writeStartObject();
gen.writeArrayFieldStart(ARCHIVE);
for (JsonArchivist archiver : WebMonitorUtils.getJsonArchivists()) {
for (ArchivedJson archive : archiver.archiveJsonWithPath(graph)) {
gen.writeStartObject();
代码示例来源:origin: org.apache.flink/flink-runtime
webSubmissionExtension = WebMonitorUtils.loadWebSubmissionExtension(
leaderRetriever,
restAddressFuture,
代码示例来源:origin: org.apache.flink/flink-runtime
WebMonitor monitor = WebMonitorUtils.startWebRuntimeMonitor(
config,
highAvailabilityServices,
代码示例来源:origin: com.alibaba.blink/flink-runtime
/**
* Checks whether the flink-runtime-web dependency is available and if so returns a
* StaticFileServerHandler which can serve the static file contents.
*
* @param leaderRetriever to be used by the StaticFileServerHandler
* @param restAddressFuture of the underlying REST server endpoint
* @param timeout for lookup requests
* @param tmpDir to be used by the StaticFileServerHandler to store temporary files
* @param <T> type of the gateway to retrieve
* @return StaticFileServerHandler if flink-runtime-web is in the classpath; Otherwise Optional.empty
* @throws IOException if we cannot create the StaticFileServerHandler
*/
public static <T extends RestfulGateway> Optional<StaticFileServerHandler<T>> tryLoadWebContent(
GatewayRetriever<? extends T> leaderRetriever,
CompletableFuture<String> restAddressFuture,
Time timeout,
File tmpDir) throws IOException {
if (isFlinkRuntimeWebInClassPath()) {
return Optional.of(new StaticFileServerHandler<>(
leaderRetriever,
restAddressFuture,
timeout,
tmpDir));
} else {
return Optional.empty();
}
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
optWebContent = WebMonitorUtils.tryLoadWebContent(
leaderRetriever,
restAddressFuture,
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
static HistoryServerArchivist createHistoryServerArchivist(Configuration configuration, JsonArchivist jsonArchivist) {
final String configuredArchivePath = configuration.getString(JobManagerOptions.ARCHIVE_DIR);
if (configuredArchivePath != null) {
final Path archivePath = WebMonitorUtils.validateAndNormalizeUri(new Path(configuredArchivePath).toUri());
return new JsonResponseHistoryServerArchivist(jsonArchivist, archivePath);
} else {
return VoidHistoryServerArchivist.INSTANCE;
}
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Nullable
@Override
public JobDetails getAvailableJobDetails(JobID jobId) {
final ArchivedExecutionGraph archivedExecutionGraph = serializableExecutionGraphs.get(jobId);
if (archivedExecutionGraph != null) {
return WebMonitorUtils.createDetailsForJob(archivedExecutionGraph);
} else {
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!