本文整理了Java中scala.concurrent.Future.mapTo()
方法的一些代码示例,展示了Future.mapTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Future.mapTo()
方法的具体详情如下:
包路径:scala.concurrent.Future
类名称:Future
方法名:mapTo
暂无
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public CompletableFuture<Collection<Instance>> requestTaskManagerInstances(Time timeout) {
CompletableFuture<JobManagerMessages.RegisteredTaskManagers> taskManagersFuture = FutureUtils.toJava(
jobManagerGateway
.ask(JobManagerMessages.getRequestRegisteredTaskManagers(), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(JobManagerMessages.RegisteredTaskManagers.class)));
return taskManagersFuture.thenApply(
JobManagerMessages.RegisteredTaskManagers::asJavaCollection);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public CompletableFuture<KvStateLocation> requestKvStateLocation(JobID jobId, String registrationName) {
final KvStateMessage.LookupKvStateLocation lookupKvStateLocation = new KvStateMessage.LookupKvStateLocation(jobId, registrationName);
return FutureUtils.toJava(
jobManagerActorGateway
.ask(lookupKvStateLocation, timeout)
.mapTo(ClassTag$.MODULE$.<KvStateLocation>apply(KvStateLocation.class)));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<KvStateLocation> requestKvStateLocation(JobID jobId, String registrationName) {
final KvStateMessage.LookupKvStateLocation lookupKvStateLocation = new KvStateMessage.LookupKvStateLocation(jobId, registrationName);
return FutureUtils.toJava(
jobManagerActorGateway
.ask(lookupKvStateLocation, timeout)
.mapTo(ClassTag$.MODULE$.<KvStateLocation>apply(KvStateLocation.class)));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public CompletableFuture<MultipleJobsDetails> requestMultipleJobDetails(Time timeout) {
return FutureUtils.toJava(
jobManagerGateway
.ask(new RequestJobDetails(true, true), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(MultipleJobsDetails.class)));
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public CompletableFuture<ClusterOverview> requestClusterOverview(Time timeout) {
return FutureUtils.toJava(
jobManagerGateway
.ask(RequestStatusOverview.getInstance(), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(ClusterOverview.class)));
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<MetricDumpSerialization.MetricSerializationResult> queryMetrics(Time timeout) {
return FutureUtils.toJava(
Patterns.ask(queryServiceActorRef, MetricQueryService.getCreateDump(), timeout.toMilliseconds())
.mapTo(ClassTag$.MODULE$.apply(MetricDumpSerialization.MetricSerializationResult.class))
);
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<Integer> requestBlobServerPort(Time timeout) {
return FutureUtils.toJava(
jobManagerGateway
.ask(JobManagerMessages.getRequestBlobManagerPort(), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(Integer.class)));
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<MultipleJobsDetails> requestMultipleJobDetails(Time timeout) {
return FutureUtils.toJava(
jobManagerGateway
.ask(new RequestJobDetails(true, true), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(MultipleJobsDetails.class)));
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
@Override
public CompletableFuture<Integer> requestBlobServerPort(Time timeout) {
return FutureUtils.toJava(
jobManagerGateway
.ask(JobManagerMessages.getRequestBlobManagerPort(), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(Integer.class)));
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
@Override
public CompletableFuture<String> requestRestAddress(Time timeout) {
return FutureUtils.toJava(
jobManagerGateway
.ask(JobManagerMessages.getRequestRestAddress(), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(String.class)));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public CompletableFuture<JobIdsWithStatusOverview> requestJobsOverview(Time timeout) {
return FutureUtils.toJava(
jobManagerGateway
.ask(RequestJobsWithIDsOverview.getInstance(), FutureUtils.toFiniteDuration(timeout))
.mapTo(ClassTag$.MODULE$.apply(JobIdsWithStatusOverview.class)));
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
private CompletableFuture<TransientBlobKey> requestTaskManagerLog(TaskManagerMessages.RequestTaskManagerLog request, Time timeout) {
Preconditions.checkNotNull(request);
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<TransientBlobKey> blobKeyFuture = actorGateway
.ask(
request,
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<TransientBlobKey>apply(TransientBlobKey.class));
return FutureUtils.toJava(blobKeyFuture);
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
@Override
public Future<StackTrace> requestStackTrace(final Time timeout) {
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<StackTrace> stackTraceFuture = actorGateway.ask(
TaskManagerMessages.SendStackTrace$.MODULE$.get(),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<StackTrace>apply(StackTrace.class));
return new FlinkFuture<>(stackTraceFuture);
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<StackTrace> requestStackTrace(final Time timeout) {
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<StackTrace> stackTraceFuture = actorGateway.ask(
TaskManagerMessages.SendStackTrace$.MODULE$.get(),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<StackTrace>apply(StackTrace.class));
return FutureUtils.toJava(stackTraceFuture);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
@Override
public Future<Acknowledge> submitTask(TaskDeploymentDescriptor tdd, Time timeout) {
Preconditions.checkNotNull(tdd);
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<Acknowledge> submitResult = actorGateway.ask(
new TaskMessages.SubmitTask(tdd),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<Acknowledge>apply(Acknowledge.class));
return new FlinkFuture<>(submitResult);
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<Acknowledge> submitTask(TaskDeploymentDescriptor tdd, Time timeout) {
Preconditions.checkNotNull(tdd);
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<Acknowledge> submitResult = actorGateway.ask(
new TaskMessages.SubmitTask(tdd),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<Acknowledge>apply(Acknowledge.class));
return FutureUtils.toJava(submitResult);
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Time timeout) {
Preconditions.checkNotNull(executionAttemptID);
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<Acknowledge> cancelResult = actorGateway.ask(
new TaskMessages.CancelTask(executionAttemptID),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<Acknowledge>apply(Acknowledge.class));
return FutureUtils.toJava(cancelResult);
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
@Override
public CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Time timeout) {
Preconditions.checkNotNull(executionAttemptID);
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<Acknowledge> cancelResult = actorGateway.ask(
new TaskMessages.CancelTask(executionAttemptID),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<Acknowledge>apply(Acknowledge.class));
return FutureUtils.toJava(cancelResult);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public CompletableFuture<Acknowledge> stopTask(ExecutionAttemptID executionAttemptID, Time timeout) {
Preconditions.checkNotNull(executionAttemptID);
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<Acknowledge> stopResult = actorGateway.ask(
new TaskMessages.StopTask(executionAttemptID),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<Acknowledge>apply(Acknowledge.class));
return FutureUtils.toJava(stopResult);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
@Override
public Future<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Time timeout) {
Preconditions.checkNotNull(executionAttemptID);
Preconditions.checkNotNull(timeout);
scala.concurrent.Future<Acknowledge> cancelResult = actorGateway.ask(
new TaskMessages.CancelTask(executionAttemptID),
new FiniteDuration(timeout.getSize(), timeout.getUnit()))
.mapTo(ClassTag$.MODULE$.<Acknowledge>apply(Acknowledge.class));
return new FlinkFuture<>(cancelResult);
}
内容来源于网络,如有侵权,请联系作者删除!