commit | 03f3b68a77c34c25cd513080372d61d073ae0fa7 | [log] [tgz] |
---|---|---|
author | Tsz-Wo Nicholas Sze <szetszwo@apache.org> | Tue Jul 20 13:33:15 2021 +0800 |
committer | GitHub <noreply@github.com> | Tue Jul 20 11:03:15 2021 +0530 |
tree | 4a383ddb959036597cd7e4b76d7654fa7e6fd8c1 | |
parent | 3f4f5ffc6d34ac906d71feea0d9c6f845663e138 [diff] |
RATIS-1388 Add an isEmpty method to TaskQueue. (#487)
diff --git a/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java b/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java index 767e308..9d7350c 100644 --- a/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java +++ b/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java
@@ -57,6 +57,13 @@ } /** + * Is this queue empty? + */ + public boolean isEmpty() { + return q.isEmpty(); + } + + /** * Poll the current head from this queue * and then submit the next head, if there is any. */