lamber-ken commented on a change in pull request #11887:
URL: https://github.com/apache/flink/pull/11887#discussion_r415775714
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutor.java
##########
@@ -1012,10 +1016,34 @@ public void disconnectResourceManager(Exception cause) {
}
}
+ @Override
+ public CompletableFuture<ThreadDumpInfo> requestThreadDump(Time
timeout) {
+ final Collection<ThreadInfo> threadDump =
JvmUtils.createThreadDump();
+
+ final Collection<ThreadDumpInfo.ThreadInfo> threadInfos =
threadDump.stream()
+ .map(threadInfo ->
ThreadDumpInfo.ThreadInfo.create(threadInfo.getThreadName(),
threadInfo.toString()))
+ .collect(Collectors.toList());
+
+ return
CompletableFuture.completedFuture(ThreadDumpInfo.create(threadInfos));
+ }
+
//
======================================================================
// Internal methods
//
======================================================================
+ private CompletableFuture<TransientBlobKey>
putTransientBlobStream(InputStream inputStream, String fileTag) {
+ final TransientBlobCache transientBlobService =
blobCacheService.getTransientBlobService();
+ final TransientBlobKey transientBlobKey;
+
+ try {
+ transientBlobKey =
transientBlobService.putTransient(inputStream);
+ } catch (IOException e) {
+ log.debug("Could not upload file {}.", fileTag, e);
+ return FutureUtils.completedExceptionally(new
FlinkException("Could not upload file " + fileTag + '.', e));
+ }
+ return CompletableFuture.completedFuture(transientBlobKey);
+ }
+
Review comment:
> I think this change is still good since it breaks up a longer method
into smaller units.
ok
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]