提交 8d4be699 编写于 作者: P Piotr Nowojski 提交者: Piotr Nowojski

[hotfix][task] Optimize and simplify Task#isBackPressured

上级 a8ec54cb
......@@ -511,12 +511,12 @@ public class Task
if (invokable == null || consumableNotifyingPartitionWriters.length == 0 || !isRunning()) {
return false;
}
final CompletableFuture<?>[] outputFutures =
new CompletableFuture[consumableNotifyingPartitionWriters.length];
for (int i = 0; i < outputFutures.length; ++i) {
outputFutures[i] = consumableNotifyingPartitionWriters[i].getAvailableFuture();
for (int i = 0; i < consumableNotifyingPartitionWriters.length; ++i) {
if (!consumableNotifyingPartitionWriters[i].isAvailable()) {
return true;
}
}
return !CompletableFuture.allOf(outputFutures).isDone();
return false;
}
// ------------------------------------------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册