本文整理了Java中org.apache.flink.runtime.webmonitor.WebMonitorUtils.createDetailsForJob()
方法的一些代码示例,展示了WebMonitorUtils.createDetailsForJob()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebMonitorUtils.createDetailsForJob()
方法的具体详情如下:
包路径:org.apache.flink.runtime.webmonitor.WebMonitorUtils
类名称:WebMonitorUtils
方法名:createDetailsForJob
暂无
代码示例来源: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
@Override
public CompletableFuture<JobDetails> requestJobDetails(Time timeout) {
final ExecutionGraph currentExecutionGraph = executionGraph;
return CompletableFuture.supplyAsync(() -> WebMonitorUtils.createDetailsForJob(currentExecutionGraph), scheduledExecutorService);
}
代码示例来源: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.11
@Nullable
@Override
public JobDetails getAvailableJobDetails(JobID jobId) {
final ArchivedExecutionGraph archivedExecutionGraph = serializableExecutionGraphs.get(jobId);
if (archivedExecutionGraph != null) {
return WebMonitorUtils.createDetailsForJob(archivedExecutionGraph);
} else {
return null;
}
}
代码示例来源:origin: com.alibaba.blink/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: com.alibaba.blink/flink-runtime
@Override
public CompletableFuture<JobDetails> requestJobDetails(@RpcTimeout Time timeout) {
final ExecutionGraph currentExecutionGraph = executionGraph;
return CompletableFuture.supplyAsync(() -> WebMonitorUtils.createDetailsForJob(currentExecutionGraph), scheduledExecutorService);
}
代码示例来源:origin: org.apache.flink/flink-runtime-web_2.10
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
StringWriter writer = new StringWriter();
try (JsonGenerator gen = JsonFactory.jacksonFactory.createGenerator(writer)) {
gen.writeStartObject();
gen.writeArrayFieldStart("running");
gen.writeEndArray();
gen.writeArrayFieldStart("finished");
writeJobDetailOverviewAsJson(WebMonitorUtils.createDetailsForJob(graph), gen, System.currentTimeMillis());
gen.writeEndArray();
gen.writeEndObject();
}
String json = writer.toString();
String path = ALL_JOBS_REST_PATH;
return Collections.singleton(new ArchivedJson(path, json));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
ResponseBody json = new MultipleJobsDetails(Collections.singleton(WebMonitorUtils.createDetailsForJob(graph)));
String path = getMessageHeaders().getTargetRestEndpointURL()
.replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString());
return Collections.singletonList(new ArchivedJson(path, json));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
ResponseBody json = new MultipleJobsDetails(Collections.singleton(WebMonitorUtils.createDetailsForJob(graph)));
String path = getMessageHeaders().getTargetRestEndpointURL()
.replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString());
return Collections.singletonList(new ArchivedJson(path, json));
}
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
ResponseBody json = new MultipleJobsDetails(Collections.singleton(WebMonitorUtils.createDetailsForJob(graph)));
String path = getMessageHeaders().getTargetRestEndpointURL()
.replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString());
return Collections.singletonList(new ArchivedJson(path, json));
}
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
StringWriter writer = new StringWriter();
try (JsonGenerator gen = JsonFactory.JACKSON_FACTORY.createGenerator(writer)) {
gen.writeStartObject();
gen.writeArrayFieldStart(MultipleJobsDetails.FIELD_NAME_JOBS);
final JobDetails.JobDetailsSerializer jobDetailsSerializer = new JobDetails.JobDetailsSerializer();
jobDetailsSerializer.serialize(WebMonitorUtils.createDetailsForJob(graph), gen, null);
gen.writeEndArray();
gen.writeEndObject();
}
String json = writer.toString();
String path = ALL_JOBS_REST_PATH;
return Collections.singleton(new ArchivedJson(path, json));
}
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
@Override
public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException {
final JobStatus jobStatus = archivedExecutionGraph.getState();
final JobID jobId = archivedExecutionGraph.getJobID();
final String jobName = archivedExecutionGraph.getJobName();
Preconditions.checkArgument(
jobStatus.isGloballyTerminalState(),
"The job " + jobName + '(' + jobId +
") is not in a globally terminal state. Instead it is in state " + jobStatus + '.');
switch (jobStatus) {
case FINISHED:
numFinishedJobs++;
break;
case CANCELED:
numCanceledJobs++;
break;
case FAILED:
numFailedJobs++;
break;
default:
throw new IllegalStateException("The job " + jobName + '(' +
jobId + ") should have been in a globally terminal state. " +
"Instead it was in state " + jobStatus + '.');
}
// write the ArchivedExecutionGraph to disk
storeArchivedExecutionGraph(archivedExecutionGraph);
final JobDetails detailsForJob = WebMonitorUtils.createDetailsForJob(archivedExecutionGraph);
jobDetailsCache.put(jobId, detailsForJob);
archivedExecutionGraphCache.put(jobId, archivedExecutionGraph);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException {
final JobStatus jobStatus = archivedExecutionGraph.getState();
final JobID jobId = archivedExecutionGraph.getJobID();
final String jobName = archivedExecutionGraph.getJobName();
Preconditions.checkArgument(
jobStatus.isGloballyTerminalState(),
"The job " + jobName + '(' + jobId +
") is not in a globally terminal state. Instead it is in state " + jobStatus + '.');
switch (jobStatus) {
case FINISHED:
numFinishedJobs++;
break;
case CANCELED:
numCanceledJobs++;
break;
case FAILED:
numFailedJobs++;
break;
default:
throw new IllegalStateException("The job " + jobName + '(' +
jobId + ") should have been in a globally terminal state. " +
"Instead it was in state " + jobStatus + '.');
}
// write the ArchivedExecutionGraph to disk
storeArchivedExecutionGraph(archivedExecutionGraph);
final JobDetails detailsForJob = WebMonitorUtils.createDetailsForJob(archivedExecutionGraph);
jobDetailsCache.put(jobId, detailsForJob);
archivedExecutionGraphCache.put(jobId, archivedExecutionGraph);
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException {
final JobStatus jobStatus = archivedExecutionGraph.getState();
final JobID jobId = archivedExecutionGraph.getJobID();
final String jobName = archivedExecutionGraph.getJobName();
Preconditions.checkArgument(
jobStatus.isGloballyTerminalState(),
"The job " + jobName + '(' + jobId +
") is not in a globally terminal state. Instead it is in state " + jobStatus + '.');
switch (jobStatus) {
case FINISHED:
numFinishedJobs++;
break;
case CANCELED:
numCanceledJobs++;
break;
case FAILED:
numFailedJobs++;
break;
default:
throw new IllegalStateException("The job " + jobName + '(' +
jobId + ") should have been in a globally terminal state. " +
"Instead it was in state " + jobStatus + '.');
}
// write the ArchivedExecutionGraph to disk
storeArchivedExecutionGraph(archivedExecutionGraph);
final JobDetails detailsForJob = WebMonitorUtils.createDetailsForJob(archivedExecutionGraph);
jobDetailsCache.put(jobId, detailsForJob);
archivedExecutionGraphCache.put(jobId, archivedExecutionGraph);
}
内容来源于网络,如有侵权,请联系作者删除!